RE: memory fault, core dump
Posted in 2000
Dee Wampler Technical Leader > -----Original Message----- > From: David Williams [SMTP:djw@smooth1.demon.co.uk] > Sent: Saturday, May 13, 2000 8:03 AM > To: informix-list@iiug.org > Subject: Re: memory fault, core dump > > In article <8fhch5$sfo$1@news.xmission.com>, Wampler, Dee > <wampled@hastings-ent.com> writes > > > >We have had problems with the 730 tools getting a memory fault core dump > >problem in various programs > > > >Example: > >main > >call dis_call() > >end main > >function dis_call() > >display "craptest" > >sleep 5 > >end function > > Which platform are you running on ? [Wampler, Dee] SCO > Which C compiler and what is your PATH set to? [Wampler, Dee] /u/informix731UC5X1/bin:/u/informix731UC5X1/local/bin:/u/informix731UC5X1/lo cal/ztools: /u/informix731UC5X1/local/ztools/bin [Wampler, Dee] SCO UNIX Development System Release 5.1.1A 27Jul98 > >This gets a memory fault core dump > > > >main > >display "craptest" > >sleep 5 > >end main > > > >this works fine > > > >Any suggestions? > > > >Dee Wampler > >Technical Leader > > > >> -----Original Message----- > >> From: Art S. Kagel [SMTP:kagel@bloomberg.net] > >> Sent: Friday, May 12, 2000 9:57 AM > >> To: informix-list@iiug.org > >> Subject: Re: memory fault, core dump > >> > >> "Wampler, Dee" wrote: > >> > >> > We have upgraded to INFORMIX-4GL Version 7.30.UC1X2 > >> > > >> > We added in one global variable (smallint) to an existing program, > >> compiled > >> > using -shared, and it ran fine > >> > Then we set the variable = 0 and got the following error > >> > dynamic linker: program name: invalid relocation type 72 at 0X0 > >> > killed > >> > > >> > If any other code is added, we get a memory fault core dump > >> > > >> > If we recompile with all the code, using -static, the problem goes > away > >> and > >> > the program runs fine > >> > > >> > Any ideas? > >> > > >> > >> A guess. You added the one variable, uninitialized, to the GLOBALS > file > >> and > >> only recompiled the one module that used the new variable, right? And > >> that > >> worked until you initialized the variable, still only recompiling only > the > >> one > >> module, correct? After that the program crashes until you recompiled > >> every > >> module? Makes perfect sense to me! Uninitialized variables are > created > >> at > >> runtime and are appended to the address space of the program. However, > >> initialized variables are created at compile time and the initialized > data > >> space is > >> lower in memory. Adding a variable that is initialized will cause the > >> addresses > >> of other variables, and perhaps offsets calculated from one to another, > to > >> shift. > >> This means that the other modules code became invalid. I strongly > suggest > >> you > >> start using make to manage your 4GL compiles and include dependencies > on > >> the > >> GLOBALS file for every module's object file. Then you will not have to > >> deal > >> with the confusion again. This is what make is for. > >> > >> Art S. Kagel > >> > > -- > David Williams