<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: compiler OK, But execute it shows Error: Segmentation fault in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/compiler-ok-but-execute-it-shows-error-segmentation-fault-core/m-p/4091902#M92485</link>
    <description>&lt;P&gt;You can check this by printing ptr. It probably has the upper 32 bits truncated.&lt;BR /&gt;&lt;BR /&gt;Note the proper cast is (APC_PNDN_LOT*). malloc already returns a void*.&lt;/P&gt;</description>
    <pubDate>Sun, 18 Sep 2011 21:26:02 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-09-18T21:26:02Z</dc:date>
    <item>
      <title>compiler OK, But execute it shows Error : Segmentation fault (core dumped)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/compiler-ok-but-execute-it-shows-error-segmentation-fault-core/m-p/4091899#M92482</link>
      <description>Hi C program expert,&lt;BR /&gt;   I've C problem , the part of code as below:&lt;BR /&gt;Could anybody knows why execute it would get the Error : Segmentation fault (core dumped) ?&lt;BR /&gt;Thanks in advanced.&lt;BR /&gt;&lt;BR /&gt;=====================================&lt;BR /&gt;typedef struct APC_PNDN_Lot &lt;BR /&gt;  { &lt;BR /&gt;    char  LotId[15]; &lt;BR /&gt;    int   ImpWaferCount; &lt;BR /&gt;    char  ImpWaferList[400]; &lt;BR /&gt;    char  Area[10]; &lt;BR /&gt;    struct APC_PNDN_Lot* Next; &lt;BR /&gt;  } APC_PNDN_LOT; &lt;BR /&gt;&lt;BR /&gt;  APC_PNDN_LOT *ptr; &lt;BR /&gt;  ptr = (void *)(malloc (sizeof (APC_PNDN_LOT))); &lt;BR /&gt;  &lt;BR /&gt;  ptr-&amp;gt;ImpWaferList[0]=0x00; &lt;BR /&gt;  ptr-&amp;gt;LotId[0]=0x00; &lt;BR /&gt;  ptr-&amp;gt;Area[0]=0x00; &lt;BR /&gt;===========================================&lt;BR /&gt;&lt;BR /&gt;Used GDB got the below:&lt;BR /&gt;Program received signal SIGSEGV, Segmentation fault &lt;BR /&gt; si_code: 1 - SEGV_MAPERR - Address not mapped to object. &lt;BR /&gt;0x40000000000048a0:0 in main () at APC_PNDN.c:527 &lt;BR /&gt;527                 ptr-&amp;gt;ImpWaferList[0]=0x00;</description>
      <pubDate>Wed, 24 Oct 2007 22:17:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/compiler-ok-but-execute-it-shows-error-segmentation-fault-core/m-p/4091899#M92482</guid>
      <dc:creator>j773303</dc:creator>
      <dc:date>2007-10-24T22:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: compiler OK, But execute it shows Error : Segmentation fault (core dumped)</title>
      <link>https://community.hpe.com/t5/operating-system-linux/compiler-ok-but-execute-it-shows-error-segmentation-fault-core/m-p/4091900#M92483</link>
      <description>You could try this:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1110034" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1110034&lt;/A&gt;</description>
      <pubDate>Wed, 24 Oct 2007 22:51:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/compiler-ok-but-execute-it-shows-error-segmentation-fault-core/m-p/4091900#M92483</guid>
      <dc:creator>Venkatesh BL</dc:creator>
      <dc:date>2007-10-24T22:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: compiler OK, But execute it shows Error: Segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-linux/compiler-ok-but-execute-it-shows-error-segmentation-fault-core/m-p/4091901#M92484</link>
      <description>&lt;P&gt;&amp;gt;ptr = (void*)malloc(sizeof(APC_PNDN_LOT));&lt;BR /&gt;&lt;BR /&gt;This code isn't legal. The extra cast implies that there isn't any prototype for malloc.&lt;BR /&gt;On A.06.15 in 64 bit mode this is now a compiler error.&lt;BR /&gt;Make sure you include &amp;lt;stdlib.h&amp;gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Sep 2011 21:28:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/compiler-ok-but-execute-it-shows-error-segmentation-fault-core/m-p/4091901#M92484</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-18T21:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: compiler OK, But execute it shows Error: Segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-linux/compiler-ok-but-execute-it-shows-error-segmentation-fault-core/m-p/4091902#M92485</link>
      <description>&lt;P&gt;You can check this by printing ptr. It probably has the upper 32 bits truncated.&lt;BR /&gt;&lt;BR /&gt;Note the proper cast is (APC_PNDN_LOT*). malloc already returns a void*.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Sep 2011 21:26:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/compiler-ok-but-execute-it-shows-error-segmentation-fault-core/m-p/4091902#M92485</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-18T21:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: compiler OK, But execute it shows Error: Segmentation fault</title>
      <link>https://community.hpe.com/t5/operating-system-linux/compiler-ok-but-execute-it-shows-error-segmentation-fault-core/m-p/4091903#M92486</link>
      <description>&lt;P&gt;We haven't heard any feedback on our suggestions. Have you solved your problem?&lt;BR /&gt;If our suggestions were helpful, please read the following about assigning points:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#33" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/helptips.do?#33&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Sep 2011 21:26:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/compiler-ok-but-execute-it-shows-error-segmentation-fault-core/m-p/4091903#M92486</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-18T21:26:36Z</dc:date>
    </item>
  </channel>
</rss>

