Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash under OS X 10.9 when using the 10.9 Xcode build environment of Mavericks #15589

Closed
wxtrac opened this issue Oct 17, 2013 · 65 comments
Closed
Labels
macOS Specific to Cocoa macOS port v3.0.0

Comments

@wxtrac
Copy link
Collaborator

wxtrac commented Oct 17, 2013

Issue migrated from trac ticket # 15589

component: wxOSX | priority: normal | resolution: fixed

2013-10-17 11:07:04: rocrail (Rob Versluis) created the issue


I can run the minimal example on Mac OS X 10.9 Mavericks.
But after compiling my own application, which runs OK on Mac OS X 10.8 Mountain Lion, it crashes.
How can I fix this problem in my application?

  • thread Fix NoneType Build Errors Crashs On Linux #1: tid # 0x18d54, 0x00007fff889c108a libstdc++.6.dylibstd::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_M_grab(std::allocator<wchar_t> const&, std::allocator<wchar_t> const&) + 4, queue'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x76fffffffc) frame #0: 0x00007fff889c108a libstdc++.6.dylibstd::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_M_grab(std::allocator<wchar_t> const&, std::allocator<wchar_t> const&) + 4
    frame Fix NoneType Build Errors Crashs On Linux #1: 0x00007fff889c1656 libstdc++.6.dylibstd::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) + 32 frame #2: 0x0000000100b47f24 libwx_osx_cocoau-3.0.dylibwxLog::IsLevelEnabled(unsigned long, wxString) + 84
    frame DVC Multiple sort column #3: 0x0000000100bf6afd libwx_osx_cocoau-3.0.dylibwxCSConv::DoCreate() const + 61 frame #4: 0x0000000100bf8dea libwx_osx_cocoau-3.0.dylibwxGet_wxConvLocalPtr() + 106
    frame Update pt.po #5: 0x0000000100bfa9f3 libwx_osx_cocoau-3.0.dylib_GLOBAL__I_a + 419 frame #6: 0x00007fff5fc11c2e dyldImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 268
    frame Merge pull request #1 from wxWidgets/master #7: 0x00007fff5fc11dba dyldImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40 frame #8: 0x00007fff5fc0ea62 dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 308
    frame Fix spelling of occur* in random files. #9: 0x00007fff5fc0e9eb dyldImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 189 frame #10: 0x00007fff5fc0e8f6 dyldImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 54
    frame Silenced gcc warnings for tests #11: 0x00007fff5fc021da dylddyld::initializeMainExecutable() + 189 frame #12: 0x00007fff5fc05560 dylddyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 2419
    frame Merge wxTaskBarButton into Core #13: 0x00007fff5fc0127b dylddyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 477 frame #14: 0x00007fff5fc0105e dyld_dyld_start + 54
@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 18, 2013

2013-10-18 00:30:54: @vadz changed status from new to closed

2013-10-18 00:30:54: @vadz set resolution to fixed

2013-10-18 00:30:54: @vadz commented

I think this was fixed by 74935, please apply this change locally and reopen if it doesn't help. In this case reproducing the problem in a sample would be very, very welcome too.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 20, 2013

2013-10-20 11:27:38: rocrail (Rob Versluis) changed status from closed to reopened

2013-10-20 11:27:38: rocrail (Rob Versluis) changed resolution from fixed to **

2013-10-20 11:27:38: rocrail (Rob Versluis) commented

It did not solve the issue:

* thread #1: tid # 0x1df3a, 0x00007fff8ee0b08a libstdc++.6.dylib`std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_M_grab(std::allocator<wchar_t> const&, std::allocator<wchar_t> const&) + 4, queue'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x76fffffffc)
    frame #0: 0x00007fff8ee0b08a libstdc++.6.dylib`std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Rep::_M_grab(std::allocator<wchar_t> const&, std::allocator<wchar_t> const&) + 4
    frame #1: 0x00007fff8ee0b656 libstdc++.6.dylib`std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::basic_string(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&) + 32
    frame #2: 0x0000000100b4ae94 libwx_osx_cocoau-3.0.dylib`wxLog::IsLevelEnabled(unsigned long, wxString) + 84
    frame #3: 0x0000000100bf9a6d libwx_osx_cocoau-3.0.dylib`wxCSConv::DoCreate() const + 61
    frame #4: 0x0000000100bfbd5a libwx_osx_cocoau-3.0.dylib`wxGet_wxConvLocalPtr() + 106
    frame #5: 0x0000000100bfd963 libwx_osx_cocoau-3.0.dylib`_GLOBAL__I_a + 419
    frame #6: 0x00007fff5fc11c2e dyld`ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 268
    frame #7: 0x00007fff5fc11dba dyld`ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
    frame #8: 0x00007fff5fc0ea62 dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 308
    frame #9: 0x00007fff5fc0e9eb dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 189
    frame #10: 0x00007fff5fc0e8f6 dyld`ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 54
    frame #11: 0x00007fff5fc021da dyld`dyld::initializeMainExecutable() + 189
    frame #12: 0x00007fff5fc05560 dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 2419
    frame #13: 0x00007fff5fc0127b dyld`dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 477
    frame #14: 0x00007fff5fc0105e dyld`_dyld_start + 54

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 20, 2013

2013-10-20 11:57:39: rocrail (Rob Versluis) commented


The onInit is in this file:
http://bazaar.launchpad.net/~rocrail-project/rocrail/Rocrail/view/head:/rocview/impl/guiapp.cpp

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 20, 2013

2013-10-20 13:01:40: @vadz commented


Hmm, then I don't know what's going on here.

It would help to have the debugging symbols for wx libraries (where exactly does it crash in wxLog::IsLevelEnabled() is not clear at all) and/or to be able to reproduce this.

Without more information I'm afraid there is not much we can do.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 20, 2013

2013-10-20 14:16:04: rocrail (Rob Versluis) commented


I suggest to let it rest until Mavericks is GA and test again because the same wx revision does not crash under OS X 10.8.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 20, 2013

2013-10-20 17:08:46: @csomor changed status from reopened to infoneeded_new

2013-10-20 17:08:46: @csomor commented

we need a reproducible case here, adding a static variable to minimal sample like this

wxString test("test",*wxConvUI);

is executed normally, i.e. the stack trace looks similar - but no crash on my mac mini i7 QC running GM of 10.9

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 25, 2013

2013-10-25 06:44:25: rocrail (Rob Versluis) commented


It only crashes if it is build under 10.9. A build from 10.8 runs normal.

2013-10-25 06:44:25: rocrail (Rob Versluis) changed status from infoneeded_new to new

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 25, 2013

2013-10-25 06:51:42: rocrail (Rob Versluis) commented


The configure command I use for building the wxWidgets library is:

../configure --enable-unicode --with-osx_cocoa --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk --with-macosx-version-min=10.6 --enable-graphics_ctx --enable-monolithic

It is the same I use for OS X 10.8.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 25, 2013

2013-10-25 16:52:07: rocrail (Rob Versluis) changed priority from normal to blocker

2013-10-25 16:52:07: rocrail (Rob Versluis) commented

Status Quo:

  1. Fresh install on a empty disk partition of Mavericks.
  2. Installed the command line tools and xcode.
  3. Builded wxWidgets from the GIT trunk.
  4. Builded Rocrail.

The crash is still there.
When I install Rocrail from a disk image builded under Mountain Lion with the same options it runs on Mavericks without crash.

The backtrace does not even mention Rocrail classes… It happens just at startup before OnInit() is called.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 25, 2013

2013-10-25 17:16:25: @vadz changed status from new to infoneeded_new

2013-10-25 17:16:25: @vadz commented

We really need a way to reproduce this. It's impossible for us to debug the problems in all applications using wxWidgets (of which there are hundreds of thousands). Please try to [HowToSubmitPatches make a patch] to the minimal sample showing the problem.

TIA!

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 25, 2013

2013-10-25 17:46:19: rocrail (Rob Versluis) commented


OK, I will invest time to patch it into the minimal sample.
As you can see in the backtrace the crash is in main() which is not part of the Rocview code but in wx.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 25, 2013

2013-10-25 17:48:32: @vadz changed status from infoneeded_new to new

2013-10-25 17:48:32: @vadz commented

Yes, but if it doesn't happen in the minimal sample, it still must be due to something your application does -- and we don't know what. It's almost certainly relates to something being done in a global object ctor, but, again, I have no idea what exactly is it, only you can tell us.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 25, 2013

2013-10-25 17:48:50: @vadz changed status from new to infoneeded_new

2013-10-25 17:48:50: @vadz commented

Oops, sorry for accidentally resetting the status.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 25, 2013

2013-10-25 17:59:51: rocrail (Rob Versluis) commented


I just provide an open source program in free time.
Its always a PITA if some supported Platform does crash a program after a small upgrade; As OS X user I only see the vanishing of the command line tools. GDB is replaced with lldb, but I do not know why and what the consequences are.
I like the MacBooks and OS X but it should be maintained compatible to previous versions.
I will not upgrade my developer PC until this issue is cleared, and in the mean time I will stick to Mountain Lion.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 25, 2013

2013-10-25 22:03:39: @csomor changed priority from blocker to normal

2013-10-25 22:03:39: @csomor commented

I've rebuilt minimal sample with wx configured according your version under 10.9 (with my added static string as described above to trigger the wxGet_wxConvLocalPtr) and it didn't crash, but having conversions going on during static initialization is definitely not a too stable, this also triggers logging and apparently there strings don't seem to be ready in IsLevelEnabled ...

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 26, 2013

2013-10-26 09:53:03: rocrail (Rob Versluis) changed status from infoneeded_new to new

2013-10-26 09:53:03: rocrail (Rob Versluis) commented

I builded wxWidgets with debug enabled:

Process 67192 launched: '/Users/rob/lp/Rocrail/unxbin/rocview' (x86_64)
Process 67192 stopped
* thread #1: tid # 0x1e24d, 0x0000000100bc98e5 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde58) + 37 at hash.cpp:316, queue'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x21)
    frame #0: 0x0000000100bc98e5 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde58) + 37 at hash.cpp:316
   313 	    long int_key = 0;
   314 	
   315 	    const wxStringCharType *p = str.wx_str();
