View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0006137 | ardour | bugs | public | 2015-01-19 00:39 | 2020-04-19 20:17 |
| Reporter | ahellquist | Assigned To | drobilla | ||
| Priority | normal | Severity | crash | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Summary | 0006137: Dragging a midi region onto an audio track core dumps ardour | ||||
| Description | Dragging midi regions to an audio track is possible if one first drag it bellow all tracks and back to a audio track. Ardour then coredumps. | ||||
| Additional Information | Tested build# 3.5-4321 message displayed after dump: (ardour-3.5.4059:16717): Gtk-WARNING **: show-ui-prefs: missing action show-ui-prefs ardour-3.5.4059: ../gtk2_ardour/editor_drag.cc:1342: RegionView* RegionMoveDrag::insert_region_into_playlist(boost::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, ARDOUR::layer_t, ARDOUR::framecnt_t, RegionMoveDrag::PlaylistSet&): Assertion `_new_region_view' failed. Aborted (core dumped) | ||||
| Tags | No tags attached. | ||||
|
|
I CAN confirm this for 3.5-4415-g0018ee2. Does NOT seem to happen with 3.5-403-gec2cb31. And only seems to work when I drag and drop onto the last track and that is an audio track. Else dragging the midi region over the track does not display the midi region in the track. So this is what should be fixed I suppose. Here's my full backtrace: #0 0x00007ffff0c5dcc9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 0000001 0x00007ffff0c610d8 in __GI_abort () at abort.c:89 #2 0x00007ffff0c56b86 in __assert_fail_base ( fmt=0x7ffff0da83d0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x184ab49 "_new_region_view", file=file@entry=0x184aa80 "../gtk2_ardour/editor_drag.cc", line=line@entry=1350, function=function@entry=0x184bd00 <RegionMoveDrag::insert_region_into_playlist(boost::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, unsigned int, long, std::set<boost::shared_ptr<ARDOUR::Playlist>, std::less<boost::shared_ptr<ARDOUR::Playlist> >, std::allocator<boost::shared_ptr<ARDOUR::Playlist> > >&)::__PRETTY_FUNCTION__> "RegionView* RegionMoveDrag::insert_region_into_playlist(boost::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, ARDOUR::layer_t, ARDOUR::framecnt_t, RegionMoveDrag::PlaylistSet&)") at assert.c:92 #3 0x00007ffff0c56c32 in __GI___assert_fail ( assertion=0x184ab49 "_new_region_view", file=0x184aa80 "../gtk2_ardour/editor_drag.cc", line=1350, function=0x184bd00 <RegionMoveDrag::insert_region_into_playlist(boost::shared_ptr<ARDOUR::Region>, RouteTimeAxisView*, unsigned int, long, std::set<boost::shared_ptr<ARDOUR::Playlist>, std::less<boost::shared_ptr<ARDOUR::Playlist> >, std::allocator<boost::shared_ptr<ARDOUR::Playlist> > >&)::__PRETTY_FUNCTION__> "RegionView* RegionMoveDrag::insert_region_into_playlist(boost::shared_ptr<ARDOUR::---Type <return> to continue, or q <return> to quit--- Region>, RouteTimeAxisView*, ARDOUR::layer_t, ARDOUR::framecnt_t, RegionMoveDrag::PlaylistSet&)") at assert.c:101 0000004 0x000000000113e2b4 in RegionMoveDrag::insert_region_into_playlist ( this=0x9642420, region=..., dest_rtv=0x9887800, dest_layer=0, where=0, modified_playlists=...) at ../gtk2_ardour/editor_drag.cc:1350 0000005 0x000000000113d5b0 in RegionMoveDrag::finished_no_copy (this=0x9642420, changed_position=true, changed_tracks=true, drag_delta=48000) at ../gtk2_ardour/editor_drag.cc:1161 #6 0x000000000113c518 in RegionMoveDrag::finished (this=0x9642420, ev=0x7fffffffcbc0, movement_occurred=true) at ../gtk2_ardour/editor_drag.cc:989 #7 0x00000000011392eb in Drag::end_grab (this=0x9642420, event=0x7fffffffcbc0) at ../gtk2_ardour/editor_drag.cc:314 0000008 0x0000000001138b2d in DragManager::end_grab (this=0x24ebe60, e=0x7fffffffcbc0) at ../gtk2_ardour/editor_drag.cc:154 0000009 0x000000000118759e in Editor::button_release_handler (this=0x2e975c0, item= 0x97299c0, event=0x7fffffffcbc0, item_type=RegionItem) at ../gtk2_ardour/editor_mouse.cc:1201 0000010 0x00000000011332af in Editor::canvas_region_view_event (this=0x2e975c0, event=0x7fffffffcbc0, item=0x97299c0, rv=0x9310200) at ../gtk2_ardour/editor_canvas_events.cc:271 0000011 0x00000000015d97c3 in RegionView::canvas_group_event (this=0x9310200, event=0x7fffffffcbc0) at ../gtk2_ardour/region_view.cc:220 ---Type <return> to continue, or q <return> to quit--- 0000012 0x000000000137ddeb in MidiRegionView::canvas_group_event (this=0x9310200, ev=0x7fffffffcbc0) at ../gtk2_ardour/midi_region_view.cc:356 0000013 0x000000000175461c in sigc::bound_mem_functor1<bool, TimeAxisViewItem, _GdkEvent*>::operator() (this=0x956cd38, _A_a1=@0x7fffffffcab0: 0x7fffffffcbc0) at /usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1851 0000014 0x00000000017540ef in sigc::adaptor_functor<sigc::bound_mem_functor1<bool, TimeAxisViewItem, _GdkEvent*> >::operator()<_GdkEvent* const&> (this=0x956cd30, _A_arg1=@0x7fffffffcab0: 0x7fffffffcbc0) at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:84 #15 0x0000000001753ab2 in sigc::internal::slot_call1<sigc::bound_mem_functor1<bool, TimeAxisViewItem, _GdkEvent*>, bool, _GdkEvent*>::call_it (rep=0x956cd00, a_1=@0x7fffffffcab0: 0x7fffffffcbc0) at /usr/include/sigc++-2.0/sigc++/functors/slot.h:137 0000016 0x00007ffff79160eb in sigc::internal::signal_emit1<bool, _GdkEvent*, ArdourCanvas::Item::EventAccumulator<bool> >::operator() (this=0x7fffffffc9b0, _A_slot=...) at /usr/include/sigc++-2.0/sigc++/signal.h:834 #17 0x00007ffff7915d15 in sigc::internal::slot_iterator_buf<sigc::internal::signal_emit1<bool, _GdkEvent*, ArdourCanvas::Item::EventAccumulator<bool> >, bool>::operator* (this=0x7fffffffc950) at /usr/include/sigc++-2.0/sigc++/signal.h:306 0000018 0x00007ffff791573b in ArdourCanvas::Item::EventAccumulator<bool>::operator()<sigc::internal::slot_iterator_buf<sigc::internal::signal_emit1<bool, _GdkEvent*, ArdourCanvas::Item::EventAccumulator<bool> >, bool> > (this=0x7fffffffc99f, first=..., last=...) ---Type <return> to continue, or q <return> to quit--- at /home/chaot/Programs/ardour/libs/canvas/canvas/item.h:214 0000019 0x00007ffff7914e54 in sigc::internal::signal_emit1<bool, _GdkEvent*, ArdourCanvas::Item::EventAccumulator<bool> >::emit (impl=0x7c0b830, _A_a1=@0x7fffffffcab0: 0x7fffffffcbc0) at /usr/include/sigc++-2.0/sigc++/signal.h:854 0000020 0x00007ffff7913c27 in sigc::signal1<bool, _GdkEvent*, ArdourCanvas::Item::EventAccumulator<bool> >::emit (this=0x9729a30, _A_a1=@0x7fffffffcab0: 0x7fffffffcbc0) at /usr/include/sigc++-2.0/sigc++/signal.h:2781 0000021 0x00007ffff79121a5 in sigc::signal1<bool, _GdkEvent*, ArdourCanvas::Item::EventAccumulator<bool> >::operator() (this=0x9729a30, _A_a1=@0x7fffffffcab0: 0x7fffffffcbc0) at /usr/include/sigc++-2.0/sigc++/signal.h:2789 0000022 0x00007ffff790df6e in ArdourCanvas::GtkCanvas::deliver_event ( this=0x2a7deb8, event=0x7fffffffcbc0) at ../libs/canvas/canvas.cc:689 0000023 0x00007ffff790f029 in ArdourCanvas::GtkCanvas::on_button_release_event ( this=0x2a7deb8, ev=0x6604160) at ../libs/canvas/canvas.cc:902 #24 0x00007ffff3371994 in Gtk::Widget_Class::button_release_event_callback(_GtkWidget*, _GdkEventButton*) () from /usr/lib/x86_64-linux-gnu/libgtkmm-2.4.so.1 0000025 0x00007ffff4669815 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 0000026 0x00007ffff50953b8 in g_closure_invoke () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 ---Type <return> to continue, or q <return> to quit--- 0000027 0x00007ffff50a6afb in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 0000028 0x00007ffff50ae6f9 in g_signal_emit_valist () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 0000029 0x00007ffff50aece2 in g_signal_emit () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 0000030 0x00007ffff4779724 in ?? () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 0000031 0x00007ffff4667fc4 in gtk_propagate_event () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 0000032 0x00007ffff466837b in gtk_main_do_event () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 0000033 0x00007ffff42e31ec in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0 0000034 0x00007ffff4bc0e04 in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 0000035 0x00007ffff4bc1048 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 0000036 0x00007ffff4bc130a in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0 0000037 0x00007ffff4667447 in gtk_main () from /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0 0000038 0x00007ffff5e437ee in Gtkmm2ext::UI::run (this=0x20f7e80, old_receiver=...) at ../libs/gtkmm2ext/gtk_ui.cc:278 ---Type <return> to continue, or q <return> to quit--- 0000039 0x000000000134c07b in main (argc=1, argv=0x7fffffffd4e8) at ../gtk2_ardour/main.cc:303 |
|
|
I traced the bug down to the point in the code where things start to go wrong but unfortunately I don't really understand all the points that have to be fixed so I write my findings down for somebody else to fix it. Also I'd probably introduce even more bugs when fixing it myself... Things start going wrong when I drag (without releasing) the region into the free space under the last track. Then there are a few things that behave strangely: 1) If a grid is activated and I go up with the mouse pointer, then the region does not go up as well provided I don't change the grid line in x-direction. 2) As soon as I change the grid line the region snaps to the last track (not the currently hovered track!). 3) As said in the bug report it is possible to enter Audio Tracks with Midi Regions but this seems to be more a result of 2) and 2) is partly (but not totally!) a result from 1). So actually we got two bugs here but they are somewhat related. The error occurs in RegionMotionDrag::motion. Also y_movement_allowed is called from the former with wrong parameters and might need a fix as well. When the bottom edge of the last track is crossed with the mouse pointer then `tv = 0` and it follows that `delta_time_axis_view = 0`. But the draged region will go down below the last track. So obviously delta_time_axis_view should not be 0. Then `y_movement_allowed` gets a wrong input and erroneously evaluates to false instead of true. Now all at the bottom of the function, the line `_last_pointer_time_axis_view += delta_time_axis_view;` increases the _last_pointer_time_axis_view by zero which is again not exactly what should be the case. This leads to follow up errors in the next time RegionMotionDrag::motion is called in this line `delta_time_axis_view = current_pointer_time_axis_view - _last_pointer_time_axis_view;` because the wrong value (now _last_pointer_time_axis_view) is used again and y_movement_allowed always evaluates to wrong. So this produces strange behavior 1). Strange behavior 2) and 3) are produced in the following piece of code: ` int track_index; if (i->time_axis_view >= 0) { track_index = i->time_axis_view + delta_time_axis_view; } else { track_index = _time_axis_views.size() - 1 + delta_time_axis_view; } if (track_index < 0 || track_index >= (int) _time_axis_views.size()) { continue; } /* The TimeAxisView that this region is now over */ TimeAxisView* current_tv = _time_axis_views[track_index]; ` Here `i->time_axis_view` evaluates to -1 after I drag (and not release) the region below the last track and then the else part is entered and in the end current_tv points to the last track. But instead we whant it to point on the currently hovered track. So if there is a need to call rv-move() because of a movement in x-direction (remember: y-direction is not possible anymore because of first bug) then current_tv is used as target for the region; so the region is put in the last track, regardless if it is an audio or a midi track. Aaaaaaand: assert! Because a midi region shouldn't enter an audio track. Well... this was the story of the brave assert. I tried to fix it but just created Segfaults as I didn't quite overlook all the side effects of my pseudo-fix. I hope this helps someone to fix this without much more work! Feel free to ask if there is possibly anything left I didn't write down now. ;) |
|
|
In current git (3.5-4753-gb72fc75) the crash is gone but the weird behavior that an audio region can be dragged onto a bus (and everything buggy that follows from there on) is still there. I'll attach some screenshots of this behavior. |
|
2015-03-14 10:10
|
|
|
2015-03-14 10:10
|
|
|
|
The crash is not fixed. It is still possible to drag a MIDI region onto an audio track if the last track is audio, by dragging down to the empty canvas then back up to the audio track. Trying to sort it out, but this must be the worst code in Ardour, good grief... :/ |
|
|
Fixed in 3.5-4766-ga5db1d5 |
|
|
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-01-19 00:39 | ahellquist | New Issue | |
| 2015-01-30 17:47 | chaot | Note Added: 0016315 | |
| 2015-01-30 17:47 | chaot | Status | new => confirmed |
| 2015-01-31 00:57 | chaot | Note Added: 0016317 | |
| 2015-01-31 00:58 | chaot | Note Edited: 0016317 | |
| 2015-01-31 00:59 | chaot | Note Edited: 0016317 | |
| 2015-01-31 01:08 | chaot | Note Edited: 0016317 | |
| 2015-03-14 10:09 | chaot | Note Added: 0016435 | |
| 2015-03-14 10:10 | chaot | File Added: Screenshot - 14.03.2015 - 11:02:32.png | |
| 2015-03-14 10:10 | chaot | File Added: Screenshot - 14.03.2015 - 11:06:20.png | |
| 2015-03-15 06:41 | drobilla | Note Added: 0016440 | |
| 2015-03-15 07:51 | drobilla | Note Added: 0016441 | |
| 2015-03-15 07:51 | drobilla | Assigned To | => drobilla |
| 2015-03-15 07:51 | drobilla | Status | confirmed => resolved |
| 2015-03-15 07:51 | drobilla | Resolution | open => fixed |
| 2020-04-19 20:17 | system | Note Added: 0023380 | |
| 2020-04-19 20:17 | system | Status | resolved => closed |