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
Occasionally crashes when trying to save Instrument or Master #295
Comments
So, a while back some work was put in to make sure that backtraces were printed as completely as they could be. Looks like this might be one of the remaining failure cases. |
Well, I ran some tests against mruby with both our commit id and their git HEAD. I can see some minor changes in the backtrce dumping, but with either version it looks like there's no backtrace. The backtrace fixes that I put in place should still be working just fine. I could see something weird perhaps happening with it on windows where the old 'superhack' is in place to reroute stderr destined information, but on Linux there's only one scenario I can think of where no backtrace exists for an error: The error happens purely from a chained set of calls through C and no ruby code is directly run through the VM. Are you able to run gdb with the GUI? You should be able to set a breakpoint for mrb_raise() and mrb_raisef() Eventually it will boil over to the code which is currently failing to provide a backtrace https://github.com/mruby/mruby/blob/master/src/error.c#L131 https://github.com/mruby/mruby/blob/master/src/print.c#L53 https://github.com/mruby/mruby/blob/master/src/backtrace.c#L100 etc (note the function names, not the line numbers). I expect the raise call to come from one of the error points in object.c, but what triggers the invalid cast from nil is where the bug lies. |
I haven't tried running the GUI with gdb yet, I assume that I'd have to start zynaddsubfx first, and then zyn-fusion in gdb? Are there any instructions on how to run them separately? EDIT: After some experimentation and looking at the output from ps aux, this seems to work: $ zynaddsubfx --no-gui -P 12345 & Gdb claims there are no debugging symbols; is there a quick way to enable them in a build? |
Strange. I had thought that they would be in there and I've intentionally avoided stripping any symbols out. I think that the mruby part of the build respects CFLAGS, but if not build_config.rb:129 in the mruby-zest-build repo shows another way that compiler flags can be injected (-g or -ggdb in this case). |
Turns out that there are at least some debugging symbols present, zyn-fusion segfaulted at one point and it happily told me where, I could extract some variables etc. Don't think it's related but I'll post part of the debugging session here anyway. (I've since reinstated the printf on line 887; occasionally I see the printout but it hasn't crashed since). So it could be that there are some files without debugging symbols but not all.
EDIT: Looking at the preceding code, this looks like a race, if I understand the code, br->frame_messages is bumped by calling do_send(), so it should never be larger than br->rlimit_len, so if it is, something else must have been calling do_send() in the meantime. I haven't studied the rest of the code so this might be totally bogus. EDIT: Since this looks like something different from what issue is concerned about I'll open a separate issue for it. |
At an arbitrary time during a session I attempted to Load Master, and upon clicking on the Enter widget, the mrb_raisef() bp was hit:
|
I think this issue is likely resolved, but if not the MRuby submodule update should mean that proper backtraces (without gdb) will be generated. |
Thanks. I've built binaries from the latest git and will test more later tonight. |
Didn't do as much saving and loading as I'd planned to (I started playing for too long on one of the sounds I'd made...) but for what it's worth it hasn't crashed so far while saving/loading instruments/master. |
I suspect the Mruby compiler bug Mark found/solved yesterday in issue #287 will also solve this problem. |
Thanks @synmuse, I'll rebuild with the latest master for further testing. |
Seems to be solved, I've been running Zyn quite a bit lately and have not had it crash on load/save instrument/master once since the mruby compiler fix was brought in. |
Excellent :) |
In fact, the whole of Zyn seems to be be rock stable since this change. Before it was having random crashes and glitches which I never reported because I couldn't find a way to consistently trigger them, such as the polyType occasionally being set to Latched when loading an instrument, or the Apply button just displaying the spinning graphic without actually performing the apply function, or the whole thing just crashing at arbitrary intervals. |
(Built from master a week ago or so, Zyn-Fuson presenting itself as v3.0.6, running on Debian Buster using the self contained application).
Occasionally when saving Instrument or Master, the whole kit'n'kaboodle crashes when pressing Enter after entering the filename to save to.
The following is printed on stdout/stderr, which is likely not very helpful. If there's any debug flag I can turn on that can print more informative messages I'd be happy to do that.
can't convert nil to Integer (TypeError)
[FATAL ERROR] Mruby Is Unable To Continue
I have not been able to determine a pattern as to when this happens, more than it seems to happen after I've been working on a sound that I'm really happy with, so perhaps excessive UI tweaking and/or playing time comes into the picture
The text was updated successfully, but these errors were encountered: