View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006338 | ardour | bugs | public | 2015-05-20 07:06 | 2020-04-19 20:17 |
Reporter | emem | Assigned To | tnaugle | ||
Priority | normal | Severity | crash | Reproducibility | sometimes |
Status | closed | Resolution | fixed | ||
Product Version | 4.0 | ||||
Summary | 0006338: while dragging / cutting region | ||||
Description | Ardour-4.0.317-dbg - from nightly builds (Linux x86, debug, full version) Sometimes when I cut the region - Ardour crashes. This happens very rarely. The error appears in different sessions and is not related to a specific session. I work at the session - only one path, without any pinned plug-ins. Only I cut and move some cut pieces regions. When cutting ("s") Ardour crashes. Perhaps when I cut, at the same time I click the mouse to move the region - I do not know. The error is so rare that I can not reproduce it. Dragging region(s) from 1 different track(s), max dist: 0 Dragging region(s) from 1 different track(s), max dist: 0 actually writing state to /home/sesje/20150519-mariola/20150519-mariola.tmp renaming state to /home/sesje/20150519-mariola/20150519-mariola.ardour Aborting drag Please call begin_reversible_command() before commit_reversible_command(). ardour-4.0.317: ../libs/ardour/session_state.cc:2470: void ARDOUR::Session::commit_reversible_command(Command*): Assertion `_current_trans' failed. | ||||
Tags | No tags attached. | ||||
|
The error occurs every time: 1. Open any session 2. Click on a region (keep the mouse button pressed) 3. Click the "s" - Split region 4. ... Ardour crashes |
|
I can confirm this crash. Investigating with gdb I found that the problem may be in command undo. The split action calls Editor::begin_reversible_command, then Editor::split_regions_at At this point the drag action, caused by the click calls Editor::abort_reversible_command, because the drag was aborted. The Editor::before list is empty when split calls Editor::commit_reversible_command which outputs "Please call begin_reversible_command() before commit_reversible_command()." and the crash in ARDOUR::Session::commit_reversible_command(Command*) because assert(_current_trans) is NULL. Maybe we shouldn't call _session->commit_reversible_command() in Editor::commit_reversible_command when Editor::before is empty, but this seems really a race condition between the 2 actions. |
|
We really have 2 commands running at the same time. Drag calls Editor::begin_reversible_command, then split calls Editor::begin_reversible_command, at this time we have 2 XMLNodes* in Editor::before member variable, but one is about drag and one about split. AFAIK this is not correct, but I may be wrong. Then drag is aborted by Editor::catch_vanishing_regionview and Editor::abort_reversible_command clears before list, including the split XMLNode*. When split calls Editor::commit_reversible_command before list is empty. Maybe abort shouldn't clear all before elements, but I don't see an easy way to delete only drag related elements. |
|
I'm not a C/C++ programmer, but it may do the trick something like this: split_function /* "s" key */ { if ( /* drag is active (mouse press down) */ ) { return; } [...] |
|
I found a simple workaround for this bug, Ardour does not crash any more, but you loose history and the split command cannot be undone. Anyway a better solution has to be found, but at least the crash seems gone. See https://github.com/tartina/ardour/commit/1415cff17b0fd34792a4cc500ff580fec21f3dde in branch bug6338 |
|
In my opinion, better lock the "split_region" when "drag" is active (mouse key is pressed). It would be logical and safe. My idea is as follows: (Not enough I know C ++, so... metacode) _drag_is_active = false; split_region (...) { if (_drag_is_active) { return; } [...] } drag_start (...) { _drag_is_active = true; [...] } drag_end (...) { _drag_is_active = false; [...] } |
|
This should be fixed in Ardour master@7b82277c If you can confirm using a nightly version >= 4.2.306 that would be great, thanks. |
|
Tested in 4.2.347 and works |
|
Other operations have the same issue. eg press delete while dragging: region delete or a marker in the ruler or a midi-PC (hover over it). a more general solution will be needed. |
|
Issue has been closed automatically, by Trigger Close Plugin. Feel free to re-open with additional information if you think the issue is not resolved. |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-05-20 07:06 | emem | New Issue | |
2015-05-20 08:17 | emem | Note Added: 0016706 | |
2015-05-21 15:39 | tartina | Note Added: 0016708 | |
2015-05-21 15:39 | tartina | Note Edited: 0016708 | |
2015-05-22 13:57 | tartina | Note Added: 0016710 | |
2015-05-22 16:41 | emem | Note Added: 0016711 | |
2015-05-27 12:51 | tartina | Note Added: 0016737 | |
2015-05-27 20:56 | emem | Note Added: 0016740 | |
2015-08-20 22:01 | x42 | Relationship added | has duplicate 0006527 |
2015-09-08 09:08 | x42 | Relationship added | related to 0006518 |
2015-09-16 06:38 | timbyr | Note Added: 0017214 | |
2015-09-17 18:01 | tnaugle | Note Added: 0017231 | |
2015-09-17 18:01 | tnaugle | Status | new => resolved |
2015-09-17 18:01 | tnaugle | Resolution | open => fixed |
2015-09-17 18:01 | tnaugle | Assigned To | => tnaugle |
2015-09-21 09:24 | x42 | Note Added: 0017330 | |
2015-09-21 09:27 | x42 | Relationship added | child of 0006602 |
2020-04-19 20:17 | system | Note Added: 0023462 | |
2020-04-19 20:17 | system | Status | resolved => closed |