ossia / libossia

A modern C++, cross-environment distributed object model for creative coding and interaction scoring
https://ossia.io
GNU Lesser General Public License v3.0
206 stars 33 forks source link

[ossia-max] crashes 8.1.2 on OSX 10.15.3 #546

Closed maybites closed 4 years ago

maybites commented 4 years ago

Hi when I follow these steps I can bring max to crash:

  1. open ossia.device.maxhelp
  2. press 'namespace'
  3. change to tab 'Network exposure'
  4. press 'expose'
  5. press 'expose query'
  6. press 'expose oscquery ..'

by now it usually crashes, if not, launch ossia from package manager.

Process: Max [94459] Path: /Applications/_Devel/Max_8.1.2.app/Contents/MacOS/Max Identifier: com.cycling74.Max Version: 8.1.2 [1bd89fe] (8.1.2) Code Type: X86-64 (Native) Parent Process: ??? [1] Responsible: Max [94459] User ID: 501

Date/Time: 2020-03-05 08:55:53.868 +0100 OS Version: Mac OS X 10.15.3 (19D76) Report Version: 12

System Integrity Protection: disabled

Crashed Thread: 49 ...

Thread 49 Crashed: 0 libsystem_kernel.dylib 0x00007fff7138d7fa pthread_kill + 10 1 libsystem_pthread.dylib 0x00007fff7144abc1 pthread_kill + 432 2 libsystem_c.dylib 0x00007fff71314a1c abort + 120 3 libc++abi.dylib 0x00007fff6e3aebe8 abort_message + 231 4 libc++abi.dylib 0x00007fff6e3aed84 demangling_terminate_handler() + 238 5 libobjc.A.dylib 0x00007fff6feda792 _objc_terminate() + 104 6 libc++abi.dylib 0x00007fff6e3bbdc7 std::terminate(void (*)()) + 8 7 libc++abi.dylib 0x00007fff6e3ae20f cxa_rethrow + 99 8 libossia-max.dylib 0x0000000155fd0b9f oscpack::posix::SocketReceiveMultiplexerImplementation::Run() + 2735 9 libossia-max.dylib 0x0000000155fd00e5 oscpack::detail::SocketReceiveMultiplexer::Run() + 21 10 libossia-max.dylib 0x0000000155fd00c9 oscpack::detail::UdpListeningReceiveSocket::Run() + 25 11 libossia-max.dylib 0x0000000155fd00a4 osc::receiver::run()::'lambda'()::operator()() const + 36 12 libossia-max.dylib 0x0000000155fd003d decltype(std::1::forward<osc::receiver::run()::'lambda'()>(fp)()) std::1::invoke<osc::receiver::run()::'lambda'()>(osc::receiver::run()::'lambda'()&&) + 29 13 libossia-max.dylib 0x0000000155fcffd5 void std::1::thread_execute<std::1::unique_ptr<std::1::thread_struct, std::1::default_delete >, osc::receiver::run()::'lambda'()>(std::1::tuple<std::1::unique_ptr<std::1::thread_struct, std::1::default_delete >, osc::receiver::run()::'lambda'()>&, std::1::tuple_indices<>) + 37 14 libossia-max.dylib 0x0000000155fcf8a6 void* std::1::thread_proxy<std::1::tuple<std::1::unique_ptr<std::1::thread_struct, std::1::default_delete >, osc::receiver::run()::'lambda'()> >(void*) + 118 15 libsystem_pthread.dylib 0x00007fff7144ae65 _pthread_start + 148 16 libsystem_pthread.dylib 0x00007fff7144683b thread_start + 15

Thread 49 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0x0000700011df6000 rcx: 0x0000700011df5528 rdx: 0x0000000000000000 rdi: 0x000000000001d83b rsi: 0x0000000000000006 rbp: 0x0000700011df5550 rsp: 0x0000700011df5528 r8: 0x0000700011df53f0 r9: 0x0000700011df55c0 r10: 0x0000700011df6000 r11: 0x0000000000000246 r12: 0x000000000001d83b r13: 0x0000003000000008 r14: 0x0000000000000006 r15: 0x0000000000000016 rip: 0x00007fff7138d7fa rfl: 0x0000000000000246 cr2: 0x00007fff9ab913c8

maybites commented 4 years ago

I was not very specific in my bug report: The crash is happening on max-ossia when compiled locally with the latest commits following these instructions:

https://github.com/OSSIA/libossia/wiki/Building#building-the-max-implementation-on-macos

for the time being I will stick to the official release, which seems to work fine.

jcelerier commented 4 years ago

from the looks of the stack trace, an invalid OSC message was received, an exception was thrown, and nothing was there to catch it. investigating...

maybites commented 4 years ago

for the record, no OSC message was sent. pressing the message 'expose oscquery ...' causes this crash.

maybites commented 4 years ago

And I just realized: when I compile

libossia-max.dylib

and replace it with the one that comes with the release, there is no crash.

maybites commented 4 years ago

I just compiled the max externals on Windows 10 and I don't see any issues. So it seems to be an issue isolated to OSX.

avilleret commented 4 years ago

