Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWS Script might Crash Reaper with "Bus Error" - Linux #1359

Closed
codecollider opened this issue May 24, 2020 · 8 comments · Fixed by #1363
Closed

SWS Script might Crash Reaper with "Bus Error" - Linux #1359

codecollider opened this issue May 24, 2020 · 8 comments · Fixed by #1363
Assignees
Labels

Comments

@codecollider
Copy link

codecollider commented May 24, 2020

Hi,

not 100% sure if this is caused by the SWS script, I also reported the crash to Justin, but the back trace points to SWS everytime Reaper crashes with "Bus Error" in the terminal. I'm using Debian 10 (with XFCE) and used the version sws-2.12.0.0-Linux-x86_64-23871fdc.tar.xz.

The backtrace is shown below. Currently I'm testing without SWS, but as the error occurs quite rarely I have to test for at least two days to be sure that it's gone.

Also made a thread here: https://forum.cockos.com/showthread.php?t=236818

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/home/marco/opt/REAPER/./reaper'.
Program terminated with signal SIGBUS, Bus error.
#0  0x00007f418e990739 in ?? () from /home/marco/opt/REAPER/libSwell.so
[Current thread is 1 (Thread 0x7f418ec18d80 (LWP 1499))]
(gdb) thread apply all bt
...

Thread 5 (Thread 0x7f413c8e5700 (LWP 1575)):
#0  0x00007f418f21c00c in futex_wait_cancelable (private=0, expected=0, futex_word=0xd419268) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  0x00007f418f21c00c in __pthread_cond_wait_common (abstime=0x0, mutex=0xd419218, cond=0xd419240) at pthread_cond_wait.c:502
#2  0x00007f418f21c00c in __pthread_cond_wait (cond=0xd419240, mutex=0xd419218) at pthread_cond_wait.c:655
#3  0x00007f415e491dcb in  () at /home/marco/.vst/u-he/Hive.64.so
#4  0x00007f415e491194 in  () at /home/marco/.vst/u-he/Hive.64.so
#5  0x00007f415e742c27 in  () at /home/marco/.vst/u-he/Hive.64.so
#6  0x00007f418f215fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#7  0x00007f418ed1d4cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 4 (Thread 0x7f4153206700 (LWP 1540)):
#0  0x00007f418f21c00c in futex_wait_cancelable (private=0, expected=0, futex_word=0xb0383b0) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  0x00007f418f21c00c in __pthread_cond_wait_common (abstime=0x0, mutex=0xb038360, cond=0xb038388) at pthread_cond_wait.c:502
#2  0x00007f418f21c00c in __pthread_cond_wait (cond=0xb038388, mutex=0xb038360) at pthread_cond_wait.c:655
#3  0x00007f415e491dcb in  () at /home/marco/.vst/u-he/Hive.64.so
#4  0x00007f415e491194 in  () at /home/marco/.vst/u-he/Hive.64.so
#5  0x00007f415e742c27 in  () at /home/marco/.vst/u-he/Hive.64.so
#6  0x00007f418f215fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#7  0x00007f418ed1d4cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 3 (Thread 0x7f413d8e7700 (LWP 1573)):
#0  0x00007f418f21c00c in futex_wait_cancelable (private=0, expected=0, futex_word=0xd4191b8) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  0x00007f418f21c00c in __pthread_cond_wait_common (abstime=0x0, mutex=0xd419168, cond=0xd419190) at pthread_cond_wait.c:502
#2  0x00007f418f21c00c in __pthread_cond_wait (cond=0xd419190, mutex=0xd419168) at pthread_cond_wait.c:655
#3  0x00007f415e491dcb in  () at /home/marco/.vst/u-he/Hive.64.so
#4  0x00007f415e491194 in  () at /home/marco/.vst/u-he/Hive.64.so
#5  0x00007f415e742c27 in  () at /home/marco/.vst/u-he/Hive.64.so
#6  0x00007f418f215fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#7  0x00007f418ed1d4cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 2 (Thread 0x7f4153a07700 (LWP 1539)):
#0  0x00007f418f21c00c in futex_wait_cancelable (private=0, expected=0, futex_word=0xb038358) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#1  0x00007f418f21c00c in __pthread_cond_wait_common (abstime=0x0, mutex=0xb038308, cond=0xb038330) at pthread_cond_wait.c:502
#2  0x00007f418f21c00c in __pthread_cond_wait (cond=0xb038330, mutex=0xb038308) at pthread_cond_wait.c:655
#3  0x00007f415e491dcb in  () at /home/marco/.vst/u-he/Hive.64.so
#4  0x00007f415e491194 in  () at /home/marco/.vst/u-he/Hive.64.so
#5  0x00007f415e742c27 in  () at /home/marco/.vst/u-he/Hive.64.so
#6  0x00007f418f215fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
#7  0x00007f418ed1d4cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Thread 1 (Thread 0x7f418ec18d80 (LWP 1499)):
#0  0x00007f418e990739 in  () at /home/marco/opt/REAPER/libSwell.so
#1  0x00007f417ed8f2cd in NotesWnd::Update(bool) [clone .part.29] () at /home/marco/.config/REAPER/UserPlugins/reaper_sws-x86_64.so
#2  0x00007f417ed2ac3c in ScheduledJob::Schedule(ScheduledJob*) () at /home/marco/.config/REAPER/UserPlugins/reaper_sws-x86_64.so
#3  0x00007f417ec28f05 in SWSTimeSlice::SetTrackListChange() () at /home/marco/.config/REAPER/UserPlugins/reaper_sws-x86_64.so
#4  0x000000000061574d in  ()
#5  0x000000000068649f in  ()
#6  0x00000000006acebe in  ()
#7  0x00000000004c93ee in  ()
#8  0x00000000006b6ec8 in  ()
#9  0x00007f418e9b6a33 in  () at /home/marco/opt/REAPER/libSwell.so
#10 0x00007f418e9b6ea2 in  () at /home/marco/opt/REAPER/libSwell.so
#11 0x00007f418e9b7335 in  () at /home/marco/opt/REAPER/libSwell.so
#12 0x00007f418db57465 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#13 0x00007f418db88112 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#14 0x00007f418d7acf2e in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x00007f418d7ad1c8 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007f418d7ad25c in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#17 0x00007f418e9b876a in  () at /home/marco/opt/REAPER/libSwell.so
#18 0x00007f418e99ad42 in  () at /home/marco/opt/REAPER/libSwell.so
#19 0x0000000000414916 in  ()
#20 0x00007f418ec4809b in __libc_start_main (main=0x414030, argc=1, argv=0x7ffd4fc14eb8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd4fc14ea8) at ../csu/libc-start.c:308
#21 0x0000000000419faa in _start ()`
@cfillion
Copy link
Member

