Experimental Physics and
| |||||||||||||||||
|
Hello all, Sounds suspiciously like the problem I encountered on OS X. Here's a copy of the letter I sent to Jeff about this. Perhaps you're seeing the same sort of condition, but with some other pair of static constructors. ======================================================================== ============== I downloaded and built the latest version of edm with the current R3.14.2 CVS branch of EPICS. Things build fine, but the executable suffers an access fault when run. I tracked the problem down to a race condition in the C++ static constructors. Code in EPICS_PV_Factory is invoking a guard class mutex that has yet to be set up. Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x00000008 0x0008ae23 in epicsMutex::lock () (gdb) where #0 0x0008ae23 in epicsMutex::lock () #1 0x00088e3a in ipAddrToAsciiEngine::allocate () #2 0x004aff0b in cac::cac () #3 0x004cfb5b in ca_client_context::ca_client_context () #4 0x004b25f4 in ca_context_create () #5 0x0041f4df in EPICS_PV_Factory::EPICS_PV_Factory () #6 0x0044cb2b in __static_initialization_and_destruction_0 () #7 0x8fe0fcb2 in __dyld__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkCon textE () #8 0x8fe0a1c6 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextE () #9 0x8fe0a164 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextE () #10 0x8fe0a164 in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextE () #11 0x8fe0c646 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE () #12 0x8fe03070 in __dyld__ZN4dyld24initializeMainExecutableEv () #13 0x0000245a in _start () #14 0x000023c5 in start () The offending code in misc/ipAddrToAsciiAsynchronous.cpp is: // for now its probably sufficent to allocate one // DNS transaction thread for all codes sharing // the same process that need DNS services but we // leave our options open for the future ipAddrToAsciiEngine & ipAddrToAsciiEngine::allocate () { epicsGuard < epicsMutex > guard ( ipAddrToAsciiEnginePrivate::globalMutex ); if ( ! ipAddrToAsciiEnginePrivate::pEngine ) { ipAddrToAsciiEnginePrivate::pEngine = new ipAddrToAsciiEnginePrivate (); } ipAddrToAsciiEnginePrivate::numberOfReferences++; return * ipAddrToAsciiEnginePrivate::pEngine; } As a quick fix I just link libCom before the EDM libraries as well as after: diff -ur /home/phoebus/NORUME/Desktop/edm/edmMain/Makefile /home/ phoebus/NORUME/ src/EPICS/extensions/src/edm/edmMain/Makefile --- /home/phoebus/NORUME/Desktop/edm/edmMain/Makefile 2006-03-06 13:25:32.0000 00000 -0600 +++ /home/phoebus/NORUME/src/EPICS/extensions/src/edm/edmMain/ Makefile 2006-11- 14 13:12:30.000000000 -0600 @@ -10,7 +10,7 @@ edm_LIBS_Linux += 114135a4-6f6c-11d3-95bc-00104b8742df edm_SYS_LIBS_Linux += Xm Xmu Xt Xp Xtst X11 pthread dl - edm_LIBS_Darwin += EdmBase cfcaa62e-8199-11d3-a77f-00104b8742df + edm_LIBS_Darwin += Com EdmBase cfcaa62e-8199-11d3-a77f-00104b8742df edm_LIBS_Darwin += 114135a4-6f6c-11d3-95bc-00104b8742df edm_SYS_LIBS_Darwin += Xm Xmu Xt Xp Xtst X11 pthread dl I've sent mail to Jeff to see if he has a better fix, but for now I can at least work with EDM. -- Eric Norum <[email protected]> Advanced Photon Source Argonne National Laboratory (630) 252-4793
| ||||||||||||||||
ANJ, 02 Sep 2010 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |