Getting crashes when a Max external runs in M4L

Questions and discussion about building and using Max for Live devices
Post Reply
doom_Oo7
Posts: 123
Joined: Thu Jan 05, 2012 8:47 am

Getting crashes when a Max external runs in M4L

Post by doom_Oo7 » Tue Oct 17, 2017 6:02 am

Hello,

I'm getting the following crash with my external in M4L. The external works fine in "pure" Max (and in other environments, PureData, Python, etc...).
It's a binding to an OSC C++ library with automatic discovery of OSC parameters (https://github.com/OSSIA/libossia).

The crash happens in some Boost.Asio code:

Code: Select all

Time Awake Since Boot: 6800 seconds

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x000000004c415247

VM Regions Near 0x4c415247:
--> 
    __TEXT                 0000000100000000-000000010363c000 [ 54.2M] r-x/rwx SM=COW  /Applications/Ableton Live 9 Suite.app/Contents/MacOS/Live

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libossia-max.dylib            	0x0000000125c66d1d asio::detail::scheduler::post_immediate_completion(asio::detail::scheduler_operation*, bool) + 157
1   libossia-max.dylib            	0x0000000125c6942c asio::detail::kqueue_reactor::start_op(int, int, asio::detail::kqueue_reactor::descriptor_state*&, asio::detail::reactor_op*, bool, bool) + 988
2   libossia-max.dylib            	0x0000000125c3d6c9 asio::detail::reactive_socket_service_base::start_accept_op(asio::detail::reactive_socket_service_base::base_implementation_type&, asio::detail::reactor_op*, bool, bool) + 217
3   libossia-max.dylib            	0x0000000125c3d587 void asio::detail::reactive_socket_service<asio::ip::tcp>::async_accept<asio::basic_socket<asio::ip::tcp>, asio::detail::wrapped_handler<asio::io_context::strand, std::__1::__bind<void (websocketpp::transport::asio::endpoint<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&)>, std::__1::error_code const&), websocketpp::transport::asio::endpoint<websocketpp::config::asio::transport_config>*, std::__1::function<void (std::__1::error_code const&)>&, std::__1::placeholders::__ph<1> const&>, asio::detail::is_continuation_if_running> >(asio::detail::reactive_socket_service<asio::ip::tcp>::implementation_type&, asio::basic_socket<asio::ip::tcp>&, asio::ip::basic_endpoint<asio::ip::tcp>*, asio::detail::wrapped_handler<asio::io_context::strand, std::__1::__bind<void (websocketpp::transport::asio::endpoint<websocketpp::config::asio::transport_config>::*)(std::__1::function<void (std::__1::error_code const&)>, std::__1::error_code const&), websocketpp::transport::asio::endpoint<websocketpp::config::asio::transport_config>*, std::__1::function<void (std::__1::error_code const&)>&, std::__1::placeholders::__ph<1> const&>, asio::detail::is_continuation_if_running>&) + 423
4   libossia-max.dylib            	0x0000000125c2e88f websocketpp::transport::asio::endpoint<websocketpp::config::asio::transport_config>::async_accept(std::__1::shared_ptr<websocketpp::transport::asio::connection<websocketpp::config::asio::transport_config> >, std::__1::function<void (std::__1::error_code const&)>, std::__1::error_code&) + 479
5   libossia-max.dylib            	0x0000000125c2e5c0 websocketpp::server<websocketpp::config::asio>::start_accept(std::__1::error_code&) + 320
6   libossia-max.dylib            	0x0000000125c2daea websocketpp::server<websocketpp::config::asio>::start_accept() + 42
7   libossia-max.dylib            	0x0000000125c2933c ossia::oscquery::oscquery_server_protocol::oscquery_server_protocol(unsigned short, unsigned short) + 1164
8   libossia-max.dylib            	0x0000000125adaa05 ossia::max::device::expose(ossia::max::device*, symbol*, long, atom*) + 661
9   com.cycling74.MaxPlugLib      	0x000000012374c0d5 typedmess_fun + 97
10  com.cycling74.MaxPlugLib      	0x00000001236b8ea2 outlet_anything + 820
11  com.cycling74.MaxPlugLib      	0x000000012374c0d5 typedmess_fun + 97
12  com.cycling74.MaxPlugLib      	0x000000012374d342 aeval + 1052
13  com.cycling74.MaxPlugLib      	0x000000012369363d atombuf_eval + 116
14  com.cycling74.message         	0x0000000104cb4347 jmessage_atombuf_eval + 315
15  com.cycling74.message         	0x0000000104cb499b jmessage_dobang + 88
16  com.cycling74.message         	0x0000000104cb4a3f jmessage_mousedown + 155
17  com.cycling74.MaxPlugLib      	0x00000001237570a0 BoxComponent::sendMouseMessage(juce::MouseEvent const&, symbol*) + 162
18  com.cycling74.MaxPlugLib      	0x000000012375ae21 BoxComponent::mouseDown(juce::MouseEvent const&) + 913
19  com.cycling74.MaxPlugLib      	0x00000001239aead3 juce::Component::internalMouseDown(juce::MouseInputSource&, juce::Point<int> const&, juce::Time const&) + 553
20  com.cycling74.MaxPlugLib      	0x0000000123a069a5 juce::MouseInputSourceInternal::sendMouseDown(juce::Component*, juce::Point<int> const&, long long) + 71
21  com.cycling74.MaxPlugLib      	0x0000000123a06f71 juce::MouseInputSourceInternal::setButtons(juce::Point<int> const&, long long, juce::ModifierKeys const&) + 313
22  com.cycling74.MaxPlugLib      	0x0000000123a07087 juce::MouseInputSourceInternal::handleEvent(juce::ComponentPeer*, juce::Point<int> const&, long long, juce::ModifierKeys const&) + 139
23  com.cycling74.MaxPlugLib      	0x0000000123a062d2 juce::MouseInputSource::handleEvent(juce::ComponentPeer*, juce::Point<int> const&, long long, juce::ModifierKeys const&) + 68
24  com.cycling74.MaxPlugLib      	0x0000000123a0e3d0 juce::ComponentPeer::handleMouseEvent(int, juce::Point<int> const&, juce::ModifierKeys const&, long long) + 104
25  com.cycling74.MaxPlugLib      	0x0000000123aae05f juce::NSViewComponentPeer::sendMouseEvent(NSEvent*) + 85
26  com.cycling74.MaxPlugLib      	0x0000000123aae2fb juce::NSViewComponentPeer::redirectMouseDown(NSEvent*) + 121
27  com.apple.Foundation          	0x00007fff9057cda0 __NSThreadPerformPerform + 293
28  com.apple.CoreFoundation      	0x00007fff88b93821 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
29  com.apple.CoreFoundation      	0x00007fff88b859ad __CFRunLoopDoSources0 + 269
30  com.apple.CoreFoundation      	0x00007fff88b84fdf __CFRunLoopRun + 927
31  com.apple.CoreFoundation      	0x00007fff88b849f8 CFRunLoopRunSpecific + 296
32  com.apple.HIToolbox           	0x00007fff9021656f RunCurrentEventLoopInMode + 235
33  com.apple.HIToolbox           	0x00007fff902161ee ReceiveNextEventCommon + 179
34  com.apple.HIToolbox           	0x00007fff9021612b _BlockUntilNextEventMatchingListInModeWithFilter + 71
35  com.apple.AppKit              	0x00007fff9096e8ab _DPSNextEvent + 978
36  com.apple.AppKit              	0x00007fff9096de58 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
37  com.apple.AppKit              	0x00007fff90963af3 -[NSApplication run] + 594
38  com.ableton.live              	0x0000000100bd438b 0x100000000 + 12403595
39  com.ableton.live              	0x00000001002bb709 0x100000000 + 2864905
40  com.ableton.live              	0x0000000100001934 0x100000000 + 6452
The crash happens when I try to open a websocket server from the external. Does someone knows if this is in some way restricted by M4L ?