cfillion commented May 24, 2020

I think I got that crash once on macOS a while ago, but couldn't duplicate afterwards. Do you know what steps are likely to trigger it?

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

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x00002ddbc7d3bec0

Application Specific Information:
objc_msgSend() selector name: isKindOfClass:

Thread 0 Crashed:: reaper  Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib               	0x00007fff84f550dd objc_msgSend + 29
1   reaper_sws-x86_64.dylib       	0x0000000112e6c684 NotesWnd::SetText(char const*, bool) + 148 (SnM_Notes.cpp:246)
2   reaper_sws-x86_64.dylib       	0x0000000112e6f21c NotesWnd::UpdateTrackNotes() + 236 (SnM_Notes.cpp:989)
3   reaper_sws-x86_64.dylib       	0x0000000112e6c518 NotesWnd::Update(bool) + 408 (SnM_Notes.cpp:891)
4   reaper_sws-x86_64.dylib       	0x0000000112e6fcbb NotesUpdateJob::Perform() + 59 (SnM_Notes.cpp:1232)
5   reaper_sws-x86_64.dylib       	0x0000000112e19132 ScheduledJob::PerformSafe() + 50 (SnM.h:293)
6   reaper_sws-x86_64.dylib       	0x0000000112e1812e ScheduledJob::Schedule(ScheduledJob*) + 62 (SnM.cpp:992)
7   reaper_sws-x86_64.dylib       	0x0000000112e70a8d NotesSetTrackListChange() + 61 (SnM_Notes.cpp:1572)
8   reaper_sws-x86_64.dylib       	0x0000000112e1d899 SNM_CSurfSetTrackListChange() + 9 (SnM_CSurf.cpp:74)
9   reaper_sws-x86_64.dylib       	0x0000000112c19642 SWSTimeSlice::SetTrackListChange() + 50 (sws_extension.cpp:510)
10  com.cockos.reaper             	0x0000000104e65962 CSurf_SetTrackListChange() + 162
11  com.cockos.reaper             	0x0000000104cd403e TrackList_UpdateAllExternalSurfaces() + 14
12  com.cockos.reaper             	0x00000001050d01b1 TrackList_AdjustWindows(bool, bool) + 3153
13  com.cockos.reaper             	0x0000000104bdc83e SelectProjectInstance(ReaProject*) + 494
14  com.cockos.reaper             	0x00000001051a9e8c MainProc(HWND__*, unsigned int, unsigned long, long) + 13100
15  ???                           	0x0000000000000466 0 + 1126

@codecollider
Copy link
Author

First I suspected a problem with my interface, which I newly bought. It happened always when using the "Server Synchronous Mode" in Jack (in that case Jack2 behaves like Jack1) or when using Alsa. But then it also crashed in Jack without the Server Sync mode. I switched back to my old interface and I also got a crash yesterday. So, I was completely on the wrong road. I changed the SWS script when I was working with the new interface. Never thought that it can be due to a plugin or script.

Most of the times it crashed when hitting some keys (F9 or Ctrl +Z for example) or when switching form Mixer to the Editor (F7 F8). It can run for a whole day without a problem and on the next day it can crash several time.

@codecollider
Copy link
Author

I have a core dump if that help ...

@codecollider
Copy link
Author

Is the error the same? You got SIGSEGV, I got SIGBUS (Bus Error)

@cfillion
Copy link
Member

cfillion commented May 29, 2020

Just to be sure, did you have the SWS Notes window open at the time of the crash? (Or even, has it been open at least once since REAPER was started?)

@codecollider
Copy link
Author

Nope it was closed. Actually I had to check what this is. Never was using it.

@cfillion cfillion self-assigned this May 30, 2020
@cfillion
Copy link
Member

cfillion commented May 30, 2020

Thanks, that was very helpful. It turns out saving a window screenset creates in the background the SWS Notes window in an incomplete state, thus setting it up to crash the next time the track list is refreshed.

Here a Linux 64-bit test build with a fix: https://ci.appveyor.com/api/buildjobs/bkv25frb7u3kjt3b/artifacts/build%2Fsws-2.12.0.0-Linux-x86_64-fix-screenset-notes-crash-2f129110.tar.xz.

@codecollider
Copy link
Author

Thanks, I'm still testing, but until now no crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants