View Issue Details
|ID||Category||Date Submitted||Last Update|
|0007066||bugs||2016-10-10 02:32||2016-10-13 19:56|
|Product Version||5.X git (version in description)|
|Fixed in Version|
|Summary||0007066: crash creating range from region with illegal start location|
|Description||I'm not sure what to do with this one. I have a session were one of the tracks contains an illegal start(and sync point). I'm not sure how it got that way, I suspect either a Rhythm Ferret operation or perhaps a plugin operation. (I have not been able to recreate the illegal region from scratch yet.)|
If you click on the first region, and show properties, it shows the two fields (start, sync point) are negative. If you click in the field to do anything, as soon as it receives focus it fixes the bad value and overwrites it with a zero.
However if you select the region and try to do an operation (in my case set_loop_range), it blows up with the interesting portion of the stack trace looking like:
0000005 0x00000000008b3907 in Editor::set_loop_range (this=0x5a93910, start=-888, end=1663112, cmd="set loop range from region") at ../gtk2_ardour/editor.cc:4739
#6 0x00000000009dcb81 in Editor::set_loop_from_region (this=0x5a93910, play=false) at ../gtk2_ardour/editor_ops.cc:6351
#7 0x00000000008f9ce6 in sigc::bound_mem_functor1<void, Editor, bool>::operator() (this=0x5c15880, _A_a1=@0x5c158a0: false) at /usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1856
0000008 0x00000000008f36f9 in sigc::adaptor_functor<sigc::bound_mem_functor1<void, Editor, bool> >::operator()<bool&> (this=0x5c15878, _A_arg1=@0x5c158a0: false) at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:89
0000009 0x00000000008e9e26 in sigc::bind_functor<-1, sigc::bound_mem_functor1<void, Editor, bool>, bool, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil, sigc::nil>::operator() (this=0x5c15870)
I suspect that this should likely be fixed in the selection rather than the particular command.
|Additional Information||I've attached the session file (but not the data files as I didn't believe them relevant. I can provide more detailed session info if needed.|
|Tags||No tags attached.|
illegal_region.ardour (1,679,690 bytes)
I've quickly looked into this one. The problem is that for some regions, the position has a value of -888.
Do we need to add a sanitizer to Region::set_state() to make sure values like position and sync_position can't be negative?
I'm not certain. rgareus indicated that the place to fix this where the bad region became invalid, which I don't know.
We could add a trap to set_start/move_start to debug if it ever happens again. While I'm fine with this sort of debugging locally, I'm not sure I like the idea of releasing paranoid debug code into the wild. OTOH, it's not an expensive check. There are a handful of other places where _start can get set (sync point gets set from start, so I'm pretty sure that's where it got its bad value.)
What the correct way to correct the session file in this case?
Just clamp the negative positions to "0"? Does the region-start need to be shifted when the position is negative, and if so under what circumstances?
What if another bug shows up in the future that also produces negative numbers?
tl;dr: Ardour itself should not correct for this. The issue leading to negative position needs to be fixed.
For an automatic way to fix session-files: look at session-utils. A separate standalone tool that performs a specific action on a session.
(recent example is `ardour5-fix_bbtppq` to fix A 5.0 -> 5.3 midi metrum).
|2016-10-10 02:32||nstewart||New Issue|
|2016-10-10 02:32||nstewart||File Added: illegal_region.ardour|
|2016-10-11 18:24||paas44||Status||new => assigned|
|2016-10-13 19:17||paas44||Note Added: 0018807|
|2016-10-13 19:28||nstewart||Note Added: 0018808|
|2016-10-13 19:56||x42||Note Added: 0018809|