Troubleshooting crashes and hangs

Rodrigo's icon

I've been pulling my hair out trying to figure out why a performance patch I've been working on has been crashing and hanging.

The crash reports have been inconclusive (one attached), but what's really been killing me is the freezing/hanging.

I'll be using/testing the patch and all of the sudden the patch stops responding, and even though I still have audio throughput, Max will just hang in perpetuity.

I've tried waiting it out to see if it will properly crash and give me a report, but it just stays there for 10+ minutes, after which I force quit it. It seems like this doesn't produce a crash report, so I'm left scratching my head.

I've heard that "Instruments" (on Mac) is good for poking a little bit further, but I've never really set it up, and not sure what to trace, or what to make of it if I set it up correctly.

I opened it up, pointed it at Max, and selected "Activity Monitor" and "Leaks" and recorded a bit. I didn't get a crash as this was just a quick test.

Is this the right things to look at?
Is the general idea to setup Instruments to record, and then have the patch hang/freeze/crash/whatever, then stop recording and look at where it left off?

////////////////////////////////////////////////////////////////////////////////////////////////////////

Here is the crash report.

The offending thread (25) has a ton of cycling/juce in it, but not sure if it's directly the result of a bug/problem.

InstaCrash 2.zip
application/zip 36.07 KB

Thread 25 Crashed:
0 libsystem_kernel.dylib 0x00007fff6d16e2c6 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff6d229bf1 pthread_kill + 284
2 libsystem_c.dylib 0x00007fff6d0d8745 __abort + 144
3 libsystem_c.dylib 0x00007fff6d0d86b5 abort + 142
4 libsystem_malloc.dylib 0x00007fff6d1e716b malloc_vreport + 545
5 libsystem_malloc.dylib 0x00007fff6d1fff01 malloc_zone_error + 183
6 libsystem_malloc.dylib 0x00007fff6d1eba53 nanov2_realloc + 334
7 org.chromium.ContentShell.framework    0x00000001137d7364 0x110fa6000 + 42144612
8 org.chromium.ContentShell.framework    0x00000001137d7364 0x110fa6000 + 42144612
9 libsystem_malloc.dylib 0x00007fff6d1e3b42 malloc_zone_realloc + 111
10 libsystem_malloc.dylib 0x00007fff6d1e3a76 realloc + 253
11 com.cycling74.Max 0x000000010c1a0055 void juce::HeapBlock<juce::Rectangle, false>::realloc(unsigned long, unsigned long) + 29
12 com.cycling74.Max 0x000000010c1a001d juce::ArrayBase<juce::Rectangle, juce::DummyCriticalSection>::setAllocatedSize(int) + 37
13 com.cycling74.Max 0x000000010c201238 juce::ArrayBase<juce::Rectangle, juce::DummyCriticalSection>::createInsertSpace(int, int) + 56
14 com.cycling74.Max 0x000000010c73130a juce::RectangleList::subtract(juce::Rectangle) + 314
15 com.cycling74.Max 0x000000010c856697 juce::StandardCachedComponentImage::invalidate(juce::Rectangle const&) + 23
16 com.cycling74.Max 0x000000010c7a3441 juce::Component::internalRepaintUnchecked(juce::Rectangle, bool) + 81
17 com.cycling74.Max 0x000000010c7a34e8 juce::Component::internalRepaintUnchecked(juce::Rectangle, bool) + 248
18 com.cycling74.Max 0x000000010c7a34e8 juce::Component::internalRepaintUnchecked(juce::Rectangle, bool) + 248
19 com.cycling74.Max 0x000000010c7a34e8 juce::Component::internalRepaintUnchecked(juce::Rectangle, bool) + 248
20 com.cycling74.Max 0x000000010c7a34e8 juce::Component::internalRepaintUnchecked(juce::Rectangle, bool) + 248
21 com.cycling74.Max 0x000000010c7a34e8 juce::Component::internalRepaintUnchecked(juce::Rectangle, bool) + 248
22 com.cycling74.Max 0x000000010c7a34e8 juce::Component::internalRepaintUnchecked(juce::Rectangle, bool) + 248
23 com.cycling74.Max 0x000000010c7a34e8 juce::Component::internalRepaintUnchecked(juce::Rectangle, bool) + 248
24 com.cycling74.Max 0x000000010c7a34e8 juce::Component::internalRepaintUnchecked(juce::Rectangle, bool) + 248
25 com.cycling74.Max 0x000000010c073729 svgcolor_int(_svgcolor*, long) + 47
26 com.cycling74.Max 0x000000010c005592 typedmess_fun + 418
27 com.cycling74.Max 0x000000010c0ef85b object_method_typedfun + 133
28 max~ 0x000000011bac6bbd plugintoolbar_setbypass + 71
29 com.cycling74.Max 0x000000010c0f042c object_attr_setvalueof + 174
30 com.cycling74.Max 0x000000010c0054c8 typedmess_fun + 216
31 com.cycling74.Max 0x000000010c0977b9 outlet_anything + 627
32 com.cycling74.Max 0x000000010c0054c8 typedmess_fun + 216
33 com.cycling74.Max 0x000000010c0054c8 typedmess_fun + 216
34 com.cycling74.Max 0x000000010c0977b9 outlet_anything + 627
35 prepend 0x0000000122be3ab0 prepend_list + 234
36 prepend 0x0000000122be398e prepend_int + 48
37 com.cycling74.Max 0x000000010c0966f2 outlet_int + 891
38 toggle 0x000000011b5faf2e jtoggle_int + 25
39 com.cycling74.Max 0x000000010c096246 outlet_bang + 1068
40 com.cycling74.Max 0x000000010c0966f2 outlet_int + 891
41 toggle 0x000000011b5faf2e jtoggle_int + 25
42 com.cycling74.Max 0x000000010c096616 outlet_int + 671
43 com.cycling74.Max 0x000000010c067321 route_anything + 302
44 com.cycling74.Max 0x000000010c0054c8 typedmess_fun + 216
45 com.cycling74.Max 0x000000010c0977b9 outlet_anything + 627
46 com.cycling74.Max 0x000000010c0054c8 typedmess_fun + 216
47 com.cycling74.Max 0x000000010c0977b9 outlet_anything + 627
48 com.cycling74.Max 0x000000010c08b9af linklist_funall_imp + 111
49 com.cycling74.Max 0x000000010c0706cf through_scheduler_sendit_extended + 148
50 com.cycling74.Max 0x000000010c070a4d through_scheduler_anything + 20
51 com.cycling74.Max 0x000000010c0688fe send_anything + 40
52 com.cycling74.Max 0x000000010c0054c8 typedmess_fun + 216
53 com.cycling74.Max 0x000000010c0977b9 outlet_anything + 627
54 prepend 0x0000000122be3ab0 prepend_list + 234
55 prepend 0x0000000122be398e prepend_int + 48
56 com.cycling74.Max 0x000000010c0966f2 outlet_int + 891
57 com.cycling74.Max 0x000000010c096616 outlet_int + 671
58 com.cycling74.Max 0x000000010c067031 route_list + 337
59 com.cycling74.Max 0x000000010c097036 outlet_list + 574
60 com.cycling74.Max 0x000000010c0966f2 outlet_int + 891
61 com.cycling74.Max 0x000000010c053e06 stdin_input + 142
62 com.cycling74.Max 0x000000010c0054c8 typedmess_fun + 216
63 com.cycling74.Max 0x000000010c0977b9 outlet_anything + 627
64 com.cycling74.Max 0x000000010c08b9af linklist_funall_imp + 111
65 com.cycling74.Max 0x000000010c0706cf through_scheduler_sendit_extended + 148
66 com.cycling74.Max 0x000000010c070635 through_scheduler_sendit + 20
67 com.cycling74.Max 0x000000010c053d38 stdin_sendinput + 284
68 com.cycling74.Max 0x000000010c017b5a sched_midipacket_scheduler_impl + 269
69 com.cycling74.Max 0x000000010c0181ae sched_takepoll + 420
70 com.cycling74.Max 0x000000010c09cb9c mactimer_isr + 192
71 com.cycling74.Max 0x000000010c09a8f8 systhread_threadproc + 64
72 libsystem_pthread.dylib 0x00007fff6d2272eb _pthread_body + 126
73 libsystem_pthread.dylib 0x00007fff6d22a249 _pthread_start + 66
74 libsystem_pthread.dylib 0x00007fff6d22640d thread_start + 13