-> 316 	    while( *p )
   317 	        int_key += *p++;
   318 	
   319 	    return int_key;

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 26, 2013

2013-10-26 11:19:30: rocrail (Rob Versluis) commented


The backtrace:

* thread #1: tid # 0x1e24d, 0x0000000100bc98e5 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde58) + 37 at hash.cpp:316, queue'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x21)
    frame #0: 0x0000000100bc98e5 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde58) + 37 at hash.cpp:316
    frame #1: 0x000000010052662c rocview`wxHashTable::Get(this=0x0000000102b00010, value=0x00007fff5fbfde58) const + 44 at hash.h:213
    frame #2: 0x0000000100beacc9 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0898) + 393 at object.cpp:245
    frame #3: 0x000000010003d824 rocview`wxClassInfo::wxClassInfo(this=0x0000000101bc0898, className=0x000000010175a050, baseInfo1=0x0000000101bc35c0, baseInfo2=0x0000000000000000, size=80, ctor=0x0000000100b30b10)()) + 100 at rtti.h:59
    frame #4: 0x000000010003b8cd rocview`wxClassInfo::wxClassInfo(this=0x0000000101bc0898, className=0x000000010175a050, baseInfo1=0x0000000101bc35c0, baseInfo2=0x0000000000000000, size=80, ctor=0x0000000100b30b10)()) + 61 at rtti.h:60
    frame #5: 0x0000000100b37ae9 libwx_osx_cocoau-3.0.dylib`__cxx_global_var_init2 + 57 at any.cpp:230
    frame #6: 0x0000000100b38103 libwx_osx_cocoau-3.0.dylib`_GLOBAL__I_a + 19 at any.cpp:291
    frame #7: 0x00007fff5fc11c2e dyld`ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 268
    frame #8: 0x00007fff5fc11dba dyld`ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
    frame #9: 0x00007fff5fc0ea62 dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 308
    frame #10: 0x00007fff5fc0e9eb dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 189
    frame #11: 0x00007fff5fc0e8f6 dyld`ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 54
    frame #12: 0x00007fff5fc021da dyld`dyld::initializeMainExecutable() + 189
    frame #13: 0x00007fff5fc05560 dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 2419
    frame #14: 0x00007fff5fc0127b dyld`dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 477
    frame #15: 0x00007fff5fc0105e dyld`_dyld_start + 54

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 26, 2013

2013-10-26 12:38:56: ericj commented


I don't work under OSX, so i'm not sure if i interpret the backtrace correctly.

Set a breakpoint in wxApp::OnInit(). If the crash happens before the breakpoint is reached, it means that this code is executed before wxWidgets itself is initialized (= bad). You shouldn't have an instance of any wxWidgets class as global or static variable, because its ctor will be called before wxWidgets is initialized (it will be called even before main() ). Depending on the actual implementation of the class this may or may not work and should be avoided.

If that's the case in your application (based on the callstack, "ImageLoader" might be a candidate), you should reorganize your code accordingly.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 26, 2013

2013-10-26 14:01:09: rocrail (Rob Versluis) commented


The lldb is also new to me and I do not see any chance to step through the program...

Which user call can trigger this class:
ImageLoader::runInitializers
?

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 26, 2013

2013-10-26 14:02:08: rocrail (Rob Versluis) commented


The wxInitAllImageHandlers is in the OnInit method.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 26, 2013

2013-10-26 15:00:17: rocrail (Rob Versluis) commented


The first source called is in the wxWidgets library:
any.cpp:291

Without your help I can not fix this issue.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 26, 2013

2013-10-26 15:26:43: rocrail (Rob Versluis) commented


in object.cpp the last call:

    // Using IMPLEMENT_DYNAMIC_CLASS() macro twice (which may happen if you
    // link any object module twice mistakenly, or link twice against wx shared
    // library) will break this function because it will enter an infinite loop
    // and eventually die with "out of memory" - as this is quite hard to
    // detect if you're unaware of this, try to do some checks here.
    wxASSERT_MSG( classTable->Get(m_className) == NULL,
        wxString::Format
        (
            wxT("Class \"%s\" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?"),
            m_className
        )
    );

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 26, 2013

2013-10-26 15:29:18: ericj commented


I assumed ImageLoader was one of your classes, because i know it's not a wxWidgets class. But after googling it seems to be an OSX class and - based on the search results - seems to appear quite often in crash reports.

So unfortunately i personally can't help with this, sorry for the noise.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 26, 2013

2013-10-26 17:38:02: @vadz commented


Check that you don't use IMPLEMENT_DYNAMIC_CLASS() twice for the same class (by name, i.e. if you use it for a single class which is then used in two libraries both of which are linked into the same executable, this is still a problem). Looking at the value of str when it crashes (i.e. why does it actually crash? what is the pointer value?) might give a hint which class is the source of a problem.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 27, 2013

2013-10-27 07:53:00: rocrail (Rob Versluis) commented


The value of str is not accessible which is the cause of the crash.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 27, 2013

2013-10-27 11:07:05: @vadz commented


But where does it come from? I.e. try to go up the stack and check what's going on.

Once again, in normal case it should be impossible for this value to be invalid and it's almost certainly due to something that you do with IMPLEMENT_DYNAMIC_CLASS() in your code. I can only give hints about debugging this, I simply can't do it in your place.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 27, 2013

2013-10-27 11:15:42: rocrail (Rob Versluis) commented


I will try to add some printf's in the wx sources to tackle the class name involved.

But I do not understand why it does not crash on OS X 10.8, and those builds also do not crash under OS X 10.9...

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 27, 2013

2013-10-27 11:17:45: @vadz commented


I don't understand neither but this is just not a useful way to approach the problem. Clearly something has changed in the OS implementation details (I suspect it's something in the loader code). But we are not going to find what it was easily. OTOH it should be relatively easy to understand why does it crash now. And perhaps this will allow us to find what changed, too.

Good luck!

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 27, 2013

2013-10-27 11:26:29: rocrail (Rob Versluis) commented


The only diff in this case is the compiler and linker.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 27, 2013

2013-10-27 13:58:22: rocrail (Rob Versluis) commented


I feel lost...

robs-air:unxbin rob$ lldb rocview 
Current executable set to 'rocview' (x86_64).
(lldb) breakpoint set -f any.cpp -l 291
Breakpoint 1: 2 locations.
(lldb) run
Process 74276 launched: '/Users/rob/lp/Rocrail/unxbin/rocview' (x86_64)
Process 74276 stopped
* thread #1: tid # 0x1c8ac, 0x0000000100b38404 libwx_osx_cocoau-3.0.dylib`_GLOBAL__I_a + 4 at any.cpp:291, queue'com.apple.main-thread, stop reason = breakpoint 1.2
    frame #0: 0x0000000100b38404 libwx_osx_cocoau-3.0.dylib`_GLOBAL__I_a + 4 at any.cpp:291
   288 	    else if ( wxANY_VALUE_TYPE_CHECK_TYPE(dstType, bool) )
   289 	    {
   290 	        bool value2 = value ? true : false;
-> 291 	        wxAnyValueTypeImpl<bool>::SetValue(value2, dst);
   292 	    }
   293 	    else
   294 	        return false;
(lldb) s
Process 74276 stopped
* thread #1: tid # 0x1c8ac, 0x0000000100b37cff libwx_osx_cocoau-3.0.dylib`__cxx_global_var_init + 15 at iostream:76, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100b37cff libwx_osx_cocoau-3.0.dylib`__cxx_global_var_init + 15 at iostream:76
   73  	#endif
   74  	  //@}
   75  	
-> 76  	  // For construction of filebuffers for cout, cin, cerr, clog et. al.
   77  	  static ios_base::Init __ioinit;
   78  	
   79  	_GLIBCXX_END_NAMESPACE
(lldb) n
Process 74276 stopped
* thread #1: tid # 0x1c8ac, 0x0000000100b38409 libwx_osx_cocoau-3.0.dylib`_GLOBAL__I_a + 9 at any.cpp:291, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100b38409 libwx_osx_cocoau-3.0.dylib`_GLOBAL__I_a + 9 at any.cpp:291
   288 	    else if ( wxANY_VALUE_TYPE_CHECK_TYPE(dstType, bool) )
   289 	    {
   290 	        bool value2 = value ? true : false;
-> 291 	        wxAnyValueTypeImpl<bool>::SetValue(value2, dst);
   292 	    }
   293 	    else
   294 	        return false;
(lldb) 
***** Oops: 
Process 74276 stopped
* thread #1: tid # 0x1c8ac, 0x0000000100bc96a5 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 37 at hash.cpp:316, queue'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x21)
    frame #0: 0x0000000100bc96a5 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 37 at hash.cpp:316
   313 	    long int_key = 0;
   314 	
   315 	    const wxStringCharType *p = str.wx_str();
-> 316 	    while( *p )
   317 	        int_key += *p++;
   318 	
   319 	    return int_key;
(lldb) 

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 28, 2013

2013-10-28 14:13:28: @vadz commented


For any --enable-xxx you can also use --disable-xxx.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 28, 2013

2013-10-28 14:16:14: ericj commented


Can you give me a hint to disable wxAny?
Under Windows you'd change "#define wxUSE_ANY 1" in setup.h. If you're building from the command line, i'd guess there's a command line switch for it.

BTW: I'm not 100% sure if the "invalid" pointer (this=0x00007fff5fbfdea0) i talked about in my previous post, is really invalid. It could be possible that the memory of the stack pointer "lives" in a different address range. Maybe some OSX expert could comment on this.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 28, 2013

2013-10-28 15:11:31: rocrail (Rob Versluis) commented


No success. The crash is now in the archive class:

Current executable set to 'rocview' (x86_64).
(lldb) run
Process 25181 launched: '/Users/rob/lp/Rocrail/unxbin/rocview' (x86_64)
****
Process 25181 stopped
* thread #1: tid # 0x2ef34, 0x00007fff9018ba73 libstdc++.6.dylib`std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::length() const + 7, queue'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff9)
    frame #0: 0x00007fff9018ba73 libstdc++.6.dylib`std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::length() const + 7
