From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,915496c75a4ca0d7,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-07-20 08:32:42 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!agate!msuinfo!pacific!scottge1 From: scottge1@cps.msu.edu (George M. Scott) Newsgroups: comp.unix.osf.osf1 Subject: Problems with Shared Libraries Date: 20 Jul 1994 15:16:37 GMT Organization: Department of Computer Science, Michigan State University Distribution: world Message-ID: <30jf4l$g7g@msuinfo.cl.msu.edu> NNTP-Posting-Host: pacific.cps.msu.edu Originator: scottge1@pacific I have noticed the following problem when using shared libraries on OSF/1 2.0. I have a program which loads shared libraries dynamically using dlopen/dlsym. This program is compiled with only the C library. Now if I create shared libraries that use libc.so, libm.so, or even libcxx.so everything is fine when loaded with dlopen. However if the library has dependencies of the form -lpthreads -lmach -lcxx -lc_r -lc, and the library contains global c++ constructors which make pthreads calls then the library cannot be properly loaded and initialized. The library itself is loaded ok it seems, but when the c++ constructors are called they attempt to call the pthreads routines and they never return. They just chew up lots of cpu spinning around in various cma routines like cma__alloc_mem. This problem goes away if the program which calls dlopen is linked with -lpthreads -lmach -lcxx -lc_r, but this seems ridiculous and unecessary. I believe the problem may be caused by empty dependency lists in libtphreads.so and libmach.so. odump -D shows they have no dependencies which cannot be correct. Does anyone know the true cause of this problem? Is DEC going to fix it? George Scott Johns Hopkins University / Applied Physics Laboratory gscott@aurora.jhuapl.edu -- George Scott Michigan State University scottge1@cps.msu.edu