-
Notifications
You must be signed in to change notification settings - Fork 90
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
Qtractor LV2 worker implementation bug #45
Comments
On 09/22/2016 08:19 PM, swesterfeld wrote:
made its way to git head master (aka. qtractor v0.7.9.2) please test && tell (and possibly close) thanksrncbc aka. Rui Nuno Capela |
Looks reasonable, except for one detail (which breaks all requests as you committed it): if (::jack_ringbuffer_write_space(m_pRequests) < request_size) { should be ... >= request_size As to whether to inform the user somehow if the out-of-space-condition occurred (which assert() would have done), it's probably a matter of taste whether to fail silently - as you implemented it - or produce some sort of warning. |
On 09/22/2016 10:49 PM, swesterfeld wrote:
of course. 7d31291
when the later sort of warning comes like a dang crash/abort, then i cheersrncbc aka. Rui Nuno Capela |
Right, now everything works for me, it no longer crashes with my testcase, so I'm closing the issue. As for producing a warning without crash/abort, you could add something like fprintf (stderr, "qtractorLv2Worker::schedule failed, ring buffer full\n"); This would at least give users/developers a clue about what happened if a plugin is misbehaving. Anyway that's up to you. |
I can reproducibly crash Qtractor from git by loading my SpectMorph plugin and generating lots of UI changes with the mouse (using the 2x2 grid template). I debugged the problem, and the crash is
caused by the function qtractorLv2Worker::schedule, which in the original implementation uses:
::jack_ringbuffer_write(m_pRequests, (const char *) &size, sizeof(size));
::jack_ringbuffer_write(m_pRequests, (const char *) data, size);
to write the request. Now the case that triggers the crash is that the first ringbuffer_write is executed, and then the request is read by the worker thread. Since data isn't yet written, the worker thread executes an incomplete request, which in turn causes a crash in the SpectMorph plugin. I know it sounds like an unlikely thing to happen, but I can trigger it reproducibly in a short amount of time.
My fix is to copy the data into one consecutive chunk of data, and writing that with one single ringbuffer_write. Patch attached.
Cu... Stefan
lv2workerfix.diff.txt
The text was updated successfully, but these errors were encountered: