monome / serialosc

multi-device, bonjour-capable monome OSC server
http://monome.org/docs/serialosc/osc
Other
145 stars 31 forks source link

40h is crashing serialosc #27

Closed rknLA closed 3 years ago

rknLA commented 7 years ago

tl;dr - It looks like there's a crash in handle_device_msg

Background

Ran into an issue last night when plugging in my 40h for the first time in years where serialosc.maxpat was behaving erratically after plugging in the 40h. Running ps aux | grep serialosc showed that the 128 was discovered and connected correctly, but there was no process for the 40h.

After restarting the computer (this morning), I plugged my USB hub in, and which caught the 128 correctly, then crashed, and finally found the 40h on relaunch:

rkn11a:~() $ ps aux | grep serialosc                                                         07.01.2017 [13:23:56]
kevin             361   0.0  0.0  2461544   1124   ??  U     1:23PM   0:00.00 /usr/local/bin/serialosc-detector
kevin             348   0.0  0.0  2462764    920   ??  S     1:23PM   0:00.01 /usr/local/bin/serialoscd
kevin             737   0.0  0.0  2443032    704 s000  R+    1:24PM   0:00.00 grep serialosc
rkn11a:~() $ ps aux | grep serialosc                                                         07.01.2017 [13:24:03]
kevin             361   0.0  0.0  2461544   1124   ??  U     1:23PM   0:00.00 /usr/local/bin/serialosc-detector
kevin             348   0.0  0.0  2462764    936   ??  S     1:23PM   0:00.01 /usr/local/bin/serialoscd
kevin             748   0.0  0.0  2434840    688 s000  R+    1:24PM   0:00.00 grep serialosc
kevin             744   0.0  0.0  2446272    928   ??  S     1:24PM   0:00.01 /usr/local/bin/serialosc-devic  /dev/tty.usbserial-m128-361
rkn11a:~() $ ps aux | grep serialosc                                                         07.01.2017 [13:24:05]
kevin             768   0.0  0.0  2434840    676 s000  R+    1:24PM   0:00.00 grep serialosc
rkn11a:~() $ ps aux | grep serialosc                                                         07.01.2017 [13:24:10]
kevin             851   0.0  0.0  2433816    596 s000  R+    1:24PM   0:00.00 grep serialosc
rkn11a:~() $ ps aux | grep serialosc                                                         07.01.2017 [13:24:11]
kevin             919   0.0  0.0  2453272    824 s000  S+    1:24PM   0:00.00 grep serialosc
kevin             892   0.0  0.0  2453440    916   ??  S     1:24PM   0:00.00 /usr/local/bin/serialosc-devic  /dev/tty.usbserial-m128-361
kevin             891   0.0  0.0  2445248    912   ??  S     1:24PM   0:00.00 /usr/local/bin/serialosc-devic  /dev/tty.usbserial-m40h0093
kevin             888   0.0  0.0  2453352   1128   ??  S     1:24PM   0:00.00 /usr/local/bin/serialosc-detector
kevin             887   0.0  0.0  2462764    932   ??  S     1:24PM   0:00.01 /usr/local/bin/serialoscd

Crash report

There were actually two crash reports in console, but they both show the same trace, at handle_device_msg + 20, so I've only included one of them here

Process:               serialoscd [348]
Path:                  /usr/local/bin/serialoscd
Identifier:            serialoscd
Version:               ???
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           serialoscd [348]
User ID:               501

Date/Time:             2017-01-07 13:24:05.744 +0100
OS Version:            Mac OS X 10.11.6 (15G1212)
Report Version:        11
Anonymous UUID:        9049C7CE-FDE5-9AA1-7680-322AF23C7FFE

Time Awake Since Boot: 63 seconds

System Integrity Protection: enabled

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

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