libstdc++.6.dylib`std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::length() const + 7:
-> 0x7fff9018ba73:  movq   -24(%rax), %rax
   0x7fff9018ba77:  popq   %rbp
   0x7fff9018ba78:  ret    
   0x7fff9018ba79:  nop    
(lldb) bt
* thread #1: tid # 0x2ef34, 0x00007fff9018ba73 libstdc++.6.dylib`std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::length() const + 7, queue'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff9)
    frame #0: 0x00007fff9018ba73 libstdc++.6.dylib`std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::length() const + 7
    frame #1: 0x0000000100c0095d libwx_osx_cocoau-3.0.dylib`wxString::AsChar(this=0x00007fff5fbfdea0, conv=0x0000000101bbe6c0) const + 45 at string.cpp:540
    frame #2: 0x000000010002486f rocview`wxString::AsCharBuf(this=0x00007fff5fbfdea0, conv=0x0000000101bbe6c0) const + 47 at string.h:3546
    frame #3: 0x0000000100022ea4 rocview`wxString::mb_str(this=0x00007fff5fbfdea0, conv=0x0000000101bbe6c0) const + 36 at string.h:1829
    frame #4: 0x000000010003d6d3 rocview`wxClassInfo::wxClassInfo(this=0x0000000101b9ae60, className=0x0000000101744ac0, baseInfo1=0x0000000101b9db80, baseInfo2=0x0000000000000000, size=24, ctor=0x0000000000000000)()) + 163 at rtti.h:59
    frame #5: 0x000000010003b73d rocview`wxClassInfo::wxClassInfo(this=0x0000000101b9ae60, className=0x0000000101744ac0, baseInfo1=0x0000000101b9db80, baseInfo2=0x0000000000000000, size=24, ctor=0x0000000000000000)()) + 61 at rtti.h:62
    frame #6: 0x0000000100b3b388 libwx_osx_cocoau-3.0.dylib`__cxx_global_var_init1 + 56 at archive.cpp:20
    frame #7: 0x0000000100b3b43e libwx_osx_cocoau-3.0.dylib`_GLOBAL__I_a + 14 at archive.cpp:291
    frame #8: 0x00007fff5fc11c2e dyld`ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 268
    frame #9: 0x00007fff5fc11dba dyld`ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
    frame #10: 0x00007fff5fc0ea62 dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 308
    frame #11: 0x00007fff5fc0e9eb dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 189
    frame #12: 0x00007fff5fc0e8f6 dyld`ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 54
    frame #13: 0x00007fff5fc021da dyld`dyld::initializeMainExecutable() + 189
    frame #14: 0x00007fff5fc05560 dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 2419
    frame #15: 0x00007fff5fc0127b dyld`dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 477
    frame #16: 0x00007fff5fc0105e dyld`_dyld_start + 54

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 28, 2013

2013-10-28 19:36:51: @oneeyeman1 commented


Hi,
Replying to [comment:39 rocrail]:

No success. The crash is now in the archive class:

Do you free all memory you allocate?

Thank you.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 29, 2013

2013-10-29 06:33:26: rocrail (Rob Versluis) commented


This it at launching the application; No single line of code is backtraced of the user code, only wx.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 29, 2013

2013-10-29 06:35:00: rocrail (Rob Versluis) commented


This is the build of Rocview: (Just one class changed.)

06:29:46 **** Build of project Rocrail ****
make PLATFORM=MACOSX all macapp 
c++ -c -fPIC -g `wx-config --cflags`  -I.. -I../unxgen dialogs/rocprodlggen.cpp -o ../unxgen/rocview/bin/rocprodlggen.o
c++ -o ../unxbin/rocview ../unxgen/rocview/bin/messages.o ../unxgen/rocview/bin/icons.o ../unxgen/rocview/wrapper/bin/CVcat.o ../unxgen/rocview/wrapper/bin/CVconf.o ../unxgen/rocview/wrapper/bin/Cmdline.o ../unxgen/rocview/wrapper/bin/Gui.o ../unxgen/rocview/wrapper/bin/LcCtrl.o ../unxgen/rocview/wrapper/bin/MGV.o ../unxgen/rocview/wrapper/bin/MGVServo.o ../unxgen/rocview/wrapper/bin/MIC.o ../unxgen/rocview/wrapper/bin/ModPanel.o ../unxgen/rocview/wrapper/bin/Patch.o ../unxgen/rocview/wrapper/bin/PlanPanel.o ../unxgen/rocview/wrapper/bin/PowerCtrl.o ../unxgen/rocview/wrapper/bin/RRCon.o ../unxgen/rocview/wrapper/bin/Release.o ../unxgen/rocview/wrapper/bin/SensorMonitor.o ../unxgen/rocview/wrapper/bin/Shortcut.o ../unxgen/rocview/wrapper/bin/SplitPanel.o ../unxgen/rocview/wrapper/bin/SwCtrl.o ../unxgen/rocview/wrapper/bin/Tab.o ../unxgen/rocview/wrapper/bin/Theme.o ../unxgen/rocview/wrapper/bin/ThemeBlock.o ../unxgen/rocview/wrapper/bin/ThemePanel.o ../unxgen/rocview/wrapper/bin/Window.o ../unxgen/rocview/wrapper/bin/WorkSpace.o ../unxgen/rocview/wrapper/bin/WorkSpaces.o ../unxgen/rocview/wrapper/bin/guiwrapperinfo.o ../unxgen/rocview/wrapper/bin/version.o ../unxgen/rocview/wrapper/bin/wrapper.o ../unxgen/rocview/bin/accdecdlg.o ../unxgen/rocview/bin/accdecgendlg.o ../unxgen/rocview/bin/actionsctrldlg.o ../unxgen/rocview/bin/basedlg.o ../unxgen/rocview/bin/basenotebook.o ../unxgen/rocview/bin/blockdialog.o ../unxgen/rocview/bin/blockgroupingdlg.o ../unxgen/rocview/bin/cardlg.o ../unxgen/rocview/bin/cardlggen.o ../unxgen/rocview/bin/clockdialog.o ../unxgen/rocview/bin/cmdrecorder.o ../unxgen/rocview/bin/cmdrecordergen.o ../unxgen/rocview/bin/connectiondialog.o ../unxgen/rocview/bin/decconfigdlg.o ../unxgen/rocview/bin/decconfigdlggen.o ../unxgen/rocview/bin/dipdlg.o ../unxgen/rocview/bin/donkey.o ../unxgen/rocview/bin/donkeygen.o ../unxgen/rocview/bin/feedbackdialog.o ../unxgen/rocview/bin/fundialog.o ../unxgen/rocview/bin/fxdlg.o ../unxgen/rocview/bin/fxdlggen.o ../unxgen/rocview/bin/gotodlg.o ../unxgen/rocview/bin/gotodlggen.o ../unxgen/rocview/bin/guestloco.o ../unxgen/rocview/bin/guestlocogen.o ../unxgen/rocview/bin/historypanel.o ../unxgen/rocview/bin/infodialog.o ../unxgen/rocview/bin/issuedlg.o ../unxgen/rocview/bin/issuedlggen.o ../unxgen/rocview/bin/locationsdlg.o ../unxgen/rocview/bin/locdialog.o ../unxgen/rocview/bin/locowidget.o ../unxgen/rocview/bin/locowidgetgen.o ../unxgen/rocview/bin/locseldlg.o ../unxgen/rocview/bin/modplandlg.o ../unxgen/rocview/bin/modulepropsdlg.o ../unxgen/rocview/bin/mvtrackdlg.o ../unxgen/rocview/bin/operatordlg.o ../unxgen/rocview/bin/operatordlggen.o ../unxgen/rocview/bin/outputdialog.o ../unxgen/rocview/bin/planpaneldlg.o ../unxgen/rocview/bin/powerctrldlg.o ../unxgen/rocview/bin/powerctrlgen.o ../unxgen/rocview/bin/powermandlg.o ../unxgen/rocview/bin/powermandlggen.o ../unxgen/rocview/bin/rocguiinidlg.o ../unxgen/rocview/bin/rocprodlg.o ../unxgen/rocview/bin/rocprodlggen.o ../unxgen/rocview/bin/rocrailinidialog.o ../unxgen/rocview/bin/routedialog.o ../unxgen/rocview/bin/scheduledialog.o ../unxgen/rocview/bin/selectdialog.o ../unxgen/rocview/bin/seltabdlg.o ../unxgen/rocview/bin/seltabtrackdlg.o ../unxgen/rocview/bin/sensorevents.o ../unxgen/rocview/bin/sensoreventsgen.o ../unxgen/rocview/bin/signaldialog.o ../unxgen/rocview/bin/softwareupdates.o ../unxgen/rocview/bin/speedcurvedlg.o ../unxgen/rocview/bin/speedcurvedlggen.o ../unxgen/rocview/bin/stagedlg.o ../unxgen/rocview/bin/stagedlggen.o ../unxgen/rocview/bin/switchdialog.o ../unxgen/rocview/bin/textdialog.o ../unxgen/rocview/bin/throttledlg.o ../unxgen/rocview/bin/throttledlggen.o ../unxgen/rocview/bin/timedactions.o ../unxgen/rocview/bin/toursdlg.o ../unxgen/rocview/bin/toursdlggen.o ../unxgen/rocview/bin/trackdialog.o ../unxgen/rocview/bin/tttrackdialog.o ../unxgen/rocview/bin/turntabledialog.o ../unxgen/rocview/bin/undodlg.o ../unxgen/rocview/bin/waybilldlg.o ../unxgen/rocview/bin/waybilldlggen.o ../unxgen/rocview/bin/widgetspanel.o ../unxgen/rocview/bin/barjutdlg.o ../unxgen/rocview/bin/bidibdlg.o ../unxgen/rocview/bin/bidibdlggen.o ../unxgen/rocview/bin/cbusdlg.o ../unxgen/rocview/bin/cbusdlggen.o ../unxgen/rocview/bin/dcc232dlg.o ../unxgen/rocview/bin/dcc232dlggen.o ../unxgen/rocview/bin/ddxdlg.o ../unxgen/rocview/bin/dinamodlg.o ../unxgen/rocview/bin/ecosdlg.o ../unxgen/rocview/bin/gendlg.o ../unxgen/rocview/bin/hsi88dlg.o ../unxgen/rocview/bin/lenzdlg.o ../unxgen/rocview/bin/loconetdlg.o ../unxgen/rocview/bin/opendcc.o ../unxgen/rocview/bin/rocnetdlg.o ../unxgen/rocview/bin/rocnetdlggen.o ../unxgen/rocview/bin/srcpdlg.o ../unxgen/rocview/bin/bidibidendlggen.o ../unxgen/rocview/bin/bidibidentdlg.o ../unxgen/rocview/bin/cbusnodedlg.o ../unxgen/rocview/bin/cbusnodedlggen.o ../unxgen/rocview/bin/dtopswdlg.o ../unxgen/rocview/bin/dtopswdlggen.o ../unxgen/rocview/bin/locoio.o ../unxgen/rocview/bin/mgv141dlg.o ../unxgen/rocview/bin/mgv141dlggen.o ../unxgen/rocview/bin/mgvdlg.o ../unxgen/rocview/bin/mgvdlggen.o ../unxgen/rocview/bin/rocnetnodedlg.o ../unxgen/rocview/bin/rocnetnodegen.o ../unxgen/rocview/bin/uhl633x0dlg.o ../unxgen/rocview/bin/uhl633x0gen.o ../unxgen/rocview/bin/uhl68610dlg.o ../unxgen/rocview/bin/uhl68610gen.o ../unxgen/rocview/bin/renderer.o ../unxgen/rocview/bin/svg.o ../unxgen/rocview/bin/base.o ../unxgen/rocview/bin/basepanel.o ../unxgen/rocview/bin/clock.o ../unxgen/rocview/bin/cv.o ../unxgen/rocview/bin/guiapp.o ../unxgen/rocview/bin/guiframe.o ../unxgen/rocview/bin/item.o ../unxgen/rocview/bin/jssupport.o ../unxgen/rocview/bin/lc.o ../unxgen/rocview/bin/ledbutton.o ../unxgen/rocview/bin/lncv.o ../unxgen/rocview/bin/modpanel.o ../unxgen/rocview/bin/planpanel.o ../unxgen/rocview/bin/routedlg.o ../unxgen/rocview/bin/slider.o ../unxgen/rocview/bin/statbar.o ../unxgen/rocview/bin/swdlg.o ../unxgen/rocdigs/bin/bidib/bidibutils.o  ../unxbin/librocrail.a ../unxbin/libwrapper.a ../unxbin/librocs.a ../unxbin/librocutils.a `wx-config --libs`  -lpthread -ldl 

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 29, 2013

