issue: "__gnu_cxx::__exchange_and_add" (was Re: issue: "dyld: Symbol not found: _CGLGetCurrentContext")

Michael Dickens michaelld at macports.org
Thu Aug 19 06:57:31 PDT 2010


OK; the DYLD stuff was a red herring, or something like that -- my bad
there; usually that technique works well.  I'm having "more" success in
a difference debug direction: I edited libtool's 'octave' script
(octave-3.3.53/src/octave) to exec gdb on octave, and that worked.  Now
when I run octave inside gdb, I get back:

{{{
[snip]
(gdb) r
[snip]
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x035cc9e6 in __gnu_cxx::__exchange_and_add ()
(gdb) bt
#0  0x035cc9e6 in __gnu_cxx::__exchange_and_add ()
#1  0x03570482 in std::locale::operator= ()
#2  0x0356ed3e in std::ios_base::_M_init ()
#3  0x035847da in std::basic_ios<char, std::char_traits<char> >::init ()
#4  0x0118bd93 in global constructors keyed to pager.cc ()
#5  0x8fe12f36 in
__dyld__ZN16ImageLoaderMachO18doModInitFunctionsERKN11ImageLoader11LinkContextE
()
#6  0x8fe0e7e3 in
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#7  0x8fe0e775 in
__dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj ()
#8  0x8fe0e8c9 in
__dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE ()
#9  0x8fe04102 in __dyld__ZN4dyld24initializeMainExecutableEv ()
#10 0x8fe07bcf in __dyld__ZN4dyld5_mainEPK11mach_headermiPPKcS5_S5_ ()
#11 0x8fe01872 in __dyld__ZN13dyldbootstrap5startEPK11mach_headeriPPKcl
()
#12 0x8fe01037 in __dyld__dyld_start ()
}}}

An internet search of "__gnu_cxx::__exchange_and_add" turns up a bunch
of interesting list posts, but no solutions.  Stack frame #4 holds the
last section of code I can see (w/o significant effort)

octave-3.3.53/src/pager.cc:49-59 :
{{{
// Our actual connection to the external pager.
static oprocstream *external_pager = 0;

// TRUE means we write to the diary file.
static bool write_to_diary_file = false;

// The name of the current diary file.
static std::string diary_file;

// The diary file.
static std::ofstream external_diary_file;
}}}

So, the issue is most likely the "std::ofstream" below since #3 is in
I/O stream.  Any ideas what to do to get around the issue?  Explicitly
set the "external_diary_file" to some default value & hope for the best?
- MLD


More information about the macports-dev mailing list