[Bug 490744] Re: cerr crash in dlopen'ed c++ shared object, if linked to some libs
After trying this with gcc 4.4, 4.5, 4.6, I am no longer able to reproduce this bug, hence marking as Fix Released. ** Changed in: gcc-4.4 (Ubuntu) Status: New = Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/490744 Title: cerr crash in dlopen'ed c++ shared object, if linked to some libs To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gcc-4.4/+bug/490744/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 490744] Re: cerr crash in dlopen'ed c++ shared object, if linked to some libs
I thing LD_PRELOAD=/usr/lib/libgomp.so.1 may help. Me and my colleagues feel that it is somehow connected to thread pool management. It looks like If we preload libgomp then thread pool management works on the level of main module, otherwise it works on the dll level. Thus dlclose works before gomp finalize its pool of threads. If we put sleep before dlclose - it works fine. Actually it is only ideas without any basement... -- cerr crash in dlopen'ed c++ shared object, if linked to some libs https://bugs.launchpad.net/bugs/490744 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 490744] Re: cerr crash in dlopen'ed c++ shared object, if linked to some libs
this is a reasonable error due to the fact you haven't provided in the C++ shared object the necessary symbol Demangling. As well as your maybe calling the dlopen'd function incorrectly since dlsym returns a function pointer which you call as instead of a real function. http://www.dwheeler.com/program-library/Program-Library-HOWTO/dl- libraries.html http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/proguide/ref/rkcxxflt.htm http://developers.sun.com/solaris/articles/mixing.html ** Changed in: gcc-4.4 (Ubuntu) Status: New = Invalid ** Changed in: gcc-4.4 (Ubuntu) Status: Invalid = New -- cerr crash in dlopen'ed c++ shared object, if linked to some libs https://bugs.launchpad.net/bugs/490744 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 490744] Re: cerr crash in dlopen'ed c++ shared object, if linked to some libs
Sorry, but I think your comment is irrelevant: the function is linked with extern C, hence name demangling is not necessary. Besides, the function is called properly, which is manifested by the fact that it does what it should if libfoo.so is not linked with a c++ lib. I additionaly discovered that if I do dlopen(/usr/lib/libstdc++.so.6,RTLD_LAZY); prior to dlopening the other library, no error occurs (and it does without that, as originally reported): == main.c == #includedlfcn.h int main(void){ dlopen(/usr/lib/libstdc++.so.6,RTLD_LAZY); void* handle=dlopen(./libfoo.so,RTLD_NOW); void(*foo)()=(void(*)())dlsym(handle,foo); foo(); return 0; } I think there is an issue with c++ initialization code not being run properly, unless the stdc++ is opened directly (rather than by ld.so at runtime), but I don't know details. -- cerr crash in dlopen'ed c++ shared object, if linked to some libs https://bugs.launchpad.net/bugs/490744 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 490744] Re: cerr crash in dlopen'ed c++ shared object, if linked to some libs
I forgot to mention that running LD_PRELOAD=/usr/lib/libstdc++.so.6 ./main makes that work as well. -- cerr crash in dlopen'ed c++ shared object, if linked to some libs https://bugs.launchpad.net/bugs/490744 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 490744] Re: cerr crash in dlopen'ed c++ shared object, if linked to some libs
** Attachment added: foo.cc http://launchpadlibrarian.net/36290226/foo.cc -- cerr crash in dlopen'ed c++ shared object, if linked to some libs https://bugs.launchpad.net/bugs/490744 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 490744] Re: cerr crash in dlopen'ed c++ shared object, if linked to some libs
** Attachment added: main.c http://launchpadlibrarian.net/36290202/main.c ** Attachment added: Dependencies.txt http://launchpadlibrarian.net/36290203/Dependencies.txt -- cerr crash in dlopen'ed c++ shared object, if linked to some libs https://bugs.launchpad.net/bugs/490744 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs