<?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: Core file (segmentation fault) strings help in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659239#M79681</link>
    <description>A segmentation fault usually means that the running program attempted to do something with a pointer that was not properly initialized.&lt;BR /&gt;&lt;BR /&gt;This can happen for a lot of reasons.&lt;BR /&gt;&lt;BR /&gt;The easiest way to find out where the seg fault came from is load your core file in gdb and do a backtrace.  That will show you where in the call stack the program died (provided the program was compiled with the -g option).&lt;BR /&gt;&lt;BR /&gt;Several of the routine names should be recognizable to you and you should be able to narrow it down to the line of code that dies.</description>
    <pubDate>Fri, 15 Feb 2002 14:33:53 GMT</pubDate>
    <dc:creator>Eric Ladner</dc:creator>
    <dc:date>2002-02-15T14:33:53Z</dc:date>
    <item>
      <title>Core file (segmentation fault) strings help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659236#M79678</link>
      <description>I'm trying to figure out what the problem is with a program that I've compiled.&lt;BR /&gt;It works on HP-UX and on MPE/IX but I can't get it to run on Linux.&lt;BR /&gt;I'll attach the core file (if I can).&lt;BR /&gt;Any help would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;John</description>
      <pubDate>Tue, 05 Feb 2002 21:06:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659236#M79678</guid>
      <dc:creator>John Love_3</dc:creator>
      <dc:date>2002-02-05T21:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Core file (segmentation fault) strings help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659237#M79679</link>
      <description>I don't think the core has attached and I'm pretty sure there's a limit on this web site too so I'd suggest it won't be worth trying again.&lt;BR /&gt;&lt;BR /&gt;Qus. What's the program do, written in, O/S's involved ? Source code eg ?&lt;BR /&gt;&lt;BR /&gt;try a "file core" or try using one of the debuggers in /opt/langtools/bin : dde,gdb or wdb ?&lt;BR /&gt;&lt;BR /&gt;You may also find the following URL useful : &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://devresource.hp.com/" target="_blank"&gt;http://devresource.hp.com/&lt;/A&gt;</description>
      <pubDate>Wed, 06 Feb 2002 09:08:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659237#M79679</guid>
      <dc:creator>Alex Glennie</dc:creator>
      <dc:date>2002-02-06T09:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Core file (segmentation fault) strings help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659238#M79680</link>
      <description>It's a C program written to simulate airline reservation bookings so we can get a benchmark on the Transactions Per Second.&lt;BR /&gt;So basically a benchmark app.  It opens TCP sockets, makes a random booking on a random date, random to and from destinations, etc.&lt;BR /&gt;&lt;BR /&gt;So, compiled on Linux to connect to the 3000.  He did have a lot of compile errors, but has fixed them so it compiles with no errors.&lt;BR /&gt;&lt;BR /&gt;What is a Segmentation Fault? Is it any clue as to the problem?&lt;BR /&gt;&lt;BR /&gt;Thanks again.  I can probably send you the .c file (code) if you think you can help.&lt;BR /&gt;&lt;BR /&gt;John</description>
      <pubDate>Wed, 06 Feb 2002 18:45:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659238#M79680</guid>
      <dc:creator>John Love_3</dc:creator>
      <dc:date>2002-02-06T18:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Core file (segmentation fault) strings help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659239#M79681</link>
      <description>A segmentation fault usually means that the running program attempted to do something with a pointer that was not properly initialized.&lt;BR /&gt;&lt;BR /&gt;This can happen for a lot of reasons.&lt;BR /&gt;&lt;BR /&gt;The easiest way to find out where the seg fault came from is load your core file in gdb and do a backtrace.  That will show you where in the call stack the program died (provided the program was compiled with the -g option).&lt;BR /&gt;&lt;BR /&gt;Several of the routine names should be recognizable to you and you should be able to narrow it down to the line of code that dies.</description>
      <pubDate>Fri, 15 Feb 2002 14:33:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659239#M79681</guid>
      <dc:creator>Eric Ladner</dc:creator>
      <dc:date>2002-02-15T14:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Core file (segmentation fault) strings help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659240#M79682</link>
      <description>Eric,&lt;BR /&gt;The problem seems to occur on Socket Receives.&lt;BR /&gt;Is there something about sockets that's different on Linux vs. HP-UX?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;John</description>
      <pubDate>Fri, 15 Feb 2002 17:18:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659240#M79682</guid>
      <dc:creator>John Love_3</dc:creator>
      <dc:date>2002-02-15T17:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Core file (segmentation fault) strings help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659241#M79683</link>
      <description>Are there any flags on the recv() call?  (you are using recv, right?)&lt;BR /&gt;&lt;BR /&gt;I see there are some flags not in common between Linux and HP.  &lt;BR /&gt;&lt;BR /&gt;Also, note that the recv will fail if the connect prior to the first recv failed (i.e. trying to recv from a null socket).  Error checking might be in order, but that only pushes up your problem to the socket connection itself.</description>
      <pubDate>Fri, 15 Feb 2002 17:45:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659241#M79683</guid>
      <dc:creator>Eric Ladner</dc:creator>
      <dc:date>2002-02-15T17:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Core file (segmentation fault) strings help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659242#M79684</link>
      <description>Eric,&lt;BR /&gt;Have a look at the code see if you see anything.&lt;BR /&gt;&lt;BR /&gt;int connect_socket()&lt;BR /&gt;{&lt;BR /&gt;int addrlen = 0;&lt;BR /&gt;&lt;BR /&gt;struct sockaddr_in serveraddr;&lt;BR /&gt;&lt;BR /&gt;   if ((fSock=socket(AF_INET,SOCK_STREAM,0)) &amp;lt; 0) {&lt;BR /&gt;      perror("Client Socket call Error(1)");&lt;BR /&gt;      printf("Client Socket call Error(1)[%d]\n", sys_pin);&lt;BR /&gt;      return -1;&lt;BR /&gt;   }&lt;BR /&gt;&lt;BR /&gt;   serveraddr.sin_addr.s_addr = inet_addr(SERV_HOST_ADDR);&lt;BR /&gt;   serveraddr.sin_port        = htons(SERV_TCP_PORT);&lt;BR /&gt;   serveraddr.sin_family      = AF_INET;&lt;BR /&gt;&lt;BR /&gt;   addrlen=sizeof(struct sockaddr_in);&lt;BR /&gt;&lt;BR /&gt;   if (connect(fSock, (struct sockaddr *) &amp;amp;serveraddr, addrlen) &amp;lt; 0) {&lt;BR /&gt;      perror("Client Connect call Error(2)");&lt;BR /&gt;      printf("Client Connect call Error(2)[%d]\n", sys_pin);&lt;BR /&gt;      return -1;&lt;BR /&gt;   }&lt;BR /&gt;&lt;BR /&gt;   return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;int recv_it(char *spStatInfo,char *spStatSub)&lt;BR /&gt;{&lt;BR /&gt;char id[3]   = "  ";&lt;BR /&gt;char code[3] = "  ";&lt;BR /&gt;&lt;BR /&gt;struct timeval timeout;&lt;BR /&gt;   &lt;BR /&gt;int retval   = 0;&lt;BR /&gt;int data_len = 0;&lt;BR /&gt;int total    = 0;&lt;BR /&gt;int len      = 0;&lt;BR /&gt;int hsize    = 8;&lt;BR /&gt;int period   = 180;&lt;BR /&gt;int iStatus  = 0;&lt;BR /&gt;&lt;BR /&gt;   fd_set readmask;   &lt;BR /&gt;&lt;BR /&gt;   FD_ZERO(&amp;amp;readmask);&lt;BR /&gt;   FD_SET(fSock,&amp;amp;readmask);&lt;BR /&gt;   timeout.tv_sec  = period;&lt;BR /&gt;   timeout.tv_usec = 0;&lt;BR /&gt;&lt;BR /&gt;   retval = select(fSock + 1, (fd_set *) &amp;amp;readmask, NULL, NULL, &amp;amp;timeout);&lt;BR /&gt;   if (retval &amp;lt; 0) {&lt;BR /&gt;      iStatus = ERRORSELECT;&lt;BR /&gt;      printf("Socket select error(1).[%d]\n", sys_pin);&lt;BR /&gt;      return iStatus;&lt;BR /&gt;   }&lt;BR /&gt;   else if (retval == 0) {&lt;BR /&gt;      iStatus = TIMEDOUT;&lt;BR /&gt;      printf("Socket TimeOut/Error(1).[%d]\n", sys_pin);&lt;BR /&gt;      return iStatus;&lt;BR /&gt;   }&lt;BR /&gt;   else if (!FD_ISSET(fSock, &amp;amp;readmask)) {&lt;BR /&gt;      iStatus = ERRORSOCKSELECT;&lt;BR /&gt;      printf("Socket ErrorSelect(1).[%d]\n", sys_pin);&lt;BR /&gt;      return iStatus;&lt;BR /&gt;   }&lt;BR /&gt;&lt;BR /&gt;   len = recv(fSock, (char *) &amp;amp;osreturn, hsize, 0);&lt;BR /&gt;   if (len &amp;lt; hsize) {&lt;BR /&gt;      iStatus = ERRORRECV;&lt;BR /&gt;      printf("Socket Receive/Error(1).[%d]\n", sys_pin);&lt;BR /&gt;      return iStatus;&lt;BR /&gt;   }&lt;BR /&gt;&lt;BR /&gt;   data_len = osreturn.mh.iHeaderLen - hsize;&lt;BR /&gt;   memset(osreturn.md.data,32,strlen(osreturn.md.data));&lt;BR /&gt;&lt;BR /&gt;   while (total &amp;lt; data_len) {&lt;BR /&gt;      FD_ZERO(&amp;amp;readmask);&lt;BR /&gt;      FD_SET(fSock, &amp;amp;readmask);&lt;BR /&gt;      timeout.tv_sec = period;&lt;BR /&gt;      timeout.tv_usec = 0;&lt;BR /&gt;      retval = select(fSock + 1, (fd_set *) &amp;amp;readmask, NULL, NULL, &amp;amp;timeout);&lt;BR /&gt;      if (retval &amp;lt; 0) {&lt;BR /&gt;         iStatus = ERRORSELECT;&lt;BR /&gt;         printf("Socket ErrorSelect(2).[%d]\n", sys_pin);&lt;BR /&gt;         break;&lt;BR /&gt;      }&lt;BR /&gt;      else if (retval == 0) {&lt;BR /&gt;         iStatus = TIMEDOUT;&lt;BR /&gt;         printf("Socket TimeOut/Error(2).[%d]\n", sys_pin);&lt;BR /&gt;         break;&lt;BR /&gt;      }&lt;BR /&gt;      else if (!FD_ISSET(fSock, &amp;amp;readmask)) {&lt;BR /&gt;         iStatus = ERRORSOCKSELECT;&lt;BR /&gt;         printf("Socket ErrorSockSelect(2).[%d]\n", sys_pin);&lt;BR /&gt;         break;&lt;BR /&gt;      }&lt;BR /&gt;&lt;BR /&gt;      len = recv(fSock, (char *) &amp;amp;osreturn+hsize+total, sizeof(osreturn), 0);&lt;BR /&gt;      if (len &amp;lt;= 0) {&lt;BR /&gt;         iStatus = ERRORRECV;&lt;BR /&gt;         printf("Socket Receive/Error(2).[%d]\n", sys_pin);&lt;BR /&gt;         break;&lt;BR /&gt;      }&lt;BR /&gt;&lt;BR /&gt;      total += len;&lt;BR /&gt;   }&lt;BR /&gt;&lt;BR /&gt;   if(iStatus != 0) return iStatus;&lt;BR /&gt;&lt;BR /&gt;   process_transaction(code);&lt;BR /&gt;&lt;BR /&gt;   return iStatus;&lt;BR /&gt;}&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Feb 2002 18:22:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659242#M79684</guid>
      <dc:creator>John Love_3</dc:creator>
      <dc:date>2002-02-15T18:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Core file (segmentation fault) strings help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659243#M79685</link>
      <description>Put a printf right before the recv to make sure that the fSock and &amp;amp;osreturn is non null.  The only thing I can see here that could be a problem would be if osreturn is invalid or is defined to be smaller than hsize.</description>
      <pubDate>Fri, 15 Feb 2002 19:35:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659243#M79685</guid>
      <dc:creator>Eric Ladner</dc:creator>
      <dc:date>2002-02-15T19:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Core file (segmentation fault) strings help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659244#M79686</link>
      <description>Eric, &lt;BR /&gt;First of all a HUGE THANKS FOR YOUR HELP.&lt;BR /&gt;&lt;BR /&gt;it looks like 'iHeaderLen' is getting trashed somehow ... ask if they see anything wrong with the way i have my structures..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;typedef struct {&lt;BR /&gt;   char pacRecipient[4];&lt;BR /&gt;   int  iHeaderLen;&lt;BR /&gt;   char module_id[2];&lt;BR /&gt;   char trans_code[2];&lt;BR /&gt;   char more_flag[1];&lt;BR /&gt;   char statinfo[4];&lt;BR /&gt;   char subsys[4];&lt;BR /&gt;   char version[3];&lt;BR /&gt;   char tell_flag[1];&lt;BR /&gt;   char filler[3];&lt;BR /&gt;} OSMSGHDR;&lt;BR /&gt;&lt;BR /&gt;typedef union {  /* send/reveive buffers to orsrvr */&lt;BR /&gt;   char data[DATA_SIZE];&lt;BR /&gt;&lt;BR /&gt;   struct {  /* Error */&lt;BR /&gt;      char statinfo[4];&lt;BR /&gt;      char subsys[4];&lt;BR /&gt;      char textlen[4];&lt;BR /&gt;      char error_text[80];&lt;BR /&gt;      char last[1];&lt;BR /&gt;   } error;&lt;BR /&gt;&lt;BR /&gt;   struct {  /* Login */&lt;BR /&gt;      char airline_code[4];&lt;BR /&gt;      char user_name[8];&lt;BR /&gt;      char term_id[50];&lt;BR /&gt;      char temp_login_flag[1];&lt;BR /&gt;      char new_pass_flag[1];&lt;BR /&gt;      char new_pass[8];&lt;BR /&gt;      char password[8];&lt;BR /&gt;      char server_id[8];&lt;BR /&gt;      char logon_date[8];&lt;BR /&gt;      char logon_time[4];&lt;BR /&gt;      char user_group[8];&lt;BR /&gt;      char group_desc[40];&lt;BR /&gt;      char res_prop[20];&lt;BR /&gt;      char res_max_pax[3];&lt;BR /&gt;      char res1_prop[20];&lt;BR /&gt;      char last[1];&lt;BR /&gt;   } login;&lt;BR /&gt;&lt;BR /&gt;/*others .... removed for example */   &lt;BR /&gt; &lt;BR /&gt;} OSMSGDATA;&lt;BR /&gt;&lt;BR /&gt;typedef struct {&lt;BR /&gt;   OSMSGHDR mh;&lt;BR /&gt;   OSMSGDATA md;&lt;BR /&gt;} OSMSGBUFF;&lt;BR /&gt;&lt;BR /&gt;OSMSGBUFF osbuff;&lt;BR /&gt;OSMSGBUFF osreturn;&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Feb 2002 21:08:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659244#M79686</guid>
      <dc:creator>John Love_3</dc:creator>
      <dc:date>2002-02-15T21:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Core file (segmentation fault) strings help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659245#M79687</link>
      <description>Structures look fine.&lt;BR /&gt;&lt;BR /&gt;It may be an application issue of where the incoming data is transfered to the user defined structures.</description>
      <pubDate>Mon, 18 Feb 2002 14:27:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659245#M79687</guid>
      <dc:creator>Eric Ladner</dc:creator>
      <dc:date>2002-02-18T14:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Core file (segmentation fault) strings help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659246#M79688</link>
      <description>Any other suggestions at all?&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Mon, 18 Feb 2002 17:34:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659246#M79688</guid>
      <dc:creator>John Love_3</dc:creator>
      <dc:date>2002-02-18T17:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Core file (segmentation fault) strings help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659247#M79689</link>
      <description>Well, I compiled with gcc rather than cc and it works better, although there are still some errors, there is no seg. fault or core dump.&lt;BR /&gt;&lt;BR /&gt;Thanks everybody!&lt;BR /&gt;&lt;BR /&gt;John</description>
      <pubDate>Tue, 19 Feb 2002 16:10:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/core-file-segmentation-fault-strings-help/m-p/2659247#M79689</guid>
      <dc:creator>John Love_3</dc:creator>
      <dc:date>2002-02-19T16:10:07Z</dc:date>
    </item>
  </channel>
</rss>

