I wanted to follow up on the dynamic linking issue since I have been unable to resolve it and hoped that the linker expert might be able to shed some light on it. I have also found two other projects that are having the exact same problem and have been unable to work around it. I have attached a stack trace of my app hanging in hopes that it might help.
Thanks Galen #0 0x700343e8 in semaphore_wait_trap () #1 0x70009610 in pthread_mutex_lock () #2 0x01cdce78 in std::string::_Rep::_S_create(unsigned long, std::allocator<char> const&) () #3 0x01cddb1c in char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator<char> const&, std::forward_iterator_tag) () #4 0x01cda2a8 in std::string::string(char const*, std::allocator<char> const&) () #5 0x01cbae9c in std::locale::classic() () #6 0x01cba33c in std::locale::locale() () #7 0x01cce294 in std::basic_streambuf<char, std::char_traits<char> >::basic_streambuf() () #8 0x01ccf69c in std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf(__sFILE*, std::_Ios_Openmode, int) () #9 0x01cb3ce0 in std::ios_base::Init::_S_ios_create(bool) () #10 0x01cb417c in std::ios_base::Init::Init() () #11 0x01c69a08 in __static_initialization_and_destruction_0(int, int) (__initialize_p=1, __priority=65535) at /usr/include/gcc/darwin/3.1/g++-v3/bits/locale_facets.h:62 #12 0x01c6f574 in _GLOBAL__I__ZN3vrj10Projection9mNearDistE () at /usr/include/gcc/darwin/3.1/g++-v3/bits/locale_facets.h:102 #13 0x41115374 in __dyld_call_module_initializers_for_library () #14 0x41115144 in __dyld_call_module_initializers () #15 0x41110324 in __dyld_link_in_need_modules () #16 0x4110fec0 in __dyld_bind_lazy_symbol_reference () #17 0x41100fe0 in __dyld_stub_binding_helper_interface () #18 0x01cd94f4 in std::__default_alloc_template<true, 0>::_S_chunk_alloc(unsigned long, int&) () #19 0x01cd9378 in std::__default_alloc_template<true, 0>::_S_refill(unsigned long) () #20 0x01cdce8c in std::string::_Rep::_S_create(unsigned long, std::allocator<char> const&) () #21 0x01cddb1c in char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator<char> const&, std::forward_iterator_tag) () #22 0x01cda2a8 in std::string::string(char const*, std::allocator<char> const&) () #23 0x01cbae9c in std::locale::classic() () #24 0x01cba33c in std::locale::locale() () #25 0x01cce294 in std::basic_streambuf<char, std::char_traits<char> >::basic_streambuf() () #26 0x01ccf69c in std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf(__sFILE*, std::_Ios_Openmode, int) () #27 0x01cb3ce0 in std::ios_base::Init::_S_ios_create(bool) () #28 0x01cb417c in std::ios_base::Init::Init() () #29 0x01c5e194 in __static_initialization_and_destruction_0(int, int) (__initialize_p=1, __priority=65535) at /usr/include/gcc/darwin/3.1/g++-v3/bits/locale_facets.h:62 #30 0x01c664a0 in _GLOBAL__I__ZN3vrj10VJ_VERSIONE () at /usr/include/gcc/darwin/3.1/g++-v3/bits/locale_facets.h:102 #31 0x41115374 in __dyld_call_module_initializers_for_library () #32 0x41115144 in __dyld_call_module_initializers () #33 0x41110324 in __dyld_link_in_need_modules () #34 0x4110fec0 in __dyld_bind_lazy_symbol_reference () #35 0x41100fe0 in __dyld_stub_binding_helper_interface () #36 0x01c2d138 in __static_initialization_and_destruction_0(int, int) (__initialize_p=1, __priority=65535) at /usr/include/gcc/darwin/3.1/g++-v3/bits/locale_facets.h:62 #37 0x01c3b2e4 in _GLOBAL__I__ZN3vrj7Display17updateProjectionsEv () at /usr/include/gcc/darwin/3.1/g++-v3/bits/locale_facets.h:102 #38 0x41115374 in __dyld_call_module_initializers_for_library () #39 0x41115144 in __dyld_call_module_initializers () #40 0x41110324 in __dyld_link_in_need_modules () #41 0x41110010 in __dyld_bind_lazy_symbol_reference () #42 0x41100fe0 in __dyld_stub_binding_helper_interface () #43 0x00557880 in __static_initialization_and_destruction_0(int, int) (__initialize_p=1, __priority=65535) at /usr/include/gcc/darwin/3.1/g++-v3/bits/locale_facets.tcc:54 #44 0x0055cb88 in _GLOBAL__I__ZN3vpr10ThreadNSPR12mThreadTableE () at /usr/include/gcc/darwin/3.1/g++-v3/bits/locale_facets.tcc:74 #45 0x41115374 in __dyld_call_module_initializers_for_library () #46 0x41115144 in __dyld_call_module_initializers () #47 0x41110324 in __dyld_link_in_need_modules () #48 0x41110010 in __dyld_bind_lazy_symbol_reference () #49 0x41100fe0 in __dyld_stub_binding_helper_interface () #50 0x00002a7c in main () #51 0x00002758 in _start () #52 0x00002588 in start () At 10:53 AM -0700 8/16/02, Stuart Hastings wrote: >On Friday, Aug 16, 2002, at 10:23 US/Pacific, Galen Faidley wrote: > >>I hope this is the correct list to send my question to. I couldn't >>find the page dedicated to the list on apples site so I couldn't >>read the description, archives, or even join the list. >> >>I am using the version of gcc3 that came with the April developer tools: >>Apple Computer, Inc. GCC version 1041, based on gcc version 3.1 >>20020105 (experimental) >> >>I am experiencing problems with dynamic linking. The problems >>manifest themselves on runtime. When the first call to a function >>in my library is made the application gets stuck in a >>semaphore_wait_trap () . There is only one thread running so of >>course it will never get out of the trap. I may very well have >>built my library incorrectly >>(is there some documentation on how it should be done?) > >There may be, but offhand I don't know where. > >Try pasting this into your WWW browser: > > file:///Developer/Documentation/DeveloperTools/devtools.html > >This may also be helpful: > > file:///Developer/Documentation/DeveloperTools/libtool/libtool_toc.html > >Both of these docs are standard parts of the imminent Jaguar >release; alas, I don't have a Puma system handy to make sure they're >in the same places. If you don't find them right off, ask Sherlock >(or UNIX 'find') to look for you. > >>but I get no error when building the library or building the app. >>If I link my application statically everything behaves as it should. > >I'm sorry I can't do more for you right now. Our linker expert is >on vacation for another week. > >stuart hastings --
