Bug 28989 - libdb2.so causes SIGSEGV after dlopen/dlclose; it calls atexit rather than __cxa_atexit
Summary: libdb2.so causes SIGSEGV after dlopen/dlclose; it calls atexit rather than __...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: db2
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-02-23 08:56 UTC by Bryan White
Modified: 2007-04-18 16:31 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-02-27 23:52:05 UTC
Embargoed:


Attachments (Terms of Use)

Description Bryan White 2001-02-23 08:56:18 UTC
When libdb2 is used from a dlopen-ed module, it registers a function (say, 
foo_DB2_atexit) via atexit. Then the module is dlclose-d. Then, when main
() returns and activates the atexit-registered functions, it tries to call
foo_DB2_atexit, which has been unloaded, causing a SIGSEGV Segmentation 
fault. 

Personally, I believe that this is a problem between dlopen/close and 
atexit, but I'm being stonewalled on this, and told that libdb2 should use 
__cxa_atexit or __cxa_finalize (see
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=28625
)

I have tried various tricks like using --wrap atexit (works for "normal" 
loading of modules, but not dlopen-ed stuff) and tried converting 
ibmdb2.so to ibmdb2_new.a with --wrap atexit, and then creating 
ibmdb2_new.so without an unresolved reference to atexit (got horribly 
bogged done - I'm too new with gnu to work it all out). 

Some installation info:
[09:49:20 bwhi@ws2 bwhi]$rpm -qa | grep db2
db2cucs71-7.1.0-0
db2engn71-7.1.0-0
db2conn71-7.1.0-0
db2cnvj71-7.1.0-0
db2cdb71-7.1.0-0
db2adt71-7.1.0-0
db2-2.4.14-4
db2cliv71-7.1.0-0
db2jdbc71-7.1.0-0
db2rte71-7.1.0-0
db2crte71-7.1.0-0
db2das71-7.1.0-0
db2repl71-7.1.0-0
db2smpl71-7.1.0-0
db2cnvk71-7.1.0-0
db2cnvt71-7.1.0-0
db2dj71-7.1.0-0
db2clic71-7.1.0-0
db2adts71-7.1.0-0
db2cj71-7.1.0-0
db2cdrd71-7.1.0-0
db2wcc71-7.1.0-0
db2cnvc71-7.1.0-0
db2elic71-7.1.0-0
[09:49:24 bwhi@ws2 bwhi]$uname -a
Linux ws2.rsctech.net 2.2.16-22smp #1 SMP Tue Aug 22 16:39:21 EDT 2000 
i686 unknown

Comment 1 Nalin Dahyabhai 2001-02-26 23:15:16 UTC
Is this IBM DB2 or Berkeley db2?  I don't think these came from the db2 source
package in the distribution....

Comment 2 Bryan White 2001-02-27 09:20:32 UTC
My problem is definitely with /usr/IBMdb2/V7.1/lib/libdb2.so, and pointed to 
by /usr/lib/libdb2.so.bk - is this the right forum? 
if (bRightForum==false) AskSupplementaryQuestion("Where do I post this issue?");
I'm having a lot of problems cutting through the bogon flux with this one. Not 
you, may I hasten to add; I much prefer people who ask questions than those who 
try to drown me in bogosity. 
If you could help me by pointing me in the right direction, I would appreciate 
it; I'm rather new with this low-level GNU stuff. 
Thank you.


Comment 3 Nalin Dahyabhai 2001-02-27 23:52:01 UTC
Given the directory this file is in, this looks like it's IBM's DB2 Universal
Database, and not the Berkeley DB library, version 2.  We don't have the source
for that, so I think you'd have to go to IBM.  I checked their web site and
http://www-4.ibm.com/software/data/db2/linux/ appears to be the homepage, with
contact information available via the "support" link on the left.

Comment 4 Bryan White 2001-02-28 07:54:36 UTC
Thank you for pointing me in the right direction. I'll change this 
to "NOTABUG" - I guess that's the right way to close it.


Note You need to log in before you can comment on or make changes to this bug.