diff --git a/cli.o b/cli.o new file mode 100644 index 0000000..8065fac Binary files /dev/null and b/cli.o differ diff --git a/engine.c b/engine.c index a9447d2..50a2db1 100644 --- a/engine.c +++ b/engine.c @@ -473,8 +473,8 @@ void engine_process_commands(Engine *engine) { action.type = ACTION_TRIGGER_CLIP; action.index = cmd.index; action.value = 0; - action.previous_state = clip->state; - action.previous_buffer_size = clip->buffer_size; + action.previous_state = (ClipState)atomic_load(&clip->state); + action.previous_buffer_size = (size_t)atomic_load(&clip->buffer_size); action.previous_write_position = clip->write_position; action.previous_read_position = clip->read_position; engine_push_undo_action(engine, &action); @@ -566,8 +566,8 @@ void engine_process_commands(Engine *engine) { action.type = ACTION_RESET_CLIP; action.index = cmd.index; action.value = 0; - action.previous_state = clip->state; - action.previous_buffer_size = clip->buffer_size; + action.previous_state = (ClipState)atomic_load(&clip->state); + action.previous_buffer_size = (size_t)atomic_load(&clip->buffer_size); action.previous_write_position = clip->write_position; action.previous_read_position = clip->read_position; engine_push_undo_action(engine, &action); diff --git a/engine.o b/engine.o index a35406b..22cf585 100644 Binary files a/engine.o and b/engine.o differ diff --git a/err.log b/err.log new file mode 100644 index 0000000..0361ade --- /dev/null +++ b/err.log @@ -0,0 +1,47 @@ +JACK Looper started +Client name: jack-looper +Control channel: 0 +Sample rate: 48000 Hz +Press Ctrl+C to stop + +[?1049h(B[?7h[?1h[?25l[?1000h                        [?7l [?7h(BJACK Looper - 8x8 Clip Grid(B  0  1 2 3 4 5 6 7 8 9 10 11 12 13 14 1516 17 18 19 20 21 22 2324 25 26 27 28 29 30 3132 33 34 35 36 37 38 3940 41 42 43 44 45 46 4748 49 50 51 52 53 54 5556 57 58 59 60 61 62 63 (B[?1000l[?12h[?25h [?1049l [?1l================== +WARNING: ThreadSanitizer: data race (pid=925560) + Write of size 1 at 0x55e2d55c4e20 by main thread: + #0 engine_stop_save_load_thread /home/jt/code/wheelie/engine.c:400 (jack-looper+0x4d6a) (BuildId: 1db9d60d6df5722c162e756ee0458e30040c8571) + #1 engine_stop /home/jt/code/wheelie/engine.c:1115 (jack-looper+0x9883) (BuildId: 1db9d60d6df5722c162e756ee0458e30040c8571) + #2 main /home/jt/code/wheelie/main.c:108 (jack-looper+0x2b6c) (BuildId: 1db9d60d6df5722c162e756ee0458e30040c8571) + + Previous read of size 1 at 0x55e2d55c4e20 by thread T5: + #0 save_load_thread_func /home/jt/code/wheelie/engine.c:303 (jack-looper+0x4c43) (BuildId: 1db9d60d6df5722c162e756ee0458e30040c8571) + #1 (libtsan.so.2+0x541b9) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + + Location is global 'engine' of size 39432 at 0x55e2d55bb420 (jack-looper+0x24e20) + + Thread T5 (tid=925567, running) created by main thread at: + #0 pthread_create (libtsan.so.2+0x5fb47) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 engine_start_save_load_thread /home/jt/code/wheelie/engine.c:388 (jack-looper+0x4cff) (BuildId: 1db9d60d6df5722c162e756ee0458e30040c8571) + #2 engine_start /home/jt/code/wheelie/engine.c:1101 (jack-looper+0x979f) (BuildId: 1db9d60d6df5722c162e756ee0458e30040c8571) + #3 main /home/jt/code/wheelie/main.c:79 (jack-looper+0x2a25) (BuildId: 1db9d60d6df5722c162e756ee0458e30040c8571) + +SUMMARY: ThreadSanitizer: data race /home/jt/code/wheelie/engine.c:400 in engine_stop_save_load_thread +================== +================== +WARNING: ThreadSanitizer: unlock of an unlocked mutex (or by a wrong thread) (pid=925560) + #0 pthread_mutex_unlock (libtsan.so.2+0x5c2ec) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libpipewire-0.3.so.0+0xd250) (BuildId: 6c351c9a14f26a16201ad1530bbec8bc2bdf8106) + + Location is heap block of size 1512 at 0x726800001200 allocated by main thread: + #0 calloc (libtsan.so.2+0x9126c) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libpipewire-0.3.so.0+0x6bbef) (BuildId: 6c351c9a14f26a16201ad1530bbec8bc2bdf8106) + #2 main /home/jt/code/wheelie/main.c:67 (jack-looper+0x2999) (BuildId: 1db9d60d6df5722c162e756ee0458e30040c8571) + + Mutex M0 (0x726800001710) created at: + #0 pthread_mutex_init (libtsan.so.2+0x5e23a) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libspa-support.so+0x8bd0) (BuildId: 24a3df4fe9996f17f516f9dca3d5b18bfce2133f) + #2 main /home/jt/code/wheelie/main.c:67 (jack-looper+0x2999) (BuildId: 1db9d60d6df5722c162e756ee0458e30040c8571) + +SUMMARY: ThreadSanitizer: unlock of an unlocked mutex (or by a wrong thread) (/usr/lib/libpipewire-0.3.so.0+0xd250) (BuildId: 6c351c9a14f26a16201ad1530bbec8bc2bdf8106) +================== + +Shutting down... +ThreadSanitizer: reported 2 warnings diff --git a/gui.o b/gui.o new file mode 100644 index 0000000..20905c8 Binary files /dev/null and b/gui.o differ diff --git a/jack-looper b/jack-looper index d2db156..cdb698b 100755 Binary files a/jack-looper and b/jack-looper differ diff --git a/main.o b/main.o index 744b776..e88db1d 100644 Binary files a/main.o and b/main.o differ diff --git a/samples/clip_0.wav b/samples/clip_0.wav new file mode 100644 index 0000000..b0ca7d1 Binary files /dev/null and b/samples/clip_0.wav differ diff --git a/samples/clip_1.wav b/samples/clip_1.wav new file mode 100644 index 0000000..d7348e1 Binary files /dev/null and b/samples/clip_1.wav differ diff --git a/samples/clip_10.wav b/samples/clip_10.wav new file mode 100644 index 0000000..d5883eb Binary files /dev/null and b/samples/clip_10.wav differ diff --git a/samples/clip_12.wav b/samples/clip_12.wav new file mode 100644 index 0000000..d5883eb Binary files /dev/null and b/samples/clip_12.wav differ diff --git a/samples/clip_13.wav b/samples/clip_13.wav new file mode 100644 index 0000000..d5883eb Binary files /dev/null and b/samples/clip_13.wav differ diff --git a/samples/clip_14.wav b/samples/clip_14.wav new file mode 100644 index 0000000..c045a7e Binary files /dev/null and b/samples/clip_14.wav differ diff --git a/samples/clip_15.wav b/samples/clip_15.wav new file mode 100644 index 0000000..e0b6530 Binary files /dev/null and b/samples/clip_15.wav differ diff --git a/samples/clip_16.wav b/samples/clip_16.wav new file mode 100644 index 0000000..cc6316c Binary files /dev/null and b/samples/clip_16.wav differ diff --git a/samples/clip_17.wav b/samples/clip_17.wav new file mode 100644 index 0000000..a1abac6 Binary files /dev/null and b/samples/clip_17.wav differ diff --git a/samples/clip_18.wav b/samples/clip_18.wav new file mode 100644 index 0000000..717a8d4 Binary files /dev/null and b/samples/clip_18.wav differ diff --git a/samples/clip_19.wav b/samples/clip_19.wav new file mode 100644 index 0000000..a1abac6 Binary files /dev/null and b/samples/clip_19.wav differ diff --git a/samples/clip_2.wav b/samples/clip_2.wav new file mode 100644 index 0000000..512aa74 Binary files /dev/null and b/samples/clip_2.wav differ diff --git a/samples/clip_20.wav b/samples/clip_20.wav new file mode 100644 index 0000000..a1abac6 Binary files /dev/null and b/samples/clip_20.wav differ diff --git a/samples/clip_21.wav b/samples/clip_21.wav new file mode 100644 index 0000000..45ee713 Binary files /dev/null and b/samples/clip_21.wav differ diff --git a/samples/clip_22.wav b/samples/clip_22.wav new file mode 100644 index 0000000..a1abac6 Binary files /dev/null and b/samples/clip_22.wav differ diff --git a/samples/clip_23.wav b/samples/clip_23.wav new file mode 100644 index 0000000..a1abac6 Binary files /dev/null and b/samples/clip_23.wav differ diff --git a/samples/clip_27.wav b/samples/clip_27.wav new file mode 100644 index 0000000..5a1b0fa Binary files /dev/null and b/samples/clip_27.wav differ diff --git a/samples/clip_28.wav b/samples/clip_28.wav new file mode 100644 index 0000000..16d30d1 Binary files /dev/null and b/samples/clip_28.wav differ diff --git a/samples/clip_29.wav b/samples/clip_29.wav new file mode 100644 index 0000000..ac24cdf Binary files /dev/null and b/samples/clip_29.wav differ diff --git a/samples/clip_3.wav b/samples/clip_3.wav new file mode 100644 index 0000000..512aa74 Binary files /dev/null and b/samples/clip_3.wav differ diff --git a/samples/clip_32.wav b/samples/clip_32.wav new file mode 100644 index 0000000..9f5b664 Binary files /dev/null and b/samples/clip_32.wav differ diff --git a/samples/clip_33.wav b/samples/clip_33.wav new file mode 100644 index 0000000..a28c384 Binary files /dev/null and b/samples/clip_33.wav differ diff --git a/samples/clip_35.wav b/samples/clip_35.wav new file mode 100644 index 0000000..5e5d6c4 Binary files /dev/null and b/samples/clip_35.wav differ diff --git a/samples/clip_36.wav b/samples/clip_36.wav new file mode 100644 index 0000000..e00f80c Binary files /dev/null and b/samples/clip_36.wav differ diff --git a/samples/clip_37.wav b/samples/clip_37.wav new file mode 100644 index 0000000..16d30d1 Binary files /dev/null and b/samples/clip_37.wav differ diff --git a/samples/clip_4.wav b/samples/clip_4.wav new file mode 100644 index 0000000..512aa74 Binary files /dev/null and b/samples/clip_4.wav differ diff --git a/samples/clip_40.wav b/samples/clip_40.wav new file mode 100644 index 0000000..40749ac Binary files /dev/null and b/samples/clip_40.wav differ diff --git a/samples/clip_41.wav b/samples/clip_41.wav new file mode 100644 index 0000000..40749ac Binary files /dev/null and b/samples/clip_41.wav differ diff --git a/samples/clip_42.wav b/samples/clip_42.wav new file mode 100644 index 0000000..40749ac Binary files /dev/null and b/samples/clip_42.wav differ diff --git a/samples/clip_45.wav b/samples/clip_45.wav new file mode 100644 index 0000000..c31d2ec Binary files /dev/null and b/samples/clip_45.wav differ diff --git a/samples/clip_46.wav b/samples/clip_46.wav new file mode 100644 index 0000000..0b6ffcc Binary files /dev/null and b/samples/clip_46.wav differ diff --git a/samples/clip_5.wav b/samples/clip_5.wav new file mode 100644 index 0000000..512aa74 Binary files /dev/null and b/samples/clip_5.wav differ diff --git a/samples/clip_52.wav b/samples/clip_52.wav new file mode 100644 index 0000000..717a8d4 Binary files /dev/null and b/samples/clip_52.wav differ diff --git a/samples/clip_53.wav b/samples/clip_53.wav new file mode 100644 index 0000000..39314dc Binary files /dev/null and b/samples/clip_53.wav differ diff --git a/samples/clip_54.wav b/samples/clip_54.wav new file mode 100644 index 0000000..54526f1 Binary files /dev/null and b/samples/clip_54.wav differ diff --git a/samples/clip_55.wav b/samples/clip_55.wav new file mode 100644 index 0000000..8af2783 Binary files /dev/null and b/samples/clip_55.wav differ diff --git a/samples/clip_56.wav b/samples/clip_56.wav new file mode 100644 index 0000000..e00f80c Binary files /dev/null and b/samples/clip_56.wav differ diff --git a/samples/clip_61.wav b/samples/clip_61.wav new file mode 100644 index 0000000..e0b6530 Binary files /dev/null and b/samples/clip_61.wav differ diff --git a/samples/clip_62.wav b/samples/clip_62.wav new file mode 100644 index 0000000..e0b6530 Binary files /dev/null and b/samples/clip_62.wav differ diff --git a/samples/clip_63.wav b/samples/clip_63.wav new file mode 100644 index 0000000..c6ff435 Binary files /dev/null and b/samples/clip_63.wav differ diff --git a/samples/clip_7.wav b/samples/clip_7.wav new file mode 100644 index 0000000..5d3a217 Binary files /dev/null and b/samples/clip_7.wav differ diff --git a/samples/clip_8.wav b/samples/clip_8.wav new file mode 100644 index 0000000..6356692 Binary files /dev/null and b/samples/clip_8.wav differ diff --git a/samples/clip_9.wav b/samples/clip_9.wav new file mode 100644 index 0000000..d5883eb Binary files /dev/null and b/samples/clip_9.wav differ diff --git a/test_cli b/test_cli index b9fb2b4..65e8056 100755 Binary files a/test_cli and b/test_cli differ diff --git a/test_cli.o b/test_cli.o index f344df2..99b799a 100644 Binary files a/test_cli.o and b/test_cli.o differ diff --git a/test_double_process b/test_double_process new file mode 100755 index 0000000..0fd5249 Binary files /dev/null and b/test_double_process differ diff --git a/test_double_process.o b/test_double_process.o new file mode 100644 index 0000000..24a6d20 Binary files /dev/null and b/test_double_process.o differ diff --git a/test_engine b/test_engine index aa20daf..c33ced5 100755 Binary files a/test_engine and b/test_engine differ diff --git a/test_engine.o b/test_engine.o index 305bcd5..097bb39 100644 Binary files a/test_engine.o and b/test_engine.o differ diff --git a/test_gui b/test_gui index 987c301..d655d2d 100755 Binary files a/test_gui and b/test_gui differ diff --git a/test_gui.o b/test_gui.o index 48f6c1d..88f7a8e 100644 Binary files a/test_gui.o and b/test_gui.o differ diff --git a/test_stress b/test_stress index c4a79f2..5590af7 100755 Binary files a/test_stress and b/test_stress differ diff --git a/test_stress.o b/test_stress.o index c9f4d3f..cb16877 100644 Binary files a/test_stress.o and b/test_stress.o differ diff --git a/test_tui b/test_tui index 0c9fb39..b2a6f23 100755 Binary files a/test_tui and b/test_tui differ diff --git a/test_tui.o b/test_tui.o index d3c2088..fcfdc13 100644 Binary files a/test_tui.o and b/test_tui.o differ diff --git a/transport.o b/transport.o new file mode 100644 index 0000000..68fc1ea Binary files /dev/null and b/transport.o differ diff --git a/tsan_report.log b/tsan_report.log new file mode 100644 index 0000000..ccb6f36 --- /dev/null +++ b/tsan_report.log @@ -0,0 +1,82 @@ +================== +WARNING: ThreadSanitizer: unlock of an unlocked mutex (or by a wrong thread) (pid=928821) + #0 pthread_mutex_unlock (libtsan.so.2+0x5c2ec) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libpipewire-0.3.so.0+0xd250) (BuildId: 6c351c9a14f26a16201ad1530bbec8bc2bdf8106) + + Location is heap block of size 1512 at 0x726800001200 allocated by main thread: + #0 calloc (libtsan.so.2+0x9126c) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libpipewire-0.3.so.0+0x6bbef) (BuildId: 6c351c9a14f26a16201ad1530bbec8bc2bdf8106) + #2 main /home/jt/code/wheelie/main.c:67 (jack-looper+0x39f9) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + + Mutex M0 (0x726800001710) created at: + #0 pthread_mutex_init (libtsan.so.2+0x5e23a) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libspa-support.so+0x8bd0) (BuildId: 24a3df4fe9996f17f516f9dca3d5b18bfce2133f) + #2 main /home/jt/code/wheelie/main.c:67 (jack-looper+0x39f9) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + +SUMMARY: ThreadSanitizer: unlock of an unlocked mutex (or by a wrong thread) (/usr/lib/libpipewire-0.3.so.0+0xd250) (BuildId: 6c351c9a14f26a16201ad1530bbec8bc2bdf8106) +================== +================== +WARNING: ThreadSanitizer: data race (pid=928821) + Read of size 8 at 0x5598ba988108 by thread T4 (mutexes: write M0, write M1): + #0 engine_process_commands /home/jt/code/wheelie/engine.c:453 (jack-looper+0x64b4) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #1 process_callback /home/jt/code/wheelie/engine.c:24 (jack-looper+0x3c4f) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #2 (libjack.so.0+0x1fc6a) (BuildId: a070bcfa4955ac5fd8a632489cd56f534a7dfc66) + + Previous write of size 4 at 0x5598ba988108 by main thread: + #0 engine_submit_command /home/jt/code/wheelie/engine.c:429 (jack-looper+0x62ad) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #1 engine_transport_toggle_play /home/jt/code/wheelie/engine.c:1176 (jack-looper+0xb9dd) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #2 tui_run /home/jt/code/wheelie/tui.c:694 (jack-looper+0xe81e) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #3 main /home/jt/code/wheelie/main.c:95 (jack-looper+0x3b86) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + + Location is global 'engine' of size 39432 at 0x5598ba987440 (jack-looper+0x21108) + + Mutex M0 (0x726800001710) created at: + #0 pthread_mutex_init (libtsan.so.2+0x5e23a) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libspa-support.so+0x8bd0) (BuildId: 24a3df4fe9996f17f516f9dca3d5b18bfce2133f) + #2 main /home/jt/code/wheelie/main.c:67 (jack-looper+0x39f9) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + + Mutex M1 (0x728400000550) created at: + #0 pthread_mutex_init (libtsan.so.2+0x5e23a) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 jack_client_open (libjack.so.0+0x1d691) (BuildId: a070bcfa4955ac5fd8a632489cd56f534a7dfc66) + #2 main /home/jt/code/wheelie/main.c:67 (jack-looper+0x39f9) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + + Thread T4 'data-loop.0' (tid=928826, running) created by main thread at: + #0 pthread_create (libtsan.so.2+0x5fb47) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libpipewire-0.3.so.0+0x90c47) (BuildId: 6c351c9a14f26a16201ad1530bbec8bc2bdf8106) + #2 main /home/jt/code/wheelie/main.c:79 (jack-looper+0x3a85) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + +SUMMARY: ThreadSanitizer: data race /home/jt/code/wheelie/engine.c:453 in engine_process_commands +================== +================== +WARNING: ThreadSanitizer: data race (pid=928821) + Read of size 4 at 0x5598ba988114 by thread T4 (mutexes: write M0, write M1): + #0 engine_process_commands /home/jt/code/wheelie/engine.c:453 (jack-looper+0x64b4) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #1 process_callback /home/jt/code/wheelie/engine.c:24 (jack-looper+0x3c4f) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #2 (libjack.so.0+0x1fc6a) (BuildId: a070bcfa4955ac5fd8a632489cd56f534a7dfc66) + + Previous write of size 4 at 0x5598ba988114 by main thread: + #0 engine_submit_command /home/jt/code/wheelie/engine.c:429 (jack-looper+0x62ad) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #1 engine_reset_clip /home/jt/code/wheelie/engine.c:1137 (jack-looper+0xb748) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #2 tui_run /home/jt/code/wheelie/tui.c:644 (jack-looper+0xe62a) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #3 main /home/jt/code/wheelie/main.c:95 (jack-looper+0x3b86) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + + Location is global 'engine' of size 39432 at 0x5598ba987440 (jack-looper+0x21114) + + Mutex M0 (0x726800001710) created at: + #0 pthread_mutex_init (libtsan.so.2+0x5e23a) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libspa-support.so+0x8bd0) (BuildId: 24a3df4fe9996f17f516f9dca3d5b18bfce2133f) + #2 main /home/jt/code/wheelie/main.c:67 (jack-looper+0x39f9) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + + Mutex M1 (0x728400000550) created at: + #0 pthread_mutex_init (libtsan.so.2+0x5e23a) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 jack_client_open (libjack.so.0+0x1d691) (BuildId: a070bcfa4955ac5fd8a632489cd56f534a7dfc66) + #2 main /home/jt/code/wheelie/main.c:67 (jack-looper+0x39f9) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + + Thread T4 'data-loop.0' (tid=928826, running) created by main thread at: + #0 pthread_create (libtsan.so.2+0x5fb47) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libpipewire-0.3.so.0+0x90c47) (BuildId: 6c351c9a14f26a16201ad1530bbec8bc2bdf8106) + #2 main /home/jt/code/wheelie/main.c:79 (jack-looper+0x3a85) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + +SUMMARY: ThreadSanitizer: data race /home/jt/code/wheelie/engine.c:453 in engine_process_commands +================== +ThreadSanitizer: reported 3 warnings diff --git a/tsan_report.log.928888 b/tsan_report.log.928888 new file mode 100644 index 0000000..125ae93 --- /dev/null +++ b/tsan_report.log.928888 @@ -0,0 +1,65 @@ +================== +WARNING: ThreadSanitizer: data race (pid=928888) + Read of size 4 at 0x56251621f114 by thread T4 (mutexes: write M0, write M1): + #0 engine_process_commands /home/jt/code/wheelie/engine.c:453 (jack-looper+0x64b4) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #1 process_callback /home/jt/code/wheelie/engine.c:24 (jack-looper+0x3c4f) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #2 (libjack.so.0+0x1fc6a) (BuildId: a070bcfa4955ac5fd8a632489cd56f534a7dfc66) + + Previous write of size 4 at 0x56251621f114 by main thread: + #0 engine_submit_command /home/jt/code/wheelie/engine.c:429 (jack-looper+0x62ad) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #1 engine_reset_clip /home/jt/code/wheelie/engine.c:1137 (jack-looper+0xb748) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #2 tui_run /home/jt/code/wheelie/tui.c:644 (jack-looper+0xe62a) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #3 main /home/jt/code/wheelie/main.c:95 (jack-looper+0x3b86) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + + Location is global 'engine' of size 39432 at 0x56251621e440 (jack-looper+0x21114) + + Mutex M0 (0x726800001710) created at: + #0 pthread_mutex_init (libtsan.so.2+0x5e23a) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libspa-support.so+0x8bd0) (BuildId: 24a3df4fe9996f17f516f9dca3d5b18bfce2133f) + #2 main /home/jt/code/wheelie/main.c:67 (jack-looper+0x39f9) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + + Mutex M1 (0x728400000550) created at: + #0 pthread_mutex_init (libtsan.so.2+0x5e23a) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 jack_client_open (libjack.so.0+0x1d691) (BuildId: a070bcfa4955ac5fd8a632489cd56f534a7dfc66) + #2 main /home/jt/code/wheelie/main.c:67 (jack-looper+0x39f9) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + + Thread T4 'data-loop.0' (tid=928893, running) created by main thread at: + #0 pthread_create (libtsan.so.2+0x5fb47) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libpipewire-0.3.so.0+0x90c47) (BuildId: 6c351c9a14f26a16201ad1530bbec8bc2bdf8106) + #2 main /home/jt/code/wheelie/main.c:79 (jack-looper+0x3a85) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + +SUMMARY: ThreadSanitizer: data race /home/jt/code/wheelie/engine.c:453 in engine_process_commands +================== +================== +WARNING: ThreadSanitizer: data race (pid=928888) + Read of size 8 at 0x56251621f120 by thread T4 (mutexes: write M0, write M1): + #0 engine_process_commands /home/jt/code/wheelie/engine.c:453 (jack-looper+0x64b4) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #1 process_callback /home/jt/code/wheelie/engine.c:24 (jack-looper+0x3c4f) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #2 (libjack.so.0+0x1fc6a) (BuildId: a070bcfa4955ac5fd8a632489cd56f534a7dfc66) + + Previous write of size 4 at 0x56251621f120 by main thread: + #0 engine_submit_command /home/jt/code/wheelie/engine.c:429 (jack-looper+0x62ad) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #1 engine_transport_toggle_play /home/jt/code/wheelie/engine.c:1176 (jack-looper+0xb9dd) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #2 tui_run /home/jt/code/wheelie/tui.c:694 (jack-looper+0xe81e) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + #3 main /home/jt/code/wheelie/main.c:95 (jack-looper+0x3b86) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + + Location is global 'engine' of size 39432 at 0x56251621e440 (jack-looper+0x21120) + + Mutex M0 (0x726800001710) created at: + #0 pthread_mutex_init (libtsan.so.2+0x5e23a) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libspa-support.so+0x8bd0) (BuildId: 24a3df4fe9996f17f516f9dca3d5b18bfce2133f) + #2 main /home/jt/code/wheelie/main.c:67 (jack-looper+0x39f9) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + + Mutex M1 (0x728400000550) created at: + #0 pthread_mutex_init (libtsan.so.2+0x5e23a) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 jack_client_open (libjack.so.0+0x1d691) (BuildId: a070bcfa4955ac5fd8a632489cd56f534a7dfc66) + #2 main /home/jt/code/wheelie/main.c:67 (jack-looper+0x39f9) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + + Thread T4 'data-loop.0' (tid=928893, running) created by main thread at: + #0 pthread_create (libtsan.so.2+0x5fb47) (BuildId: f29521f558650bcc384c0178d8c6d0fd49466e29) + #1 (libpipewire-0.3.so.0+0x90c47) (BuildId: 6c351c9a14f26a16201ad1530bbec8bc2bdf8106) + #2 main /home/jt/code/wheelie/main.c:79 (jack-looper+0x3a85) (BuildId: ed86a50eccffb9d745f9683ba76a2748ef793573) + +SUMMARY: ThreadSanitizer: data race /home/jt/code/wheelie/engine.c:453 in engine_process_commands +================== +ThreadSanitizer: reported 2 warnings diff --git a/tui.o b/tui.o new file mode 100644 index 0000000..650e011 Binary files /dev/null and b/tui.o differ diff --git a/wav_io.o b/wav_io.o new file mode 100644 index 0000000..bdabebd Binary files /dev/null and b/wav_io.o differ