Subject: Side-effects dlopening libstdc++?
To: None <tech-pkg@netbsd.org, tech-userlevel@netbsd.org>
From: Julio M. Merino Vidal <jmmv@menta.net>
List: tech-pkg
Date: 11/10/2004 22:43:47
Hi all,

beep-media-player crashes when it is closed.  During shutdown, it dlclose(3)s
all plugins that were loaded during initialization, and the first call to this
function causes a segfault.

One of the plugins (mpg123) is linked against id3lib, which in turn uses
libstdc++.  However, if id3lib support is disabled in the mpg123 plugin,
the crash does not happen.

Furthermore, if I compile the whole bmp package with -lstdc++ in LDFLAGS
(and id3lib support enabled), the crash does not happen.  This reminds me
of the -lpthread problem (where you can't dlopen it from a non-threaded
program)... does this make any sense?  I mean, can't libstdc++ be dlopened
without side effects in a non-c++ program?  If not, may this be a bug in
our dynamic loading code?

Thanks.

-- 
Julio M. Merino Vidal <jmmv@menta.net>
The NetBSD Project - http://www.NetBSD.org/