VM Regions Near 0:
--> 
    __TEXT                 0000000100000000-000000010002d000 [  180K] r-x/rwx SM=COW  /usr/local/bin/serialoscd

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   serialoscd                      0x0000000100003054 handle_device_msg + 20
1   serialoscd                      0x00000001000029fe dispatch_ipc_msgs + 142
2   serialoscd                      0x0000000100002c4a device_read_cb + 74
3   serialoscd                      0x000000010001a92b uv__read + 1659 (stream.c:1146)
4   serialoscd                      0x000000010001638c uv__stream_io + 380 (stream.c:1208)
5   serialoscd                      0x000000010002461e uv__io_poll + 3566 (kqueue.c:248)
6   serialoscd                      0x000000010000a651 uv_run + 225 (core.c:325)
7   serialoscd                      0x000000010000175f main + 447
8   serialoscd                      0x0000000100001574 start + 52

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000100003040  rbx: 0x0000000000000000  rcx: 0xffffffffffffffff  rdx: 0x0000000000000000
  rdi: 0x00007fff5fbff848  rsi: 0x00000001004004b0  rbp: 0x00007fff5fbf73b0  rsp: 0x00007fff5fbf7370
   r8: 0x0033393030683034   r9: 0x0000000000000000  r10: 0x0000000000000004  r11: 0xfffffffffe5fe972
  r12: 0x0000000000000000  r13: 0x0000000000000000  r14: 0x0000000000000000  r15: 0x0000000000000000
  rip: 0x0000000100003054  rfl: 0x0000000000010202  cr2: 0x0000000000000000

Logical CPU:     0
Error Code:      0x00000004
Trap Number:     14

