diff --git a/Let's craft the blocks.tui.h b/Let's craft the blocks.tui.h deleted file mode 100644 index 9e92cc9..0000000 --- a/Let's craft the blocks.tui.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef TUI_H -#define TUI_H - -#include "engine.h" - -// Initialize TUI -void tui_init(Engine *engine); - -// Run the TUI main loop -void tui_run(Engine *engine); - -// Cleanup TUI -void tui_cleanup(void); - -#endif // TUI_H diff --git a/Let's do that.cli.h b/Let's do that.cli.h deleted file mode 100644 index 696fa3f..0000000 --- a/Let's do that.cli.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef CLI_H -#define CLI_H - -#include "engine.h" - -int cli_process_line(Engine *engine, const char *line); -void cli_run(Engine *engine); - -#endif /* CLI_H */ diff --git a/We'll produce the final answer with only the SEARCH/REPLACE block.makefile b/We'll produce the final answer with only the SEARCH/REPLACE block.makefile deleted file mode 100644 index 47aeec9..0000000 --- a/We'll produce the final answer with only the SEARCH/REPLACE block.makefile +++ /dev/null @@ -1,28 +0,0 @@ -CC = gcc -CFLAGS = -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200809L -LDFLAGS = -ljack -lm - -all: jack-looper test_engine - -jack-looper: main.o engine.o - $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) - -test_engine: test_engine.o engine.o - $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) - -main.o: main.c engine.h - $(CC) $(CFLAGS) -c -o $@ $< - -engine.o: engine.c engine.h - $(CC) $(CFLAGS) -c -o $@ $< - -test_engine.o: test_engine.c engine.h - $(CC) $(CFLAGS) -c -o $@ $< - -.PHONY: all clean test - -clean: - rm -f *.o jack-looper test_engine - -test: test_engine - ./test_engine diff --git a/cli.c b/cli.c index e0f59a1..66a6dc8 100644 --- a/cli.c +++ b/cli.c @@ -1,5 +1,4 @@ #include "cli.h" -#include "wav_io.h" #include #include #include diff --git a/cli.o b/cli.o index 8065fac..c1d6851 100644 Binary files a/cli.o and b/cli.o differ diff --git a/engine.o b/engine.o index 22cf585..fa66d02 100644 Binary files a/engine.o and b/engine.o differ diff --git a/err.log b/err.log deleted file mode 100644 index 0361ade..0000000 --- a/err.log +++ /dev/null @@ -1,47 +0,0 @@ -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 index 20905c8..dd5e706 100644 Binary files a/gui.o and b/gui.o differ diff --git a/jack-looper b/jack-looper index cdb698b..1377b81 100755 Binary files a/jack-looper and b/jack-looper differ diff --git a/lib/microui.o b/lib/microui.o index d1bff2b..440b141 100644 Binary files a/lib/microui.o and b/lib/microui.o differ diff --git a/main.o b/main.o index e88db1d..9e0ea41 100644 Binary files a/main.o and b/main.o differ diff --git a/makefile b/makefile index 5a96c5c..4c1a720 100644 --- a/makefile +++ b/makefile @@ -1,5 +1,5 @@ CC = gcc -CFLAGS = -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200809L -Ilib -fsanitize=thread -g +CFLAGS = -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200809L -Ilib LDFLAGS = -ljack -lm -lncurses -lpthread all: jack-looper test_engine test_tui test_gui test_cli test_stress test_wav_io diff --git a/samples/clip_1.wav b/samples/clip_1.wav index d7348e1..0cb07e5 100644 Binary files a/samples/clip_1.wav and b/samples/clip_1.wav differ diff --git a/samples/clip_10.wav b/samples/clip_10.wav index d5883eb..e0b6530 100644 Binary files a/samples/clip_10.wav and b/samples/clip_10.wav differ diff --git a/samples/clip_11.wav b/samples/clip_11.wav new file mode 100644 index 0000000..e0b6530 Binary files /dev/null and b/samples/clip_11.wav differ diff --git a/samples/clip_12.wav b/samples/clip_12.wav index d5883eb..e0b6530 100644 Binary files a/samples/clip_12.wav and b/samples/clip_12.wav differ diff --git a/samples/clip_13.wav b/samples/clip_13.wav index d5883eb..a1abac6 100644 Binary files a/samples/clip_13.wav and b/samples/clip_13.wav differ diff --git a/samples/clip_14.wav b/samples/clip_14.wav index c045a7e..642e55f 100644 Binary files a/samples/clip_14.wav and b/samples/clip_14.wav differ diff --git a/samples/clip_16.wav b/samples/clip_16.wav index cc6316c..c6ff435 100644 Binary files a/samples/clip_16.wav and b/samples/clip_16.wav differ diff --git a/samples/clip_17.wav b/samples/clip_17.wav index a1abac6..77702a8 100644 Binary files a/samples/clip_17.wav and b/samples/clip_17.wav differ diff --git a/samples/clip_18.wav b/samples/clip_18.wav index 717a8d4..77702a8 100644 Binary files a/samples/clip_18.wav and b/samples/clip_18.wav differ diff --git a/samples/clip_19.wav b/samples/clip_19.wav index a1abac6..77702a8 100644 Binary files a/samples/clip_19.wav and b/samples/clip_19.wav differ diff --git a/samples/clip_2.wav b/samples/clip_2.wav index 512aa74..0cb07e5 100644 Binary files a/samples/clip_2.wav and b/samples/clip_2.wav differ diff --git a/samples/clip_20.wav b/samples/clip_20.wav index a1abac6..77702a8 100644 Binary files a/samples/clip_20.wav and b/samples/clip_20.wav differ diff --git a/samples/clip_21.wav b/samples/clip_21.wav index 45ee713..77702a8 100644 Binary files a/samples/clip_21.wav and b/samples/clip_21.wav differ diff --git a/samples/clip_22.wav b/samples/clip_22.wav index a1abac6..77702a8 100644 Binary files a/samples/clip_22.wav and b/samples/clip_22.wav differ diff --git a/samples/clip_23.wav b/samples/clip_23.wav index a1abac6..77702a8 100644 Binary files a/samples/clip_23.wav and b/samples/clip_23.wav differ diff --git a/samples/clip_24.wav b/samples/clip_24.wav new file mode 100644 index 0000000..a1abac6 Binary files /dev/null and b/samples/clip_24.wav differ diff --git a/samples/clip_25.wav b/samples/clip_25.wav new file mode 100644 index 0000000..a1abac6 Binary files /dev/null and b/samples/clip_25.wav differ diff --git a/samples/clip_26.wav b/samples/clip_26.wav new file mode 100644 index 0000000..a1abac6 Binary files /dev/null and b/samples/clip_26.wav differ diff --git a/samples/clip_27.wav b/samples/clip_27.wav index 5a1b0fa..a1abac6 100644 Binary files a/samples/clip_27.wav and b/samples/clip_27.wav differ diff --git a/samples/clip_28.wav b/samples/clip_28.wav index 16d30d1..a1abac6 100644 Binary files a/samples/clip_28.wav and b/samples/clip_28.wav differ diff --git a/samples/clip_29.wav b/samples/clip_29.wav index ac24cdf..a1abac6 100644 Binary files a/samples/clip_29.wav and b/samples/clip_29.wav differ diff --git a/samples/clip_3.wav b/samples/clip_3.wav index 512aa74..0cb07e5 100644 Binary files a/samples/clip_3.wav and b/samples/clip_3.wav differ diff --git a/samples/clip_30.wav b/samples/clip_30.wav new file mode 100644 index 0000000..a1abac6 Binary files /dev/null and b/samples/clip_30.wav differ diff --git a/samples/clip_31.wav b/samples/clip_31.wav new file mode 100644 index 0000000..0cb07e5 Binary files /dev/null and b/samples/clip_31.wav differ diff --git a/samples/clip_32.wav b/samples/clip_32.wav index 9f5b664..c045a7e 100644 Binary files a/samples/clip_32.wav and b/samples/clip_32.wav differ diff --git a/samples/clip_33.wav b/samples/clip_33.wav index a28c384..c045a7e 100644 Binary files a/samples/clip_33.wav and b/samples/clip_33.wav differ diff --git a/samples/clip_34.wav b/samples/clip_34.wav new file mode 100644 index 0000000..c045a7e Binary files /dev/null and b/samples/clip_34.wav differ diff --git a/samples/clip_35.wav b/samples/clip_35.wav index 5e5d6c4..a1abac6 100644 Binary files a/samples/clip_35.wav and b/samples/clip_35.wav differ diff --git a/samples/clip_36.wav b/samples/clip_36.wav index e00f80c..c045a7e 100644 Binary files a/samples/clip_36.wav and b/samples/clip_36.wav differ diff --git a/samples/clip_37.wav b/samples/clip_37.wav index 16d30d1..c045a7e 100644 Binary files a/samples/clip_37.wav and b/samples/clip_37.wav differ diff --git a/samples/clip_38.wav b/samples/clip_38.wav new file mode 100644 index 0000000..c562151 Binary files /dev/null and b/samples/clip_38.wav differ diff --git a/samples/clip_39.wav b/samples/clip_39.wav new file mode 100644 index 0000000..c045a7e Binary files /dev/null and b/samples/clip_39.wav differ diff --git a/samples/clip_4.wav b/samples/clip_4.wav index 512aa74..0cb07e5 100644 Binary files a/samples/clip_4.wav and b/samples/clip_4.wav differ diff --git a/samples/clip_40.wav b/samples/clip_40.wav index 40749ac..5d3a217 100644 Binary files a/samples/clip_40.wav and b/samples/clip_40.wav differ diff --git a/samples/clip_41.wav b/samples/clip_41.wav index 40749ac..f62f2f9 100644 Binary files a/samples/clip_41.wav and b/samples/clip_41.wav differ diff --git a/samples/clip_42.wav b/samples/clip_42.wav index 40749ac..5d3a217 100644 Binary files a/samples/clip_42.wav and b/samples/clip_42.wav differ diff --git a/samples/clip_43.wav b/samples/clip_43.wav new file mode 100644 index 0000000..5d3a217 Binary files /dev/null and b/samples/clip_43.wav differ diff --git a/samples/clip_44.wav b/samples/clip_44.wav new file mode 100644 index 0000000..5d3a217 Binary files /dev/null and b/samples/clip_44.wav differ diff --git a/samples/clip_45.wav b/samples/clip_45.wav index c31d2ec..5d3a217 100644 Binary files a/samples/clip_45.wav and b/samples/clip_45.wav differ diff --git a/samples/clip_46.wav b/samples/clip_46.wav index 0b6ffcc..80bdb32 100644 Binary files a/samples/clip_46.wav and b/samples/clip_46.wav differ diff --git a/samples/clip_47.wav b/samples/clip_47.wav new file mode 100644 index 0000000..5d3a217 Binary files /dev/null and b/samples/clip_47.wav differ diff --git a/samples/clip_48.wav b/samples/clip_48.wav new file mode 100644 index 0000000..c045a7e Binary files /dev/null and b/samples/clip_48.wav differ diff --git a/samples/clip_49.wav b/samples/clip_49.wav new file mode 100644 index 0000000..c045a7e Binary files /dev/null and b/samples/clip_49.wav differ diff --git a/samples/clip_5.wav b/samples/clip_5.wav index 512aa74..2868318 100644 Binary files a/samples/clip_5.wav and b/samples/clip_5.wav differ diff --git a/samples/clip_50.wav b/samples/clip_50.wav new file mode 100644 index 0000000..c045a7e Binary files /dev/null and b/samples/clip_50.wav differ diff --git a/samples/clip_51.wav b/samples/clip_51.wav new file mode 100644 index 0000000..c045a7e Binary files /dev/null and b/samples/clip_51.wav differ diff --git a/samples/clip_52.wav b/samples/clip_52.wav index 717a8d4..c045a7e 100644 Binary files a/samples/clip_52.wav and b/samples/clip_52.wav differ diff --git a/samples/clip_53.wav b/samples/clip_53.wav index 39314dc..5991b49 100644 Binary files a/samples/clip_53.wav and b/samples/clip_53.wav differ diff --git a/samples/clip_54.wav b/samples/clip_54.wav index 54526f1..c045a7e 100644 Binary files a/samples/clip_54.wav and b/samples/clip_54.wav differ diff --git a/samples/clip_55.wav b/samples/clip_55.wav index 8af2783..bdc31d3 100644 Binary files a/samples/clip_55.wav and b/samples/clip_55.wav differ diff --git a/samples/clip_56.wav b/samples/clip_56.wav index e00f80c..94521a7 100644 Binary files a/samples/clip_56.wav and b/samples/clip_56.wav differ diff --git a/samples/clip_57.wav b/samples/clip_57.wav new file mode 100644 index 0000000..94521a7 Binary files /dev/null and b/samples/clip_57.wav differ diff --git a/samples/clip_58.wav b/samples/clip_58.wav new file mode 100644 index 0000000..94521a7 Binary files /dev/null and b/samples/clip_58.wav differ diff --git a/samples/clip_59.wav b/samples/clip_59.wav new file mode 100644 index 0000000..2868318 Binary files /dev/null and b/samples/clip_59.wav differ diff --git a/samples/clip_6.wav b/samples/clip_6.wav new file mode 100644 index 0000000..0cb07e5 Binary files /dev/null and b/samples/clip_6.wav differ diff --git a/samples/clip_60.wav b/samples/clip_60.wav new file mode 100644 index 0000000..94521a7 Binary files /dev/null and b/samples/clip_60.wav differ diff --git a/samples/clip_61.wav b/samples/clip_61.wav index e0b6530..94521a7 100644 Binary files a/samples/clip_61.wav and b/samples/clip_61.wav differ diff --git a/samples/clip_62.wav b/samples/clip_62.wav index e0b6530..94521a7 100644 Binary files a/samples/clip_62.wav and b/samples/clip_62.wav differ diff --git a/samples/clip_63.wav b/samples/clip_63.wav index c6ff435..94521a7 100644 Binary files a/samples/clip_63.wav and b/samples/clip_63.wav differ diff --git a/samples/clip_8.wav b/samples/clip_8.wav index 6356692..c562151 100644 Binary files a/samples/clip_8.wav and b/samples/clip_8.wav differ diff --git a/samples/clip_9.wav b/samples/clip_9.wav index d5883eb..e0b6530 100644 Binary files a/samples/clip_9.wav and b/samples/clip_9.wav differ diff --git a/test_cli b/test_cli index 65e8056..41e7e89 100755 Binary files a/test_cli and b/test_cli differ diff --git a/test_cli.o b/test_cli.o index 99b799a..a47a695 100644 Binary files a/test_cli.o and b/test_cli.o differ diff --git a/test_double_process b/test_double_process deleted file mode 100755 index 0fd5249..0000000 Binary files a/test_double_process and /dev/null differ diff --git a/test_double_process.o b/test_double_process.o deleted file mode 100644 index 24a6d20..0000000 Binary files a/test_double_process.o and /dev/null differ diff --git a/test_engine b/test_engine index c33ced5..c58f580 100755 Binary files a/test_engine and b/test_engine differ diff --git a/test_engine.o b/test_engine.o index 097bb39..41aa807 100644 Binary files a/test_engine.o and b/test_engine.o differ diff --git a/test_gui b/test_gui index d655d2d..b6000ea 100755 Binary files a/test_gui and b/test_gui differ diff --git a/test_gui.o b/test_gui.o index 88f7a8e..78b3acb 100644 Binary files a/test_gui.o and b/test_gui.o differ diff --git a/test_stress b/test_stress index 5590af7..a6115e2 100755 Binary files a/test_stress and b/test_stress differ diff --git a/test_stress.o b/test_stress.o index cb16877..486ea58 100644 Binary files a/test_stress.o and b/test_stress.o differ diff --git a/test_tui b/test_tui index b2a6f23..4fcf4da 100755 Binary files a/test_tui and b/test_tui differ diff --git a/test_tui.o b/test_tui.o index fcfdc13..7abecfb 100644 Binary files a/test_tui.o and b/test_tui.o differ diff --git a/test_wav_io b/test_wav_io index b3506ac..84dfa7c 100755 Binary files a/test_wav_io and b/test_wav_io differ diff --git a/test_wav_io.o b/test_wav_io.o index 4ed46f2..969ef82 100644 Binary files a/test_wav_io.o and b/test_wav_io.o differ diff --git a/Let's write it.test_engine.c b/thread_issue similarity index 100% rename from Let's write it.test_engine.c rename to thread_issue diff --git a/thread_safety_issue b/thread_safety_issue new file mode 100644 index 0000000..e69de29 diff --git a/transport.o b/transport.o index 68fc1ea..faa85c1 100644 Binary files a/transport.o and b/transport.o differ diff --git a/tsan_report.log b/tsan_report.log index ccb6f36..125ae93 100644 --- a/tsan_report.log +++ b/tsan_report.log @@ -1,66 +1,17 @@ ================== -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): +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 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: + 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 0x5598ba987440 (jack-looper+0x21114) + 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) @@ -72,11 +23,43 @@ WARNING: ThreadSanitizer: data race (pid=928821) #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: + 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 3 warnings +================== +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/tsan_report.log.928888 b/tsan_report.log.928888 deleted file mode 100644 index 125ae93..0000000 --- a/tsan_report.log.928888 +++ /dev/null @@ -1,65 +0,0 @@ -================== -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 index 650e011..cea944b 100644 Binary files a/tui.o and b/tui.o differ diff --git a/wav_io.o b/wav_io.o index bdabebd..e009144 100644 Binary files a/wav_io.o and b/wav_io.o differ