2013-10-29 06:35:57: rocrail (Rob Versluis) commented


06:29:46 **** Build of project Rocrail ****
make PLATFORM=MACOSX all macapp
c++ -c -fPIC -g wx-config --cflags -I.. -I../unxgen dialogs/rocprodlggen.cpp -o ../unxgen/rocview/bin/rocprodlggen.o
c++ -o ../unxbin/rocview ../unxgen/rocview/bin/messages.o ../unxgen/rocview/bin/icons.o ../unxgen/rocview/wrapper/bin/CVcat.o ../unxgen/rocview/wrapper/bin/CVconf.o ../unxgen/rocview/wrapper/bin/Cmdline.o ../unxgen/rocview/wrapper/bin/Gui.o ../unxgen/rocview/wrapper/bin/LcCtrl.o ../unxgen/rocview/wrapper/bin/MGV.o ../unxgen/rocview/wrapper/bin/MGVServo.o ../unxgen/rocview/wrapper/bin/MIC.o ../unxgen/rocview/wrapper/bin/ModPanel.o ../unxgen/rocview/wrapper/bin/Patch.o ../unxgen/rocview/wrapper/bin/PlanPanel.o ../unxgen/rocview/wrapper/bin/PowerCtrl.o ../unxgen/rocview/wrapper/bin/RRCon.o ../unxgen/rocview/wrapper/bin/Release.o ../unxgen/rocview/wrapper/bin/SensorMonitor.o ../unxgen/rocview/wrapper/bin/Shortcut.o ../unxgen/rocview/wrapper/bin/SplitPanel.o ../unxgen/rocview/wrapper/bin/SwCtrl.o ../unxgen/rocview/wrapper/bin/Tab.o ../unxgen/rocview/wrapper/bin/Theme.o ../unxgen/rocview/wrapper/bin/ThemeBlock.o ../unxgen/rocview/wrapper/bin/ThemePanel.o ../unxgen/rocview/wrapper/bin/Window.o ../unxgen/rocview/wrapper/bin/WorkSpace.o ../unxgen/rocview/wrapper/bin/WorkSpaces.o ../unxgen/rocview/wrapper/bin/guiwrapperinfo.o ../unxgen/rocview/wrapper/bin/version.o ../unxgen/rocview/wrapper/bin/wrapper.o ../unxgen/rocview/bin/accdecdlg.o ../unxgen/rocview/bin/accdecgendlg.o ../unxgen/rocview/bin/actionsctrldlg.o ../unxgen/rocview/bin/basedlg.o ../unxgen/rocview/bin/basenotebook.o ../unxgen/rocview/bin/blockdialog.o ../unxgen/rocview/bin/blockgroupingdlg.o ../unxgen/rocview/bin/cardlg.o ../unxgen/rocview/bin/cardlggen.o ../unxgen/rocview/bin/clockdialog.o ../unxgen/rocview/bin/cmdrecorder.o ../unxgen/rocview/bin/cmdrecordergen.o ../unxgen/rocview/bin/connectiondialog.o ../unxgen/rocview/bin/decconfigdlg.o ../unxgen/rocview/bin/decconfigdlggen.o ../unxgen/rocview/bin/dipdlg.o ../unxgen/rocview/bin/donkey.o ../unxgen/rocview/bin/donkeygen.o ../unxgen/rocview/bin/feedbackdialog.o ../unxgen/rocview/bin/fundialog.o ../unxgen/rocview/bin/fxdlg.o ../unxgen/rocview/bin/fxdlggen.o ../unxgen/rocview/bin/gotodlg.o ../unxgen/rocview/bin/gotodlggen.o ../unxgen/rocview/bin/guestloco.o ../unxgen/rocview/bin/guestlocogen.o ../unxgen/rocview/bin/historypanel.o ../unxgen/rocview/bin/infodialog.o ../unxgen/rocview/bin/issuedlg.o ../unxgen/rocview/bin/issuedlggen.o ../unxgen/rocview/bin/locationsdlg.o ../unxgen/rocview/bin/locdialog.o ../unxgen/rocview/bin/locowidget.o ../unxgen/rocview/bin/locowidgetgen.o ../unxgen/rocview/bin/locseldlg.o ../unxgen/rocview/bin/modplandlg.o ../unxgen/rocview/bin/modulepropsdlg.o ../unxgen/rocview/bin/mvtrackdlg.o ../unxgen/rocview/bin/operatordlg.o ../unxgen/rocview/bin/operatordlggen.o ../unxgen/rocview/bin/outputdialog.o ../unxgen/rocview/bin/planpaneldlg.o ../unxgen/rocview/bin/powerctrldlg.o ../unxgen/rocview/bin/powerctrlgen.o ../unxgen/rocview/bin/powermandlg.o ../unxgen/rocview/bin/powermandlggen.o ../unxgen/rocview/bin/rocguiinidlg.o ../unxgen/rocview/bin/rocprodlg.o ../unxgen/rocview/bin/rocprodlggen.o ../unxgen/rocview/bin/rocrailinidialog.o ../unxgen/rocview/bin/routedialog.o ../unxgen/rocview/bin/scheduledialog.o ../unxgen/rocview/bin/selectdialog.o ../unxgen/rocview/bin/seltabdlg.o ../unxgen/rocview/bin/seltabtrackdlg.o ../unxgen/rocview/bin/sensorevents.o ../unxgen/rocview/bin/sensoreventsgen.o ../unxgen/rocview/bin/signaldialog.o ../unxgen/rocview/bin/softwareupdates.o ../unxgen/rocview/bin/speedcurvedlg.o ../unxgen/rocview/bin/speedcurvedlggen.o ../unxgen/rocview/bin/stagedlg.o ../unxgen/rocview/bin/stagedlggen.o ../unxgen/rocview/bin/switchdialog.o ../unxgen/rocview/bin/textdialog.o ../unxgen/rocview/bin/throttledlg.o ../unxgen/rocview/bin/throttledlggen.o ../unxgen/rocview/bin/timedactions.o ../unxgen/rocview/bin/toursdlg.o ../unxgen/rocview/bin/toursdlggen.o ../unxgen/rocview/bin/trackdialog.o ../unxgen/rocview/bin/tttrackdialog.o ../unxgen/rocview/bin/turntabledialog.o ../unxgen/rocview/bin/undodlg.o ../unxgen/rocview/bin/waybilldlg.o ../unxgen/rocview/bin/waybilldlggen.o ../unxgen/rocview/bin/widgetspanel.o ../unxgen/rocview/bin/barjutdlg.o ../unxgen/rocview/bin/bidibdlg.o ../unxgen/rocview/bin/bidibdlggen.o ../unxgen/rocview/bin/cbusdlg.o ../unxgen/rocview/bin/cbusdlggen.o ../unxgen/rocview/bin/dcc232dlg.o ../unxgen/rocview/bin/dcc232dlggen.o ../unxgen/rocview/bin/ddxdlg.o ../unxgen/rocview/bin/dinamodlg.o ../unxgen/rocview/bin/ecosdlg.o ../unxgen/rocview/bin/gendlg.o ../unxgen/rocview/bin/hsi88dlg.o ../unxgen/rocview/bin/lenzdlg.o ../unxgen/rocview/bin/loconetdlg.o ../unxgen/rocview/bin/opendcc.o ../unxgen/rocview/bin/rocnetdlg.o ../unxgen/rocview/bin/rocnetdlggen.o ../unxgen/rocview/bin/srcpdlg.o ../unxgen/rocview/bin/bidibidendlggen.o ../unxgen/rocview/bin/bidibidentdlg.o ../unxgen/rocview/bin/cbusnodedlg.o ../unxgen/rocview/bin/cbusnodedlggen.o ../unxgen/rocview/bin/dtopswdlg.o ../unxgen/rocview/bin/dtopswdlggen.o ../unxgen/rocview/bin/locoio.o ../unxgen/rocview/bin/mgv141dlg.o ../unxgen/rocview/bin/mgv141dlggen.o ../unxgen/rocview/bin/mgvdlg.o ../unxgen/rocview/bin/mgvdlggen.o ../unxgen/rocview/bin/rocnetnodedlg.o ../unxgen/rocview/bin/rocnetnodegen.o ../unxgen/rocview/bin/uhl633x0dlg.o ../unxgen/rocview/bin/uhl633x0gen.o ../unxgen/rocview/bin/uhl68610dlg.o ../unxgen/rocview/bin/uhl68610gen.o ../unxgen/rocview/bin/renderer.o ../unxgen/rocview/bin/svg.o ../unxgen/rocview/bin/base.o ../unxgen/rocview/bin/basepanel.o ../unxgen/rocview/bin/clock.o ../unxgen/rocview/bin/cv.o ../unxgen/rocview/bin/guiapp.o ../unxgen/rocview/bin/guiframe.o ../unxgen/rocview/bin/item.o ../unxgen/rocview/bin/jssupport.o ../unxgen/rocview/bin/lc.o ../unxgen/rocview/bin/ledbutton.o ../unxgen/rocview/bin/lncv.o ../unxgen/rocview/bin/modpanel.o ../unxgen/rocview/bin/planpanel.o ../unxgen/rocview/bin/routedlg.o ../unxgen/rocview/bin/slider.o ../unxgen/rocview/bin/statbar.o ../unxgen/rocview/bin/swdlg.o ../unxgen/rocdigs/bin/bidib/bidibutils.o ../unxbin/librocrail.a ../unxbin/libwrapper.a ../unxbin/librocs.a ../unxbin/librocutils.a wx-config --libs -lpthread -ldl

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 29, 2013