Binary Images:
       0x100000000 -        0x10002cfff +serialoscd (???) <C86F3114-D5E5-3A87-A9BD-488177956BA3> /usr/local/bin/serialoscd
       0x10003e000 -        0x100047fff +liblo.7.dylib (0) <3ABDDF73-A82C-31C1-8588-5D182F342A9D> /usr/local/opt/liblo/lib/liblo.7.dylib
    0x7fff6a817000 -     0x7fff6a84ea47  dyld (360.22) <884763FC-CC0F-31CC-ACC4-75A805CE401D> /usr/lib/dyld
    0x7fff891b0000 -     0x7fff891b2ff7  libsystem_configuration.dylib (802.40.13) <3DEB7DF9-6804-37E1-BC83-0166882FF0FF> /usr/lib/system/libsystem_configuration.dylib
    0x7fff89986000 -     0x7fff899a2ff7  libsystem_malloc.dylib (67.40.1) <5748E8B2-F81C-34C6-8B13-456213127678> /usr/lib/system/libsystem_malloc.dylib
    0x7fff8a980000 -     0x7fff8a989ff7  libsystem_pthread.dylib (138.10.4) <3DD1EF4C-1D1B-3ABF-8CC6-B3B1CEEE9559> /usr/lib/system/libsystem_pthread.dylib
    0x7fff8a9b3000 -     0x7fff8a9b4ffb  libSystem.B.dylib (1226.10.1) <012548CD-614D-3AF0-B3B1-676F427D2CD6> /usr/lib/libSystem.B.dylib
    0x7fff8adc1000 -     0x7fff8b123f3f  libobjc.A.dylib (680) <7489D2D6-1EFD-3414-B18D-2AECCCC90286> /usr/lib/libobjc.A.dylib
    0x7fff8b185000 -     0x7fff8b18cff7  libcompiler_rt.dylib (62) <A13ECF69-F59F-38AE-8609-7B731450FBCD> /usr/lib/system/libcompiler_rt.dylib
    0x7fff8b18d000 -     0x7fff8b18efff  libsystem_blocks.dylib (65) <1244D9D5-F6AA-35BB-B307-86851C24B8E5> /usr/lib/system/libsystem_blocks.dylib
    0x7fff8bc74000 -     0x7fff8bc78fff  libcache.dylib (75) <9548AAE9-2AB7-3525-9ECE-A2A7C4688447> /usr/lib/system/libcache.dylib
    0x7fff8c0c3000 -     0x7fff8c0f0fff  libdispatch.dylib (501.40.12) <C7499857-61A5-3D7D-A5EA-65DCC8C3DF92> /usr/lib/system/libdispatch.dylib
    0x7fff8ca1a000 -     0x7fff8ca1cff7  libquarantine.dylib (80) <0F4169F0-0C84-3A25-B3AE-E47B3586D908> /usr/lib/system/libquarantine.dylib
    0x7fff8cb11000 -     0x7fff8cb3aff7  libxpc.dylib (765.50.8) <54D1328E-054E-3DAA-89E2-375722F9D18F> /usr/lib/system/libxpc.dylib
    0x7fff8cb53000 -     0x7fff8cba6ff7  libc++.1.dylib (120.1) <8FC3D139-8055-3498-9AC5-6467CB7F4D14> /usr/lib/libc++.1.dylib
    0x7fff8d104000 -     0x7fff8d106fff  libsystem_coreservices.dylib (19.2) <1B3F5AFC-FFCD-3ECB-8B9A-5538366FB20D> /usr/lib/system/libsystem_coreservices.dylib
    0x7fff8dbce000 -     0x7fff8dbd6ffb  libsystem_dnssd.dylib (625.60.4) <80189998-32B0-316C-B5C5-53857486713D> /usr/lib/system/libsystem_dnssd.dylib
    0x7fff8dbd8000 -     0x7fff8dbe9ff7  libsystem_trace.dylib (201.10.3) <E9311C03-9E61-3B13-AF3F-A64956FFF269> /usr/lib/system/libsystem_trace.dylib
    0x7fff8ee52000 -     0x7fff8ee5afff  libcopyfile.dylib (127) <A48637BC-F3F2-34F2-BB68-4C65FD012832> /usr/lib/system/libcopyfile.dylib
    0x7fff8ee5b000 -     0x7fff8ee72ff7  libsystem_asl.dylib (323.50.1) <41F8E11F-1BD0-3F1D-BA3A-AA1577ED98A9> /usr/lib/system/libsystem_asl.dylib
    0x7fff9004d000 -     0x7fff90058ff7  libcommonCrypto.dylib (60075.50.1) <93732261-34B4-3914-B7A2-90A81A182DBA> /usr/lib/system/libcommonCrypto.dylib
    0x7fff9015b000 -     0x7fff901a1ff7  libauto.dylib (186) <999E610F-41FC-32A3-ADCA-5EC049B65DFB> /usr/lib/libauto.dylib
    0x7fff9318d000 -     0x7fff93196ff3  libsystem_notify.dylib (150.40.1) <D48BDE34-0F7E-34CA-A0FF-C578E39987CC> /usr/lib/system/libsystem_notify.dylib
    0x7fff9363d000 -     0x7fff9363efff  libsystem_secinit.dylib (20) <32B1A8C6-DC84-3F4F-B8CE-9A52B47C3E6B> /usr/lib/system/libsystem_secinit.dylib
    0x7fff93956000 -     0x7fff93985ffb  libsystem_m.dylib (3105) <08E1A4B2-6448-3DFE-A58C-ACC7335BE7E4> /usr/lib/system/libsystem_m.dylib
    0x7fff957dd000 -     0x7fff957ddff7  liblaunch.dylib (765.50.8) <834ED605-5114-3641-AA4D-ECF31B801C50> /usr/lib/system/liblaunch.dylib
    0x7fff957de000 -     0x7fff957f5ff7  libsystem_coretls.dylib (83.40.5) <C90DAE38-4082-381C-A185-2A6A8B677628> /usr/lib/system/libsystem_coretls.dylib
    0x7fff95b84000 -     0x7fff95beaff7  libsystem_network.dylib (583.50.1) <B52DAB73-92DC-3DA7-B9F4-B899D66445C1> /usr/lib/system/libsystem_network.dylib
    0x7fff962a4000 -     0x7fff962a9ff7  libmacho.dylib (875.1) <318264FA-58F1-39D8-8285-1F6254EE410E> /usr/lib/system/libmacho.dylib
    0x7fff962b3000 -     0x7fff962ddff7  libc++abi.dylib (307.2) <922EFB36-0E9E-315B-8270-E81AC43472C0> /usr/lib/libc++abi.dylib
    0x7fff978a2000 -     0x7fff978a5ffb  libdyld.dylib (360.22) <F103B2FB-D383-38CB-992A-E16BDCB00A03> /usr/lib/system/libdyld.dylib
    0x7fff97fd0000 -     0x7fff97fd5ff3  libunwind.dylib (35.3) <F6EB48E5-4D12-359A-AB54-C937FBBE9043> /usr/lib/system/libunwind.dylib
    0x7fff98c80000 -     0x7fff98c88fff  libsystem_networkextension.dylib (385.40.36) <66095DC7-6539-38F2-95EE-458F15F6D014> /usr/lib/system/libsystem_networkextension.dylib
    0x7fff98e5e000 -     0x7fff98e87fff  libsystem_info.dylib (477.50.4) <FAA9226D-64DE-3769-A6D8-6CABA4B7FF4D> /usr/lib/system/libsystem_info.dylib
    0x7fff98f56000 -     0x7fff98fcdfeb  libcorecrypto.dylib (335.50.1) <B5C05FD7-A540-345A-87BF-8E41848A3C17> /usr/lib/system/libcorecrypto.dylib
    0x7fff9981d000 -     0x7fff9981efff  libDiagnosticMessagesClient.dylib (100) <4243B6B4-21E9-355B-9C5A-95A216233B96> /usr/lib/libDiagnosticMessagesClient.dylib
    0x7fff998ab000 -     0x7fff998acffb  libremovefile.dylib (41) <552EF39E-14D7-363E-9059-4565AC2F894E> /usr/lib/system/libremovefile.dylib
    0x7fff9a538000 -     0x7fff9a53bfff  libsystem_sandbox.dylib (460.60.2) <2A68B39C-B786-3A05-87A2-56E688469FB8> /usr/lib/system/libsystem_sandbox.dylib
    0x7fff9a6ef000 -     0x7fff9a70dff7  libsystem_kernel.dylib (3248.60.11.1.2) <1CC38FFB-EB7B-340D-AC32-27580A15AC0A> /usr/lib/system/libsystem_kernel.dylib
    0x7fff9b460000 -     0x7fff9b460ff7  libkeymgr.dylib (28) <8371CE54-5FDD-3CE9-B3DF-E98C761B6FE0> /usr/lib/system/libkeymgr.dylib
    0x7fff9cb74000 -     0x7fff9cb74ff7  libunc.dylib (29) <DDB1E947-C775-33B8-B461-63E5EB698F0E> /usr/lib/system/libunc.dylib
    0x7fff9cbf7000 -     0x7fff9cc84fef  libsystem_c.dylib (1082.60.1) <28733D22-553E-3CBC-8D2C-EDCEB46E46AF> /usr/lib/system/libsystem_c.dylib
    0x7fff9d426000 -     0x7fff9d42efef  libsystem_platform.dylib (74.40.2) <29A905EF-6777-3C33-82B0-6C3A88C4BA15> /usr/lib/system/libsystem_platform.dylib

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 3
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 868
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=99.2M resident=0K(0%) swapped_out_or_unallocated=99.2M(100%)
Writable regions: Total=48.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=48.4M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Activity Tracing                  2048K        2 
Kernel Alloc Once                    4K        2 
MALLOC                            36.2M       12 
MALLOC guard page                   16K        4 
Process Corpse Info               2048K        2 
STACK GUARD                       56.0M        2 
Stack                             8192K        2 
VM_ALLOCATE                          4K        2 
__DATA                            1448K       43 
__LINKEDIT                        91.5M        5 
__TEXT                            7872K       44 
shared memory                       12K        4 
===========                     =======  ======= 
TOTAL                            204.8M      112 
artfwo commented 6 years ago

@rknLA I think I fixed a similar issue on Linux, see #22. Can you see if this is still reproducible with the current master? Thx!