Link to home
Start Free TrialLog in
Avatar of hs00gte
hs00gte

asked on

AIX 4.3 program returning immediately (exit code 99). Works on other AIX4.3 machine

My program works perfectly on my development machine and on the regular test machine. When ran on the two new test machines it exits immediately with exit code 99.

This code exists at the beginning of main():

cout << "hey!" << endl;

I understand the endl will flush the output buffer, so this means to me the instruction is not being reached. Also, it exists way to fast for the average load time of this process.

This is the output of a debugging session with dbx:

Type 'help' for help.
reading symbolic information ...
(dbx) run

execution completed (exit code 99)
(dbx) where
glink._exit() at 0xd018f500
exit(??) at 0xd0188248
__C_runtime_startup() at 0x10000638

These are the outputs of ulimit for the account used to run the process:

ulimit -a:
time(seconds)        unlimited
file(blocks)         2097151
data(kbytes)         unlimited
stack(kbytes)        unlimited
memory(kbytes)       unlimited
coredump(blocks)     2097151
nofiles(descriptors) 2000

ulimit -a -H:
time(seconds)        unlimited
file(blocks)         2097151
data(kbytes)         unlimited
stack(kbytes)        unlimited
memory(kbytes)       unlimited
coredump(blocks)     unlimited
nofiles(descriptors) unlimited

Avatar of gheist
gheist
Flag of Belgium image

some revisions of gnu utilities make broken executables
Avatar of hs00gte
hs00gte

ASKER

I use xlC to compile this program. Remember it works perfectly on another IBM machine running the same AIX4.3. (although different support levels).
Is that the whole program or what else is the program doing?
CC gheist. You should perhaps look long and hard at what happens in your constructors, since globaly instantiated objects will run that code prior to main.
Also look at what libs are dynamically linked with ldd... you might have a broken lib.

-- Glenn
Avatar of hs00gte

ASKER

We found a way around this problem, but I still don't understand what's going on. If we remove the static linking of one particular library and link the EXACT OBJECT FILE we need (which is included in the library) then everything works fine in both machines.

All the previous existing global object instantiations are still there in the code.
Ok, that'd imply a "broken" lib then. Are the machines the exact same ML?

-- Glenn
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
every manual page dealing with linking binaries warns that static linking breaks program