2013-10-29 18:42:26: rocrail (Rob Versluis) commented


I debugged a lot but as far as I can see it does not touch my code before the crash.
I need some assistance to avoid breaking OS X support for Rocrail.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 29, 2013

2013-10-29 18:57:31: @oneeyeman1 commented


Ok, so if you build wxWidgets with you configurationon the offending OS and then build minimal sample what happens? And what happens if you build propgrid or xti sample as suggested by Eric?

If minimal sample does not crash, try putting the code from you Rockrail application into minimal sample line by line starting from the application/main frame constructor until it crashes.

Also, since the crash is in different place when removed wxAny support: did you check that all pointers are freed? Did you run the program under valgrind?

Do you use multi-threading? Do you do something GUI-related in a secondary thread?

Thank you.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 29, 2013

2013-10-29 19:44:26: ericj commented


Replying to [comment:44 rocrail]:

I debugged a lot but as far as I can see it does not touch my code before the crash.
I need some assistance to avoid breaking OS X support for Rocrail.

If the crash can't be reproduced with any of the wx samples, the ball is on your side. It's very unlikely that someone takes your project, builds it and debugs it for you.

I think it's pretty clear that the crash happens during the initialization of the global variables.

a) Did you check if your project contains any global or static variables of complex classes? If you don't know, check your code.

b) If a) is excluded as error source, you have to set a breakpoint before the crash, single step through the code and find out what exactly happens and why it happens. wxClassInfo::Register() in src/common/objecp.cpp would be my first guess. If i read the backtrace correctly, the crash should happen in this line:
wxASSERT_MSG( classTable->Get(m_className) == NULL,

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 29, 2013

2013-10-29 20:33:07: @dconnet commented


Replying to [comment:46 ericj]:

I think it's pretty clear that the crash happens during the initialization of the global variables.

I ran into an issue with global variables also (and static variables in functions) when I changed to using clang/xcode5. (static link) My removing all of those, I solved my issue.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 29, 2013

2013-10-29 22:46:12: rocrail (Rob Versluis) commented


If minimal sample does not crash, try putting the code from you Rocrail application
into minimal sample line by line starting from the application/main frame constructor until it crashes.

Line by line? Impossible with this number of source code lines.

Global and static variables are common and are sometimes needed/wanted.

Again my status quo:

All build on OS X 10.8 runs perfectly on OS X 10.9.
So why should an global/static issue not crash in this case?

All build on OS X 10.9 crash directly at initialising the static vars in the wx lib on OS X 10.9.
So what is different? The source code is equal. The build tools are new. Why does my source code have issues?

All wx samples are very tiny and I did not yet tested them all.
Strip down my project for testing would take too much time I do not have.

I set a break point in the wxApp main function but it crashes before at initialising statics in wxAny, wxArchive…. :(

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 29, 2013

2013-10-29 23:45:01: paulclinger (Paul K) commented


All build on OS X 10.8 runs perfectly on OS X 10.9.
All build on OS X 10.9 crash directly at initialising the static vars in the wx lib on OS X 10.9.

As a workaround, how about building wxwidgets for your app with --with-macosx-version-min=10.8? You can keep 10.8 SDK on 10.9 and build against that SDK (I do this with my app as well to stay compatible with 10.6).

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 30, 2013

2013-10-30 00:40:31: ericj commented


Replying to [comment:48 rocrail]:

I set a break point in the wxApp main function but it crashes before at initialising statics in wxAny, wxArchive…. :(

That's too late, the crash happens earlier, even before main(). Like i said above, set a breakpoint in wxClassInfo::Register() in src/common/object.cpp

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 30, 2013

2013-10-30 09:04:43: rocrail (Rob Versluis) commented


As a workaround, how about building wxwidgets for your app with --with-macosx-version-min=10.8?
Did not help.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 30, 2013

2013-10-30 09:20:28: @csomor commented


the static initializer behaviour will not change by switching the SDK but only by switching the compiler, so I'd try copying an xcode4 to the 10.9 system and use its compilers for the command line builds

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 30, 2013

2013-10-30 09:50:39: rocrail (Rob Versluis) commented


set a breakpoint in wxClassInfo::Register() in src/common/object.cpp

Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100bca1d1 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 33 at hash.cpp:316, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100bca1d1 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 33 at hash.cpp:316
   313 	    long int_key = 0;
   314 	
   315 	    const wxStringCharType *p = str.wx_str();
-> 316 	    while( *p )
   317 	        int_key += *p++;
   318 	
   319 	    return int_key;
(lldb) fr v
(const wxString &) str = 0x00007fff5fbfde88: {
  m_impl = unable to read data
  m_convertedToChar = {
    m_str = 0x000000000000001c
    m_len = 4339057776
  }
}
(long) int_key = 0
(const wxStringCharType *) p = 0x0000000000000021
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100bca1d5 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 37 at hash.cpp:316, queue'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x21)
    frame #0: 0x0000000100bca1d5 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 37 at hash.cpp:316
   313 	    long int_key = 0;
   314 	
   315 	    const wxStringCharType *p = str.wx_str();
-> 316 	    while( *p )
   317 	        int_key += *p++;
   318 	
   319 	    return int_key;
(lldb) fr v
(const wxString &) str = 0x00007fff5fbfde88: {
  m_impl = unable to read data
  m_convertedToChar = {
    m_str = 0x000000000000001c
    m_len = 4339057776
  }
}
(long) int_key = 0
(const wxStringCharType *) p = 0x0000000000000021
(lldb) n

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 30, 2013

2013-10-30 10:17:11: rocrail (Rob Versluis) commented


The complete debug session:

Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100025048 rocview`wxString::ImplStr(str=0x000000010175a310) + 8 at string.h:472, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100025048 rocview`wxString::ImplStr(str=0x000000010175a310) + 8 at string.h:472
   469 	  // returns C string encoded as the implementation expects:
   470 	  #if wxUSE_UNICODE
   471 	  static const wchar_t* ImplStr(const wchar_t* str)
-> 472 	    { return str ? str : wxT(""); }
   473 	  static const SubstrBufFromWC ImplStr(const wchar_t* str, size_t n)
   474 	    { return SubstrBufFromWC(str, (str && n == npos) ? wxWcslen(str) : n); }
   475 	  static wxScopedWCharBuffer ImplStr(const char* str,
(lldb) fr v
(const wchar_t *) str = 0x000000010175a310 L"wxAnyValueTypeGlobalsManager"
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100024f93 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 35 at string.h:1268, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100024f93 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 35 at string.h:1268
   1265	
   1266	    // ctors from wchar_t* strings:
   1267	  wxString(const wchar_t *pwz)
-> 1268	    : m_impl(ImplStr(pwz)) {}
   1269	  wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv))
   1270	    : m_impl(ImplStr(pwz)) {}
   1271	  wxString(const wchar_t *pwz, size_t nLength)
(lldb) fr v
(wxString *) this = 0x00007fff5fbfde88
(const wchar_t *) pwz = 0x000000010175a310 L"wxAnyValueTypeGlobalsManager"
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100025001 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 145 at string.h:1268, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100025001 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 145 at string.h:1268
   1265	
   1266	    // ctors from wchar_t* strings:
   1267	  wxString(const wchar_t *pwz)
-> 1268	    : m_impl(ImplStr(pwz)) {}
   1269	  wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv))
   1270	    : m_impl(ImplStr(pwz)) {}
   1271	  wxString(const wchar_t *pwz, size_t nLength)
(lldb) fr v
(wxString *) this = 0x00007fff5fbfde88
(const wchar_t *) pwz = 0x000000010175a310 L"wxAnyValueTypeGlobalsManager"
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100022e9d rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 29 at string.h:1268, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100022e9d rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 29 at string.h:1268
   1265	
   1266	    // ctors from wchar_t* strings:
   1267	  wxString(const wchar_t *pwz)
-> 1268	    : m_impl(ImplStr(pwz)) {}
   1269	  wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv))
   1270	    : m_impl(ImplStr(pwz)) {}
   1271	  wxString(const wchar_t *pwz, size_t nLength)
(lldb) fr v
(wxString *) this = 0x00007fff5fbfde88
(const wchar_t *) pwz = 0x000000010175a310 L"wxAnyValueTypeGlobalsManager"
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100beb5a2 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 370 at object.cpp:245, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100beb5a2 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 370 at object.cpp:245
   242 	    // library) will break this function because it will enter an infinite loop
   243 	    // and eventually die with "out of memory" - as this is quite hard to
   244 	    // detect if you're unaware of this, try to do some checks here.
