Well, if you’re calling _exit() you’re hardly exitting “normally”
_exit() bypasses a lot of the cleanup that exit() does, which explains why
the crash doesn’t happen if you exit in this manner. That’s a heavy-handed
(or, in this case I suppose an overly light-handed) way to solve the
problem, so instead let’s try and figure out what’s causing the crash.
What are you doing in the destructors for your static classes?
“Adam Mallory” <firstname.lastname@example.org> wrote in message
“Kevin Brown” <> email@example.com> > wrote in
news:a4bi7j$h08$> firstname.lastname@example.org> :
I have a static class library that I link with. Whenever I link with
this library there is a
segmentation fault in a function called after returning from main()
If I catch the signal and call the function _exit() the process exits
normally. Can anyone
explain this behavior?
_fini is a function a shared library has, which will get called just
it’s being unmapped. Typically, you’d see code that does a dlopen() on a
shared lib, and then a dlclose() would elicit the _fini call (only when
reference count reached zero. ie. if you dlopen() the same lib 3 times,
you’d have to dlclose() it 3 times before _fini would be called).
QNX Software Systems Ltd.
[ > email@example.com > ]
With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <> firstname.lastname@example.org