Thanks!
Ossia Score, an OSC sequencer for intermedia arts - http://www.ossia.io

RadioOnMars
Posts: 36
Joined: Tue Oct 13, 2015 9:06 am

Re: Getting crashes when a Max external runs in M4L

Post by RadioOnMars » Mon Oct 23, 2017 2:00 pm

what's the external? can you share it?

post_immediate_completion is the last call
https://github.com/chriskohlhoff/asio/b ... eduler.ipp

doom_Oo7
Posts: 123
Joined: Thu Jan 05, 2012 8:47 am

Re: Getting crashes when a Max external runs in M4L

Post by doom_Oo7 » Wed Oct 25, 2017 1:50 pm

RadioOnMars wrote:what's the external? can you share it?
Yes, it's open-source : https://github.com/OSSIA/libossia

It can be downloaded here : https://github.com/OSSIA/libossia/releases (I can build you a debug version if you want to give an eye)

the report we have is here; apparently it works on windows, just not on mac.
https://github.com/OSSIA/libossia/issues/271
Ossia Score, an OSC sequencer for intermedia arts - http://www.ossia.io

doom_Oo7
Posts: 123
Joined: Thu Jan 05, 2012 8:47 am

Re: Getting crashes when a Max external runs in M4L

Post by doom_Oo7 » Wed Sep 05, 2018 10:58 am

Bump, this is still happenning and I don't know what to do :(
Ossia Score, an OSC sequencer for intermedia arts - http://www.ossia.io

Post Reply