Crash when trying to bring up export panel


#1

I have had an issue early on when developing my plugin using the C SDK where right when I selected File->Export->3D Model SketchUp would crash. I thought I had figured out that it was an issue when I was building the the OS X 10.10 SDK, but things worked fine with the 10.9 one. Now, however, I am getting the crash and I believe I am still linking against the 10.9 one. Has anyone seen this before? Here’s what the stack trace looks like:

> #0	0x00007fff8ccb5172 in strlen ()
> #1	0x00000001052ab4d8 in atlast::utils::atlast_ustring::assign_utf8(char const*) ()
> #2	0x00000001052ab832 in atlast::utils::atlast_ustring::operator=(char const*) ()
> #3	0x00000001003fb67c in ModelExporterWrapper::Initialize() ()
> #4	0x00000001003fb45e in MacModelExporter::Create(NSString*) ()
> #5	0x00000001003fb1cf in ExporterLoader::LoadExporters(bool) ()
> #6	0x00000001003faad6 in sketchup::ExportManager::LoadExporters() ()
> #7	0x00000001003faa98 in sketchup::ExportManager::ExportManager() ()
> #8	0x00000001003faa0a in sketchup::ExportManager::GetInstance() ()
> #9	0x0000000100054c66 in ___lldb_unnamed_function1518$$SketchUp ()
> #10	0x00007fff8c85dcd7 in _os_activity_initiate ()
> #11	0x00007fff90013497 in -[NSApplication sendAction:to:from:] ()
> #12	0x00007fff9002d5da in -[NSMenuItem _corePerformAction] ()
> #13	0x00007fff9002d2f7 in -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] ()
> #14	0x00007fff8c85dcd7 in _os_activity_initiate ()
> #15	0x00007fff9007ab96 in -[NSMenu performActionForItemAtIndex:] ()
> #16	0x00007fff9007ab06 in -[NSMenu _internalPerformActionForItemAtIndex:] ()
> #17	0x00007fff9007a952 in -[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] ()
> #18	0x00007fff90022eeb in NSSLMMenuEventHandler ()
> #19	0x00007fff8a40a32c in DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) ()
> #20	0x00007fff8a40976e in SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) ()
> #21	0x00007fff8a41e286 in SendEventToEventTarget ()
> #22	0x00007fff8a453795 in SendHICommandEvent(unsigned int, HICommand const*, unsigned int, unsigned int, unsigned char, void const*, OpaqueEventTargetRef*, OpaqueEventTargetRef*, OpaqueEventRef**) ()
> #23	0x00007fff8a486e8d in SendMenuCommandWithContextAndModifiers ()
> #24	0x00007fff8a486e34 in SendMenuItemSelectedEvent ()
> #25	0x00007fff8a486d06 in FinishMenuSelection(SelectionData*, MenuResult*, MenuResult*) ()
> #26	0x00007fff8a48e8b1 in MenuSelectCore(MenuData*, Point, double, unsigned int, OpaqueMenuRef**, unsigned short*) ()
> #27	0x00007fff8a48e49e in _HandleMenuSelection2 ()
> #28	0x00007fff8ffa8d1e in _NSHandleCarbonMenuEvent ()
> #29	0x00007fff8fe44a40 in _DPSNextEvent ()
> #30	0x00007fff8fe43e80 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
> #31	0x00007fff8fe37e23 in -[NSApplication run] ()
> #32	0x00007fff8fe232d4 in NSApplicationMain ()
> #33	0x00000001000028b4 in start ()

#2

Pinging @bugra and @Paul.


#3

This looks like it might be a mismatch in C++ standard libraries. SketchUp currently uses libstdc++ and exporter/importer plugins have to use the same. Are you using libc++ by any chance?


#4

Interesting. I just made sure to set that in my build settings (I had been using “Compiler default”) and it now works with 10.10 SDK. This is probably worth mentioning in BOLD somewhere in the Mac doc.

I have a feeling the compiler default changed from 10.9 SDK to 10.10, and that’s why I was getting bit.


#5

You are right, we should mention this in the docs. Honestly, I did not realize this could be a pitfall until I saw your question. I’m glad it works and thanks for the heads-up.