I can't reproduce this crash.

Do you have by any chance another Max package that deals with OSC ? and which uses OSCPack ?

maybites commented 4 years ago

It looks as if your hunch is correct:

I removed all the packages and the crash is gone.

Then I put back the packages back, one by one, to see which one was causing it, but I wasn't able to identify one.

its working now fine. with one exception:

I made the test by opening the package launch patch. I tested its functionality (all ok), then closed it. (so far no problem). but when I close max it crashes.

not really a problem, but it looks as if libossia is involved, even though there is no patch open anymore before I close max.

I can repeat this now consistently.

Thread 0 Crashed:: CrBrowserMain 0 libsystem_kernel.dylib 0x00007fff6938896e os_fault_with_payload + 10 1 libsystem_kernel.dylib 0x00007fff69389451 darwin_check_fd_set_overflow.cold.2 + 31 2 libsystem_kernel.dylib 0x00007fff6937467c __darwin_check_fd_set_overflow + 68 3 libossia-max.dylib 0x000000015278bbf4 servus::dnssd::Servus::_handleEvents(_DNSServiceRef_t*, int) + 404 4 libossia-max.dylib 0x0000000152789d4a servus::dnssd::Servus::announce(unsigned short, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&) + 506 5 libossia-max.dylib 0x000000015278973f servus::Servus::announce(unsigned short, std::1::basic_string<char, std::1::char_traits, std::1::allocator > const&) + 63 6 libossia-max.dylib 0x00000001527894bd ossia::net::make_zeroconf_server(std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::basic_string<char, std::1::char_traits, std::1::allocator >, std::1::basic_string<char, std::1::char_traits, std::__1::allocator >, int, int) + 589 7 libossia-max.dylib 0x0000000152904bf4 ossia::oscquery::oscquery_server_protocol::update_zeroconf() + 148 8 libossia-max.dylib 0x0000000152904835 ossia::oscquery::oscquery_server_protocol::set_device(ossia::net::device_base&) + 373 9 libossia-max.dylib 0x00000001527867a7 ossia::net::multiplex_protocol::expose_to(std::1::unique_ptr<ossia::net::protocol_base, std::1::default_delete >) + 71 10 libossia-max.dylib 0x00000001522e8ed2 ossia::max::device::expose(ossia::max::device, symbol, long, atom*) + 1842 11 com.cycling74.Max 0x00000001041b7fe8 typedmess_fun + 216 12 com.cycling74.Max 0x000000010424c679 outlet_anything + 627 13 com.cycling74.Max 0x00000001041b7fe8 typedmess_fun + 216 14 com.cycling74.Max 0x00000001041b8c7b aeval + 1427 15 com.cycling74.Max 0x000000010418ac34 atombuf_eval + 132 16 com.cycling74.message 0x0000000108f0d863 jmessage_atombuf_eval + 316 17 com.cycling74.Max 0x000000010424b10f outlet_bang + 1068 18 com.cycling74.Max 0x0000000104240156 linklist_funall_imp + 111 19 com.cycling74.Max 0x0000000104386564 jpatcher_loadbang + 367 20 com.cycling74.Max 0x00000001042a18b2 object_method_imp + 339 21 com.cycling74.Max 0x00000001041ee6c7 jpatcher_doloadbang + 42 22 com.cycling74.Max 0x000000010439b7dd jpatcher_traverse_iterfun + 246 23 com.cycling74.Max 0x0000000104240156 linklist_funall_imp + 111 24 com.cycling74.Max 0x0000000104392011 jpatcher_traverse_flags + 97 25 com.cycling74.Max 0x00000001041ee6f4 loadbang_patcher + 37 26 com.cycling74.Max 0x000000010419ad3c lowload_postload + 72 27 com.cycling74.Max 0x000000010419ac03 lowload_type + 1417 28 com.cycling74.Max 0x000000010419c0ef fileload_extended + 170 29 com.cycling74.Max 0x000000010419c022 fileload + 79 30 com.cycling74.Max 0x00000001044effb4 packages_openhomepatcher_deferred + 308 31 com.cycling74.Max 0x00000001041da0f6 defer_exec + 80 32 com.cycling74.Max 0x00000001041ca80e sched_dequeue + 251 33 com.cycling74.Max 0x00000001044395e3 MainThreadEventHandler::invoke() + 123 34 libdispatch.dylib 0x00007fff691cc6c4 _dispatch_call_block_and_release + 12 35 libdispatch.dylib 0x00007fff691cd658 _dispatch_client_callout + 8 36 libdispatch.dylib 0x00007fff691d8cab _dispatch_main_queue_callback_4CF + 936 37 com.apple.CoreFoundation 0x00007fff2f31f041 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 38 com.apple.CoreFoundation 0x00007fff2f2dee47 CFRunLoopRun + 2028 39 com.apple.CoreFoundation 0x00007fff2f2ddffe CFRunLoopRunSpecific + 462 40 com.apple.HIToolbox 0x00007fff2df11abd RunCurrentEventLoopInMode + 292 41 com.apple.HIToolbox 0x00007fff2df117d5 ReceiveNextEventCommon + 584 42 com.apple.HIToolbox 0x00007fff2df11579 _BlockUntilNextEventMatchingListInModeWithFilter + 64 43 com.apple.AppKit 0x00007fff2c55cc99 _DPSNextEvent + 883 44 com.apple.AppKit 0x00007fff2c55b4e0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352 45 com.apple.AppKit 0x00007fff2c54d1ee -[NSApplication run] + 658 46 org.chromium.ContentShell.framework 0x0000000110bb86fc 0x10e17e000 + 44279548 47 org.chromium.ContentShell.framework 0x0000000110bb7152 0x10e17e000 + 44274002 48 org.chromium.ContentShell.framework 0x0000000110b64597 0x10e17e000 + 43935127 49 org.chromium.ContentShell.framework 0x0000000110b3aa87 0x10e17e000 + 43764359 50 org.chromium.ContentShell.framework 0x0000000110866a20 0x10e17e000 + 40798752 51 com.cycling74.Max 0x0000000104508a46 MaxCefEventLoopHandler::runMessageLoop() + 18 52 com.cycling74.Max 0x00000001048e2e86 juce::JUCEApplicationBase::main(int, char const**) + 246 53 libdyld.dylib 0x00007fff69226cc9 start + 1

