Mex error: "queue = 'com.apple.main-thread', stop reason = signal SIGUSR1 " Or "Unexpected Standard exception from MEX file. What() is:vector"

I am currently debugging mex files in Mac using lldb (following structions given by https://se.mathworks.com/help/matlab/matlab_external/debugging-on-mac-platforms.html#btyq9a5) and encountered the two major errors as mentioned in the title.
The mex file was compiled without error messages using command "mex -g -output zernikeMoments main.cpp" and I ran the code as zernikeMoments(bim,int32(20)) and if everything works fine, the output should be printed directly to the screen.
For the first SIGUSR1 error, the full error message I got after typing 'bt' to lldb is as following:
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGUSR1
* frame #0: 0x00007fff6869020a libsystem_kernel.dylib`mach_msg_trap + 10
frame #1: 0x00007fff6868f724 libsystem_kernel.dylib`mach_msg + 60
frame #2: 0x00007fff40618665 CoreFoundation`__CFRunLoopServiceMachPort + 341
frame #3: 0x00007fff406179b7 CoreFoundation`__CFRunLoopRun + 1783
frame #4: 0x00007fff40617033 CoreFoundation`CFRunLoopRunSpecific + 483
frame #5: 0x00007fff3f901d96 HIToolbox`RunCurrentEventLoopInMode + 286
frame #6: 0x00007fff3f901b06 HIToolbox`ReceiveNextEventCommon + 613
frame #7: 0x00007fff3f901884 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64
frame #8: 0x00007fff3dbb1a73 AppKit`_DPSNextEvent + 2085
frame #9: 0x00007fff3e347e34 AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
frame #10: 0x00007fff3dba6885 AppKit`-[NSApplication run] + 764
frame #11: 0x000000010d727d6c libmwuix.dylib`___lldb_unnamed_symbol235$$libmwuix.dylib + 124
frame #12: 0x00007fff4062cdbc CoreFoundation`__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
frame #13: 0x00007fff4062cc8a CoreFoundation`_CFXRegistrationPost + 458
frame #14: 0x00007fff4062c9c1 CoreFoundation`___CFXNotificationPost_block_invoke + 225
frame #15: 0x00007fff405ea7a0 CoreFoundation`-[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1664
frame #16: 0x00007fff405e98d7 CoreFoundation`_CFXNotificationPost + 599
frame #17: 0x00007fff426fa817 Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 66
frame #18: 0x00007fff3dce4206 AppKit`-[NSApplication _postDidFinishNotification] + 313
frame #19: 0x00007fff3dce3e4f AppKit`-[NSApplication _sendFinishLaunchingNotification] + 220
frame #20: 0x00007fff3dbb6ab3 AppKit`-[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] + 562
frame #21: 0x00007fff3dbb66e9 AppKit`-[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 690
frame #22: 0x00007fff4273d664 Foundation`-[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 287
frame #23: 0x00007fff4273d4e2 Foundation`_NSAppleEventManagerGenericHandler + 102
frame #24: 0x00007fff41715dd0 AE`aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*) + 1788
frame #25: 0x00007fff41715677 AE`dispatchEventAndSendReply(AEDesc const*, AEDesc*) + 41
frame #26: 0x00007fff41715565 AE`aeProcessAppleEvent + 383
frame #27: 0x00007fff3f9114a0 HIToolbox`AEProcessAppleEvent + 55
frame #28: 0x00007fff3dbb1d32 AppKit`_DPSNextEvent + 2788
frame #29: 0x00007fff3e347e34 AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
frame #30: 0x00007fff3dba6885 AppKit`-[NSApplication run] + 764
frame #31: 0x00007fff3db75a72 AppKit`NSApplicationMain + 804
frame #32: 0x000000010d72830c libmwuix.dylib`MacRunApplicationMain(bool) + 76
frame #33: 0x00000001053f8044 libmwmcr.dylib`mcr::runtime::uix_proxy::MacRunApplicationMain(bool) + 36
frame #34: 0x00000001053b5109 libmwmcr.dylib`mcr::runtime::MainThread::runMain(boost::function0<int> const&, bool, bool) + 281
frame #35: 0x00000001053b4daf libmwmcr.dylib`mcr_run_main(boost::function0<int> const&, bool, bool) + 95
frame #36: 0x0000000104582135 libmwMVMLocal.dylib`mvm::detail::SessionImpl::localRunMain(mvm::detail::SessionImpl*, boost::function1<int, std::__1::vector<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> >, std::__1::allocator<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> > > > const&> const&, std::__1::vector<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> >, std::__1::allocator<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> > > > const&) + 821
frame #37: 0x000000010024ba5f libmwmvm.dylib`mvm::detail::SessionImpl::runMain(boost::function1<int, std::__1::vector<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> >, std::__1::allocator<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> > > > const&> const&, std::__1::vector<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> >, std::__1::allocator<std::__1::basic_string<char16_t, std::__1::char_traits<char16_t>, std::__1::allocator<char16_t> > > > const&) + 95
frame #38: 0x000000010024c037 libmwmvm.dylib`mvm::detail::SessionImpl::runMatlabDesktop() + 503
frame #39: 0x0000000100000f3d MATLAB_maci64`main + 653
frame #40: 0x00007fff68549015 libdyld.dylib`start + 1
For the second error, I can't get extra information other than the error message given in the title as:
Unexpected Standard exception from MEX file.
What() is:vector
..
All sources codes are attached in a zip file.
Any hints about how to debug are appreciated! Thanks in advance!

Answers (0)

Categories

Find more on Automotive in Help Center and File Exchange

Products

Release

R2017b

Asked:

on 31 Jan 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!