View Issue Details

IDProjectCategoryView StatusLast Update
0006338ardourbugspublic2020-04-19 20:17
Reporteremem Assigned Totnaugle  
PrioritynormalSeveritycrashReproducibilitysometimes
Status closedResolutionfixed 
Product Version4.0 
Summary0006338: while dragging / cutting region
DescriptionArdour-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.
TagsNo tags attached.

Relationships

has duplicate 0006527 closedtnaugle Ardour freezes when typing 'S' while dragging a region 
related to 0006518 confirmed Undo goes way back and works unpredictably. Ardour 4.2 
child of 0006602 new crash in undo if two operations are performed at the same time 

Activities

emem

2015-05-20 08:17

reporter   ~0016706

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

tartina

2015-05-21 15:39

reporter   ~0016708

Last edited: 2015-05-21 15:39

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.

tartina

2015-05-22 13:57

reporter   ~0016710

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.

emem

2015-05-22 16:41

reporter   ~0016711

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;
  }
[...]

tartina

2015-05-27 12:51

reporter   ~0016737

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

emem

2015-05-27 20:56

reporter   ~0016740

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;

   [...]
}

timbyr

2015-09-16 06:38

developer   ~0017214

This should be fixed in Ardour master@7b82277c

If you can confirm using a nightly version >= 4.2.306 that would be great, thanks.

tnaugle

2015-09-17 18:01

developer   ~0017231

Tested in 4.2.347 and works

x42

2015-09-21 09:24

administrator   ~0017330

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.

system

2020-04-19 20:17

developer   ~0023462

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.

Issue History

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