jcelerier commented 4 years ago

if that's indeed the issue we can try putting oscpack into a separate namespace maybe

jcelerier commented 4 years ago

(or just make sure that the symbols are properly hidden)

maybites commented 4 years ago

I am still investigating. I might be able to track down that package...

jcelerier commented 4 years ago

thanks, that would be very useful. Any chance that this doesn't happen in Max but does in M4L ?

maybites commented 4 years ago

nope, just max. and its very elusive. I am pretty sure its a package, but I can't identify it (I have 30 that could be the culprit)

maybites commented 4 years ago

I can make the crash go away by removing all of them, but then suddenly its there again when I place them back.

jcelerier commented 4 years ago

we can try something - can you go into your Max packages folder and run

find . -name *.mxe -exec nm -A {} \; | grep -i osc

(or mxe64 or dylib)

maybites commented 4 years ago

I tried

find . -name *.mxo -exec nm -A {} \; | grep -i osc and find . -name *.dylib -exec nm -A {} \; | grep -i osc

but didn't find anything

maybites commented 4 years ago

just weird. now all the packages are back and no crash.. :-/

maybites commented 4 years ago

Ok, I found it. It is an external I wrote myself. But it has nothing to do with OSC (at least as far as I can remember). Anyway, its obsolete anyway but I add it here if you want to confirm:

HSoundPlane.zip

maybites commented 4 years ago

Ok, I still can reproduce the crash even with the removed package from my last post.

  1. pull https://github.com/tecartlab/SPARCK/tree/development
  2. the sparck folder is a package - on osx you can simply make a short cut to the package folder.
  3. open sparck/extras/SPARCK.maxpat

You probably will get a missing java error. most likely it will not affect this crash, but for completion:

  1. get https://github.com/tecartlab/max-mxj/releases and install as package (Not sure if you need it on OSX, but for sure on windows)
  2. install Java https://www.oracle.com/java/technologies/javase-jdk14-downloads.html

when sparck opens, it will change the max menu

  1. max > File > Max Menus
  2. open new patch window
  3. paste this patch

----------begin_max5_patcher---------- 1250.3oc0X0zaiaCD8r8uBAgdz0fjh5Ct25gdon8z1KEEKBjkXTXfjn.EUpC Vr+2KEIkichsLssTxlbvghhTy7l2LCmgee4B+M7szVeuu38udKV78kKVnmpe hE1mW3WktMqLsUuL+6K40cU9qLuRMj2IKoR8KQ1YMSIetgZ9x99q772jVW36 8M6RZRkYOvpKtSPyjlUghBWCV4EDG0+uPP+uHzZvt8vx0Z.eyi+JJYOMfUOn .vcecQZEURE2QqS2TpUCf8c2yEUoZQF0OwOVtr+mUNB+Z5+oj+fvkzs5uT+Z XUcUdf0WnkQYNUJix7vpkNYcvI8+KFOp0I5nVGzUf2McRIu93fBdJPcdpNPq +XnFE3geOJVvWNSeM7ZW0FpXNbqgwA83CB.N3Vide.6wchkdalZhFh0fGEiF f8oAO7DwzWA.mujTFW1fDGHSXvOW4njrpK1CeW5IWLJlTSAgiZTBmrTSyWHK AtmS6YHYzm7zSX.bcXe5WW7nAejomTth4Z3Lw4nBisf1XARFyBDMYonpnsso Ez2FkRakd+B7BAoSTbrFZ3QiOCHSW74wowt7lVZctGDEuVYwWC8RT+cb7BFG T8YafD8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w. -----------end_max5_patcher-----------

and press 'expose osc 127.0.0.1 9999 8888'

-> crash.

Max_Ossia_crash.txt

maybites commented 4 years ago

commit 39f9783fbe98ffed1747099e60079e84c9de4137 has fixed it.