-> 245 	    wxASSERT_MSG( classTable->Get(m_className) == NULL,
   246 	        wxString::Format
   247 	        (
   248 	            wxT("Class \"%s\" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?"),
(lldb) fr v
(wxClassInfo *) this = 0x0000000101bc0868
(wxHashTable *) classTable = 0x0000000102a0c430
(lldb) s
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100526614 rocview`wxHashTable::Get(this=0x0000000102a0c430, value=0x00007fff5fbfde88) const + 20 at hash.h:213, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100526614 rocview`wxHashTable::Get(this=0x0000000102a0c430, value=0x00007fff5fbfde88) const + 20 at hash.h:213
   210 	    wxObject *Get(long lhash, long value) const
   211 	        { return (wxObject*)DoGet( value, lhash ); }
   212 	    wxObject *Get(const wxString& value) const
-> 213 	        { return (wxObject*)DoGet( value, MakeKey( value ) ); }
   214 	    wxObject *Get(long lhash, const wxString& value) const
   215 	        { return (wxObject*)DoGet( value, lhash ); }
   216 	
(lldb) 
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100bca1bc libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 12 at hash.cpp:313, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100bca1bc libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 12 at hash.cpp:313
   310 	
   311 	long wxHashTableBase::MakeKey( const wxString& str )
   312 	{
-> 313 	    long int_key = 0;
   314 	
   315 	    const wxStringCharType *p = str.wx_str();
   316 	    while( *p )
(lldb) fr v
(const wxString &) str = 0x00007fff5fbfde88: {
  m_impl = unable to read data
  m_convertedToChar = {
    m_str = 0x000000000000001c
    m_len = 4339057776
  }
}
(long) int_key = 140734799797680
(const wxStringCharType *) p = 0x00007fff5fbfde88
(lldb) s
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100bca1c4 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 20 at hash.cpp:315, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100bca1c4 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 20 at hash.cpp:315
   312 	{
   313 	    long int_key = 0;
   314 	
-> 315 	    const wxStringCharType *p = str.wx_str();
   316 	    while( *p )
   317 	        int_key += *p++;
   318 	
(lldb) s
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100b3f600 libwx_osx_cocoau-3.0.dylib`wxString::wx_str(this=0x00007fff5fbfde88) const + 16 at string.h:1637, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100b3f600 libwx_osx_cocoau-3.0.dylib`wxString::wx_str(this=0x00007fff5fbfde88) const + 16 at string.h:1637
   1634	
   1635	    // explicit conversion to C string in internal representation (char*,
   1636	    // wchar_t*, UTF-8-encoded char*, depending on the build):
-> 1637	    const wxStringCharType *wx_str() const { return m_impl.c_str(); }
   1638	
   1639	    // conversion to *non-const* multibyte or widestring buffer; modifying
   1640	    // returned buffer won't affect the string, these methods are only useful
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100bca1cd libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 29 at hash.cpp:315, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100bca1cd libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 29 at hash.cpp:315
   312 	{
   313 	    long int_key = 0;
   314 	
-> 315 	    const wxStringCharType *p = str.wx_str();
   316 	    while( *p )
   317 	        int_key += *p++;
   318 	
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100bca1d1 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 33 at hash.cpp:316, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100bca1d1 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 33 at hash.cpp:316
   313 	    long int_key = 0;
   314 	
   315 	    const wxStringCharType *p = str.wx_str();
-> 316 	    while( *p )
   317 	        int_key += *p++;
   318 	
   319 	    return int_key;
(lldb) fr v
(const wxString &) str = 0x00007fff5fbfde88: {
  m_impl = unable to read data
  m_convertedToChar = {
    m_str = 0x000000000000001c
    m_len = 4339057776
  }
}
(long) int_key = 0
(const wxStringCharType *) p = 0x0000000000000021
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100bca1d5 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 37 at hash.cpp:316, queue'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x21)
    frame #0: 0x0000000100bca1d5 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 37 at hash.cpp:316
   313 	    long int_key = 0;
   314 	
   315 	    const wxStringCharType *p = str.wx_str();
-> 316 	    while( *p )
   317 	        int_key += *p++;
   318 	
   319 	    return int_key;
(lldb) fr v
(const wxString &) str = 0x00007fff5fbfde88: {
  m_impl = unable to read data
  m_convertedToChar = {
    m_str = 0x000000000000001c
    m_len = 4339057776
  }
}
(long) int_key = 0
(const wxStringCharType *) p = 0x0000000000000021
(lldb) n
Process 58139 stopped

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 30, 2013

2013-10-30 11:05:20: rocrail (Rob Versluis) commented


The first part was missing in my prev. posting.

Process 58119 launched: '/Users/rob/lp/Rocrail/unxbin/rocview' (x86_64)
Process 58119 stopped
* thread #1: tid # 0x3d721, 0x0000000100beb443 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 19 at object.cpp:228, queue'com.apple.main-thread, stop reason = breakpoint 1.1
    frame #0: 0x0000000100beb443 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 19 at object.cpp:228
   225 	
   226 	    wxHashTable *classTable;
   227 	
-> 228 	    if ( !sm_classTable )
   229 	    {
   230 	        // keep the hash local initially, reentrance is possible
   231 	        classTable = new wxHashTable(wxKEY_STRING);
(lldb) n
Process 58119 stopped
* thread #1: tid # 0x3d721, 0x0000000100beb460 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 48 at object.cpp:231, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100beb460 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 48 at object.cpp:231
   228 	    if ( !sm_classTable )
   229 	    {
   230 	        // keep the hash local initially, reentrance is possible
-> 231 	        classTable = new wxHashTable(wxKEY_STRING);
   232 	    }
   233 	    else
   234 	    {
(lldb) n
Process 58119 stopped
* thread #1: tid # 0x3d721, 0x0000000100beb490 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 96 at object.cpp:275, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100beb490 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 96 at object.cpp:275
   272 	#if wxDEBUG_LEVEL
   273 	    entry = 0;
   274 	#endif // wxDEBUG_LEVEL
-> 275 	}
   276 	
   277 	void wxClassInfo::Unregister()
   278 	{
(lldb) n
Process 58119 stopped
* thread #1: tid # 0x3d721, 0x0000000100beb49b libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 107 at object.cpp:232, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100beb49b libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 107 at object.cpp:232
   229 	    {
   230 	        // keep the hash local initially, reentrance is possible
   231 	        classTable = new wxHashTable(wxKEY_STRING);
-> 232 	    }
   233 	    else
   234 	    {
   235 	        // guard againt reentrance once the global has been created
(lldb) n
Process 58119 stopped
* thread #1: tid # 0x3d721, 0x0000000100beb544 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 276 at object.cpp:245, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100beb544 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 276 at object.cpp:245
   242 	    // library) will break this function because it will enter an infinite loop
   243 	    // and eventually die with "out of memory" - as this is quite hard to
   244 	    // detect if you're unaware of this, try to do some checks here.
-> 245 	    wxASSERT_MSG( classTable->Get(m_className) == NULL,
   246 	        wxString::Format
   247 	        (
   248 	            wxT("Class \"%s\" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?"),
(lldb) s
Process 58119 stopped
* thread #1: tid # 0x3d721, 0x0000000100022e94 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 20 at string.h:1268, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100022e94 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 20 at string.h:1268
   1265	
   1266	    // ctors from wchar_t* strings:
   1267	  wxString(const wchar_t *pwz)
-> 1268	    : m_impl(ImplStr(pwz)) {}
   1269	  wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv))
   1270	    : m_impl(ImplStr(pwz)) {}
   1271	  wxString(const wchar_t *pwz, size_t nLength)
(lldb) 
Process 58119 stopped
* thread #1: tid # 0x3d721, 0x0000000100024f87 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 23 at string.h:1268, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100024f87 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 23 at string.h:1268
   1265	
   1266	    // ctors from wchar_t* strings:
   1267	  wxString(const wchar_t *pwz)
-> 1268	    : m_impl(ImplStr(pwz)) {}
   1269	  wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv))
   1270	    : m_impl(ImplStr(pwz)) {}
   1271	  wxString(const wchar_t *pwz, size_t nLength)
(lldb) 
Process 58119 stopped
* thread #1: tid # 0x3d721, 0x0000000100025048 rocview`wxString::ImplStr(str=0x000000010175a310) + 8 at string.h:472, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100025048 rocview`wxString::ImplStr(str=0x000000010175a310) + 8 at string.h:472
   469 	  // returns C string encoded as the implementation expects:
   470 	  #if wxUSE_UNICODE
   471 	  static const wchar_t* ImplStr(const wchar_t* str)
-> 472 	    { return str ? str : wxT(""); }
   473 	  static const SubstrBufFromWC ImplStr(const wchar_t* str, size_t n)
   474 	    { return SubstrBufFromWC(str, (str && n == npos) ? wxWcslen(str) : n); }
   475 	  static wxScopedWCharBuffer ImplStr(const char* str,
(lldb) 
Process 58119 stopped
* thread #1: tid # 0x3d721, 0x0000000100024f93 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 35 at string.h:1268, queue'com.apple.main-thread, stop reason = trace
    frame #0: 0x0000000100024f93 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 35 at string.h:1268
   1265	
   1266	    // ctors from wchar_t* strings:
   1267	  wxString(const wchar_t *pwz)
-> 1268	    : m_impl(ImplStr(pwz)) {}
   1269	  wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv))
   1270	    : m_impl(ImplStr(pwz)) {}
   1271	  wxString(const wchar_t *pwz, size_t nLength)
(lldb) 
Process 58119 stopped
* thread #1: tid # 0x3d721, 0x0000000100024fe4 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 116 at string.h:1268, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100024fe4 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 116 at string.h:1268
   1265	
   1266	    // ctors from wchar_t* strings:
   1267	  wxString(const wchar_t *pwz)
-> 1268	    : m_impl(ImplStr(pwz)) {}
   1269	  wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv))
   1270	    : m_impl(ImplStr(pwz)) {}
   1271	  wxString(const wchar_t *pwz, size_t nLength)
(lldb) q
Quitting LLDB will kill one or more processes. Do you really want to proceed: [Y/n] y
robs-air:unxbin rob$ lldb rocview 
Current executable set to 'rocview' (x86_64).
(lldb) breakpoint set -f object.cpp -l 226
Breakpoint 1: where # libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register() + 19 at object.cpp:228, address0x00000000000c1443
(lldb) run
Process 58139 launched: '/Users/rob/lp/Rocrail/unxbin/rocview' (x86_64)
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100beb443 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 19 at object.cpp:228, queue'com.apple.main-thread, stop reason = breakpoint 1.1
    frame #0: 0x0000000100beb443 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 19 at object.cpp:228
   225 	
   226 	    wxHashTable *classTable;
   227 	
-> 228 	    if ( !sm_classTable )
   229 	    {
   230 	        // keep the hash local initially, reentrance is possible
   231 	        classTable = new wxHashTable(wxKEY_STRING);
(lldb) fr v
(wxClassInfo *) this = 0x0000000101bc0868
(wxHashTable *) classTable = 0x00007fff5fbfdf00
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100beb460 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 48 at object.cpp:231, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100beb460 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 48 at object.cpp:231
   228 	    if ( !sm_classTable )
   229 	    {
   230 	        // keep the hash local initially, reentrance is possible
-> 231 	        classTable = new wxHashTable(wxKEY_STRING);
   232 	    }
   233 	    else
   234 	    {
(lldb) 
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100beb490 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 96 at object.cpp:275, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100beb490 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 96 at object.cpp:275
   272 	#if wxDEBUG_LEVEL
   273 	    entry = 0;
   274 	#endif // wxDEBUG_LEVEL
-> 275 	}
   276 	
   277 	void wxClassInfo::Unregister()
   278 	{
(lldb) fr v
(wxClassInfo *) this = 0x0000000101bc0868
(wxHashTable *) classTable = 0x00007fff5fbfdf00
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100beb49b libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 107 at object.cpp:232, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100beb49b libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 107 at object.cpp:232
   229 	    {
   230 	        // keep the hash local initially, reentrance is possible
   231 	        classTable = new wxHashTable(wxKEY_STRING);
-> 232 	    }
   233 	    else
   234 	    {
   235 	        // guard againt reentrance once the global has been created
(lldb) 
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100beb544 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 276 at object.cpp:245, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100beb544 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 276 at object.cpp:245
   242 	    // library) will break this function because it will enter an infinite loop
   243 	    // and eventually die with "out of memory" - as this is quite hard to
   244 	    // detect if you're unaware of this, try to do some checks here.
-> 245 	    wxASSERT_MSG( classTable->Get(m_className) == NULL,
   246 	        wxString::Format
   247 	        (
   248 	            wxT("Class \"%s\" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?"),
(lldb) fr v
(wxClassInfo *) this = 0x0000000101bc0868
(wxHashTable *) classTable = 0x0000000102a0c430
(lldb) s
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100022e94 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 20 at string.h:1268, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100022e94 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 20 at string.h:1268
   1265	
   1266	    // ctors from wchar_t* strings:
   1267	  wxString(const wchar_t *pwz)
-> 1268	    : m_impl(ImplStr(pwz)) {}
   1269	  wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv))
   1270	    : m_impl(ImplStr(pwz)) {}
   1271	  wxString(const wchar_t *pwz, size_t nLength)
(lldb) fr v
(wxString *) this = 0x00007fff5fbfde88
(const wchar_t *) pwz = 0x000000010175a310 L"wxAnyValueTypeGlobalsManager"
(lldb) s
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100024f87 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 23 at string.h:1268, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100024f87 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 23 at string.h:1268
   1265	
   1266	    // ctors from wchar_t* strings:
   1267	  wxString(const wchar_t *pwz)
-> 1268	    : m_impl(ImplStr(pwz)) {}
   1269	  wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv))
   1270	    : m_impl(ImplStr(pwz)) {}
   1271	  wxString(const wchar_t *pwz, size_t nLength)
(lldb) fr v
(wxString *) this = 0x00007fff5fbfde88
(const wchar_t *) pwz = 0x000000010175a310 L"wxAnyValueTypeGlobalsManager"
(lldb) s
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100025048 rocview`wxString::ImplStr(str=0x000000010175a310) + 8 at string.h:472, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100025048 rocview`wxString::ImplStr(str=0x000000010175a310) + 8 at string.h:472
   469 	  // returns C string encoded as the implementation expects:
   470 	  #if wxUSE_UNICODE
   471 	  static const wchar_t* ImplStr(const wchar_t* str)
-> 472 	    { return str ? str : wxT(""); }
   473 	  static const SubstrBufFromWC ImplStr(const wchar_t* str, size_t n)
   474 	    { return SubstrBufFromWC(str, (str && n == npos) ? wxWcslen(str) : n); }
   475 	  static wxScopedWCharBuffer ImplStr(const char* str,
(lldb) fr v
(const wchar_t *) str = 0x000000010175a310 L"wxAnyValueTypeGlobalsManager"
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100024f93 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 35 at string.h:1268, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100024f93 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 35 at string.h:1268
   1265	
   1266	    // ctors from wchar_t* strings:
   1267	  wxString(const wchar_t *pwz)
-> 1268	    : m_impl(ImplStr(pwz)) {}
   1269	  wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv))
   1270	    : m_impl(ImplStr(pwz)) {}
   1271	  wxString(const wchar_t *pwz, size_t nLength)
(lldb) fr v
(wxString *) this = 0x00007fff5fbfde88
(const wchar_t *) pwz = 0x000000010175a310 L"wxAnyValueTypeGlobalsManager"
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100025001 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 145 at string.h:1268, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100025001 rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 145 at string.h:1268
   1265	
   1266	    // ctors from wchar_t* strings:
   1267	  wxString(const wchar_t *pwz)
-> 1268	    : m_impl(ImplStr(pwz)) {}
   1269	  wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv))
   1270	    : m_impl(ImplStr(pwz)) {}
   1271	  wxString(const wchar_t *pwz, size_t nLength)
(lldb) fr v
(wxString *) this = 0x00007fff5fbfde88
(const wchar_t *) pwz = 0x000000010175a310 L"wxAnyValueTypeGlobalsManager"
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100022e9d rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 29 at string.h:1268, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100022e9d rocview`wxString::wxString(this=0x00007fff5fbfde88, pwz=0x000000010175a310) + 29 at string.h:1268
   1265	
   1266	    // ctors from wchar_t* strings:
   1267	  wxString(const wchar_t *pwz)
-> 1268	    : m_impl(ImplStr(pwz)) {}
   1269	  wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv))
   1270	    : m_impl(ImplStr(pwz)) {}
   1271	  wxString(const wchar_t *pwz, size_t nLength)
(lldb) fr v
(wxString *) this = 0x00007fff5fbfde88
(const wchar_t *) pwz = 0x000000010175a310 L"wxAnyValueTypeGlobalsManager"
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100beb5a2 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 370 at object.cpp:245, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100beb5a2 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x0000000101bc0868) + 370 at object.cpp:245
   242 	    // library) will break this function because it will enter an infinite loop
   243 	    // and eventually die with "out of memory" - as this is quite hard to
   244 	    // detect if you're unaware of this, try to do some checks here.
-> 245 	    wxASSERT_MSG( classTable->Get(m_className) == NULL,
   246 	        wxString::Format
   247 	        (
   248 	            wxT("Class \"%s\" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?"),
(lldb) fr v
(wxClassInfo *) this = 0x0000000101bc0868
(wxHashTable *) classTable = 0x0000000102a0c430
(lldb) s
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100526614 rocview`wxHashTable::Get(this=0x0000000102a0c430, value=0x00007fff5fbfde88) const + 20 at hash.h:213, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100526614 rocview`wxHashTable::Get(this=0x0000000102a0c430, value=0x00007fff5fbfde88) const + 20 at hash.h:213
   210 	    wxObject *Get(long lhash, long value) const
   211 	        { return (wxObject*)DoGet( value, lhash ); }
   212 	    wxObject *Get(const wxString& value) const
-> 213 	        { return (wxObject*)DoGet( value, MakeKey( value ) ); }
   214 	    wxObject *Get(long lhash, const wxString& value) const
   215 	        { return (wxObject*)DoGet( value, lhash ); }
   216 	
(lldb) 
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100bca1bc libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 12 at hash.cpp:313, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100bca1bc libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 12 at hash.cpp:313
   310 	
   311 	long wxHashTableBase::MakeKey( const wxString& str )
   312 	{
-> 313 	    long int_key = 0;
   314 	
   315 	    const wxStringCharType *p = str.wx_str();
   316 	    while( *p )
(lldb) fr v
(const wxString &) str = 0x00007fff5fbfde88: {
  m_impl = unable to read data
  m_convertedToChar = {
    m_str = 0x000000000000001c
    m_len = 4339057776
  }
}
(long) int_key = 140734799797680
(const wxStringCharType *) p = 0x00007fff5fbfde88
(lldb) s
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100bca1c4 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 20 at hash.cpp:315, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100bca1c4 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 20 at hash.cpp:315
   312 	{
   313 	    long int_key = 0;
   314 	
-> 315 	    const wxStringCharType *p = str.wx_str();
   316 	    while( *p )
   317 	        int_key += *p++;
   318 	
(lldb) s
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100b3f600 libwx_osx_cocoau-3.0.dylib`wxString::wx_str(this=0x00007fff5fbfde88) const + 16 at string.h:1637, queue'com.apple.main-thread, stop reason = step in
    frame #0: 0x0000000100b3f600 libwx_osx_cocoau-3.0.dylib`wxString::wx_str(this=0x00007fff5fbfde88) const + 16 at string.h:1637
   1634	
   1635	    // explicit conversion to C string in internal representation (char*,
   1636	    // wchar_t*, UTF-8-encoded char*, depending on the build):
-> 1637	    const wxStringCharType *wx_str() const { return m_impl.c_str(); }
   1638	
   1639	    // conversion to *non-const* multibyte or widestring buffer; modifying
   1640	    // returned buffer won't affect the string, these methods are only useful
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100bca1cd libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 29 at hash.cpp:315, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100bca1cd libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 29 at hash.cpp:315
   312 	{
   313 	    long int_key = 0;
   314 	
-> 315 	    const wxStringCharType *p = str.wx_str();
   316 	    while( *p )
   317 	        int_key += *p++;
   318 	
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100bca1d1 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 33 at hash.cpp:316, queue'com.apple.main-thread, stop reason = step over
    frame #0: 0x0000000100bca1d1 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 33 at hash.cpp:316
   313 	    long int_key = 0;
   314 	
   315 	    const wxStringCharType *p = str.wx_str();
-> 316 	    while( *p )
   317 	        int_key += *p++;
   318 	
   319 	    return int_key;
(lldb) fr v
(const wxString &) str = 0x00007fff5fbfde88: {
  m_impl = unable to read data
  m_convertedToChar = {
    m_str = 0x000000000000001c
    m_len = 4339057776
  }
}
(long) int_key = 0
(const wxStringCharType *) p = 0x0000000000000021
(lldb) n
Process 58139 stopped
* thread #1: tid # 0x3de26, 0x0000000100bca1d5 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 37 at hash.cpp:316, queue'com.apple.main-thread, stop reason = EXC_BAD_ACCESS (code=1, address=0x21)
    frame #0: 0x0000000100bca1d5 libwx_osx_cocoau-3.0.dylib`wxHashTableBase::MakeKey(str=0x00007fff5fbfde88) + 37 at hash.cpp:316
   313 	    long int_key = 0;
   314 	
   315 	    const wxStringCharType *p = str.wx_str();
-> 316 	    while( *p )
   317 	        int_key += *p++;
   318 	
   319 	    return int_key;
(lldb) fr v
(const wxString &) str = 0x00007fff5fbfde88: {
  m_impl = unable to read data
  m_convertedToChar = {
    m_str = 0x000000000000001c
    m_len = 4339057776
  }
}
(long) int_key = 0
(const wxStringCharType *) p = 0x0000000000000021
(lldb) n
Process 58139 stopped

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 30, 2013

2013-10-30 11:47:14: ericj commented


I'm pretty spoiled by visual debuggers, so i have a hard time reading this 80s output. But for me, everything boils down to the question: is 0x00007fff5fbfde88 a valid address in OSX address space? (Stefan?)

If not, i would go as far as saying that this is a compiler bug. (but with all caution, as i'm not a OSX expert)

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 31, 2013

2013-10-31 15:04:26: rocrail (Rob Versluis) commented


How to proceed?
Report the problem at Apple?

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 31, 2013

2013-10-31 16:47:17: @vadz changed status from new to infoneeded_new

2013-10-31 16:47:17: @vadz commented

I'm not sure at all it's a problem with Apple tools. And, anyhow, Apple is going to ask you to provide a minimal example reproducing the problem too.

I'm sorry, I really don't know how to say it more clearly but you must reduce the problem. If you can't find the offending global ctor by just looking at your code, you will need to start removing global variables, one by one, until you find the one that causes the problem. Nobody but you can do this. Again, please feel free to ask for more details if this is unclear but it seems like you're just ignoring this repeatedly given piece of advice. Unfortunately I can't (or at least am not willing to) debug your application for you and I don't think there is anything else to do.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 31, 2013

2013-10-31 18:25:40: rocrail (Rob Versluis) changed status from infoneeded_new to new

2013-10-31 18:25:40: rocrail (Rob Versluis) commented

There are no global ctor's in my code; There is no reason for it to have any.
Launching Rocrail, compiled on Mountain Lion, runs as expected on Mavericks.
As you can see in the debug trace there is not a single line reported outside the wxWidgets lib.
I cannot strip down my app with so many dialogs because that will cost me weeks of free time.
All dialogs are created with DialogBlocks and wxFormBuilder.

I stepped with Eclipse and GBM through the process starting at launch under Linux(Ubuntu), and it never steps into a single Rocrail source line until the wxApp ctor which is never reached compiled and debugged under OS X 10.9.
It only steps before main() through many wx globals…

@wxtrac
Copy link
Collaborator Author

wxtrac commented Oct 31, 2013

2013-10-31 18:59:58: @vadz commented


There is obviously something in your code that triggers the bug as otherwise it would happen in the minimal sample too. If it's not a global variable, it may be something related to how you link, e.g. perhaps wx code gets linked twice, somehow. But there definitely is something specific to your program, that much seems clear. And even if it's not a bug per se, we still can't do anything about the real problem until we have some way of reproducing it not involving tons of code that we know nothing about.

@wxtrac
Copy link
Collaborator Author

wxtrac commented Nov 16, 2013

2013-11-16 21:09:28: rocrail (Rob Versluis) changed title from wxLog::IsLevelEnabled triggers crash under OS X 10.9 to crash under OS X 10.9 when using the 10.9 Xcode build environment of Mavericks

@wxtrac
Copy link
Collaborator Author

wxtrac commented Nov 16, 2013

2013-11-16 21:42:52: rocrail (Rob Versluis) commented


When I compile Minimal with following lines:

c++ -c `wx-config --cflags` minimal.cpp
c++ `wx-config --libs` minimal.o -o minimal

It crashes:

minimal(25891,0x7fff7df45310) malloc: *** error for object 0x40000000400: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

Backtrace:

Process 25913 launched: './minimal' (x86_64)
minimal(25913,0x7fff7df45310) malloc: *** error for object 0x40000000400: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Process 25913 stopped
* thread #1: tid # 0x1471f, 0x00007fff94b4a866 libsystem_kernel.dylib`__pthread_kill + 10, queue'com.apple.main-thread, stop reason = signal SIGABRT
    frame #0: 0x00007fff94b4a866 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill + 10:
-> 0x7fff94b4a866:  jae    0x7fff94b4a870            ; __pthread_kill + 20
   0x7fff94b4a868:  movq   %rax, %rdi
   0x7fff94b4a86b:  jmpq   0x7fff94b47175            ; cerror_nocancel
   0x7fff94b4a870:  ret    
(lldb) bt
* thread #1: tid # 0x1471f, 0x00007fff94b4a866 libsystem_kernel.dylib`__pthread_kill + 10, queue'com.apple.main-thread, stop reason = signal SIGABRT
    frame #0: 0x00007fff94b4a866 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff97b4035c libsystem_pthread.dylib`pthread_kill + 92
    frame #2: 0x00007fff8d642bba libsystem_c.dylib`abort + 125
    frame #3: 0x00007fff910b6093 libsystem_malloc.dylib`free + 411
    frame #4: 0x0000000100005b28 minimal`wxString::ConvertedBuffer<char>::~ConvertedBuffer() + 24
    frame #5: 0x0000000100005b05 minimal`wxString::ConvertedBuffer<char>::~ConvertedBuffer() + 21
    frame #6: 0x0000000100005a9f minimal`wxString::~wxString() + 31
    frame #7: 0x00000001000027a5 minimal`wxString::~wxString() + 21
    frame #8: 0x00000001000e0865 libwx_osx_cocoau-3.0.dylib`wxClassInfo::Register(this=0x00000001010bd908) + 661 at object.cpp:275
    frame #9: 0x000000010002bc64 libwx_osx_cocoau-3.0.dylib`wxClassInfo::wxClassInfo(this=0x00000001010bd908, className=0x0000000100c56930, baseInfo1=0x00000001010c0630, baseInfo2=0x0000000000000000, size=80, ctor=0x0000000100026560)()) + 100 at rtti.h:59
    frame #10: 0x0000000100027bbd libwx_osx_cocoau-3.0.dylib`wxClassInfo::wxClassInfo(this=0x00000001010bd908, className=0x0000000100c56930, baseInfo1=0x00000001010c0630, baseInfo2=0x0000000000000000, size=80, ctor=0x0000000100026560)()) + 61 at rtti.h:60
    frame #11: 0x000000010002d539 libwx_osx_cocoau-3.0.dylib`__cxx_global_var_init2 + 57 at any.cpp:230
    frame #12: 0x000000010002db53 libwx_osx_cocoau-3.0.dylib`_GLOBAL__I_a + 19 at any.cpp:291
    frame #13: 0x00007fff5fc11c2e dyld`ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 268
    frame #14: 0x00007fff5fc11dba dyld`ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
    frame #15: 0x00007fff5fc0ea62 dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 308
    frame #16: 0x00007fff5fc0e9eb dyld`ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&) + 189
    frame #17: 0x00007fff5fc0e8f6 dyld`ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) + 54
    frame #18: 0x00007fff5fc021da dyld`dyld::initializeMainExecutable() + 189
    frame #19: 0x00007fff5fc05560 dyld`dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) + 2419
    frame #20: 0x00007fff5fc0127b dyld`dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*, unsigned long*) + 477
    frame #21: 0x00007fff5fc0105e dyld`_dyld_start + 54

@wxtrac
Copy link
Collaborator Author

wxtrac commented Nov 16, 2013

2013-11-16 21:49:03: @csomor commented


you should also use the cxx from wx-config, see #15618

@wxtrac
Copy link
Collaborator Author

wxtrac commented Nov 16, 2013

2013-11-16 21:51:08: rocrail (Rob Versluis) commented


Why?

I seen no diffs:

robs-air:minimal rob$ wx-config --cflags
-I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__ 
robs-air:minimal rob$ wx-config --cxxflags
-I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__ 

@wxtrac
Copy link
Collaborator Author

wxtrac commented Nov 17, 2013

2013-11-17 08:27:25: rocrail (Rob Versluis) changed status from new to closed

2013-11-17 08:27:25: rocrail (Rob Versluis) changed resolution from ** to fixed

2013-11-17 08:27:25: rocrail (Rob Versluis) commented

OK, tnx!
This was the right tip.

Using:

`wx-config --cxx --cflags` -c minimal.cpp
`wx-config --cxx --libs` minimal.o -o minimal

Solved the issue with minimal and also for Rocrail.

@wxtrac wxtrac closed this as completed Nov 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macOS Specific to Cocoa macOS port v3.0.0
Projects
None yet
Development

No branches or pull requests

1 participant