Re: segmentation fault problem
Posted in 1997
Your email address does not work! ----- The following addresses have delivery notifications ----- KMcgre7681@aol.com.REDIRECT (unrecoverable error) (expanded from: <KMcgregor@gnn.com>) ----- Transcript of session follows ----- 551 /var/spool/mail/%HMAIL%/m/i/l/kmcgregor.forward: line 1: KMcgre7681@aol.com.REDIRECT... User has moved; please try <KMcgre7681@aol.com> 451 KMcgre7681@aol.com... reply: read error from b.mx.aol.com. --- Hi, It is most probably a bug somewhere in I4GL or ESQL/C. The first step is to get as much information as possible from the core dump. Compile the program with the -g option (to get debugging info from your code) and make sure that you don't include -s (strip) when you create the program. Run it again (and again, and again) until you get a core dump. Then examine the core dump using a debugger (eg sdb, though it is hardly the best), getting a stack trace (where, t, T, A, a, perhaps) of where the code is when the fault occurs. Include the -keep option on the C4GL command line, incidentally; you'll need the C code around for debugging. If you don't have the -keep option, get an upgrade. You should be able to track line numbers in the ".ec" file (though watch out for the #line directives which screw the numbers up). Or, you can recompile you code piece by piece, eliminating all #line directives as you go (convert them into comments). This makes it easier to track where the problem is. Given that, you may be able to come to some conclusion about the cause of the trouble. On average, I'd guess there's some memory abuse going on. You could try Purify which will tell you what the trouble is with remarkable accuracy (if you have it), or try to locate a debugging malloc() to get that to tell you what's going wrong. T'ain't easy dealing with this sort of problem, but I4GL shouldn't core dump under any circumstance -- unless you call some of your own C code and it does the core dump, or you call some of your own C code and it corrupts I4GL's data. Your code doesn't seem to ensure that the cursor is closed before leaving the function -- that might have something to do with it. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h> >From: KMcgregor@gnn.com (Keith McGregor) >Date: Fri, 04 Apr 1997 11:44:44 >X-Informix-List-Id: <news.36197> > >I hope someone can help me. I have been experiencing an >exasperating problem while running a production 4gl program on our >NCR 3450. The program craps out with a msg saying 'segmentation >fault.' I have no idea where to begin looking for a solution to >this intermittent problem. Below is the section of code that I >have been able to narrow down as the problem area. Machine >specifics are: NCR 3450, dual 486 33 mhz processors with 512MB RAM > >open sel_cur > fetch sel_cur into l_flg, l_count > if status = notfound then > LET xmesg = " Customer Chain/Store Not Found " > return -1 , lr_custf1.custno_mstr,lr_custf1.cusnam > end if > while (status = 0) > if l_count > 1 then > LET xmesg = " " > LET xmesg = " Cust Chain/Store Not Unique " > return -1 , lr_custf1.custno_mstr,lr_custf1.cusnam > end if > if l_flg = "R" then > exit while > end if > fetch sel_cur into l_flg, l_count > end while > >Any thoughts or comments would be greatly appreciated. If you >need any other info I can provide that too. > >thanx, Keith McGregor