EDM on OS X gets access fault in ipAddrToAsciiEngine::allocate

Bug #541309 reported by Eric Norum
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Fix Released
High
Jeff Hill

Bug Description

Compile and build latest edm/base on OS X/Intel
Trying to run EDM gets access fault in ipAddrToAsciiEngine::allocate

Here's the stack trace:
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__ZN16ImageLoaderMachO16doInitializationERKN11ImageLoader11LinkContextE ()
#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 guard class mutex is being used before it has been created.

Additional information:
A quick workaround was to add libCom before the EDM libraries in the EDM makefile:
@@ -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

This is a quick hack and not a real fix, though!
I'll leave a *real* fix up to the C++ experts.

Original Mantis Bug: mantis-276
    http://www.aps.anl.gov/epics/mantis/view_bug_page.php?f_id=276

Tags: libcom 3.14
Revision history for this message
Jeff Hill (johill-lanl) wrote :

I wonder if this is an issue only with a static build or if it occurs also when using shareable libraries?

Revision history for this message
Jeff Hill (johill-lanl) wrote :

committed a fix

Revision history for this message
Jeff Hill (johill-lanl) wrote :

fixed in R3.14.9

Revision history for this message
Andrew Johnson (anj) wrote :

R3.14.9 Released.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.