[unixODBC-dev] Right way to read odbc.ini file.

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Mon Sep 13 09:17:33 BST 2004

> Martin J. Evans wrote:
> > 
> > I could be wrong and Nick might remember but I think 
> DontDLClose attribute was
> > invented because of some drivers use of atexit or _fini - Nick?
> >  
> > <snipped test code>
> Yes, this test code demonstrated perfectly the reason dontdlclose was 
> added. Drivers registered atexit functions, and the atexit list was 
> maintained in the process. then after the driver manager had done a 
> dlclose (releasing the driver code from the processes memory), the 
> atexit function was being called on process termination, 
> resulting in a 
> seg fault due to attempting to execute code outside the programs code 
> sections.
> It may be if you have a version that doesn't do this, that 
> someone has 
> decided to fix this problem in the libc, making atexit know about 
> dynamic loading. But its certainly not portable.
> I dislike the global that the ini cacheing requires, but I 
> can't see a 
> simple way out. The ini cacheing can be disabled at build time though.

Just to continue my tests...
I tried with gcc and __attribute__((destructor)) on HP-UX 11.00 and it
works as expected. I also found this document on HP site:


More information about the unixODBC-dev mailing list