[Audacity-devel] 'Paste-over' crash in 1.3.3 Beta - Progress Report.
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: James C. <cr...@in...> - 2007-06-30 16:39:43
|
There's a repeatable crash in 1.3.3, also CVS HEAD. Windows XP. From the symptoms/progress so far, it's very likely to be present on all platforms. To reproduce: - In mono, project at 22050 Hz, generate tone, 30 seconds. - Select a small part, about 500ms, and copy it. - Paste it repeatedly, each time pasting over the right hand boundary of the previously pasted section. I get the crash usually after five pastes. It has taken up to nine pastes, never more. The crash is related to the 'editing a clip may move other clips' preference. When that's disabled (it's now enabled by default) I don't get the crash. However, it's probable that it's just tickling a bug in the code for clips - since enabling this option leads to many adjacent clips with the wide-black indicators for adjacent clips showing. ------ The bug results in the following of a NULL pointer. WaveTrack::Paste() can either be pasting 'into' i.e. inserting, or it can be pasting 'over' where it first removes a section, and then recursively calls itself to paste into. The pasting over route has the problem. WaveTrack()::Paste does a WaveTrack::Cut() and the problem arises when the WaveTrack::Cut() returns false. In that case no new copy has been made, and a temporary Track pointer called tmp is NULL. If we detect the 'NULL' at this point and stop the process, we don't crash any more. But we don't paste in the new clip either! I THINK the problem that needs fixing is that when WaveClip::CreateFromCopy() was added, the meaning of a true and false return wasn't really taken into account. When Sequence::Copy() returns true, CreateFromCopy() returns true, and everything works fine. However in WaveTrack::Copy() when WaveClip::CreateFromCopy() returns false, as it can do, WaveTrack::Copy() now returns straight away without doing anything with its 'Track **dest' parameter. I'm not sure what WaveTrack::Copy should be doing with its **dest parameter, but it surely shouldn't be leaving it NULL? So, does anyone know how WaveTrack::Copy should be setting **dest in this case? If so, we can fix the problem. --James. A second point, quite aside from the crash. I find enabling 'editing a clip may move other clips' makes for more cumbersome editing for my editing pattern. I do a lot of 'pasting over', and it means that I now get a lot of black lines at the boundaries where I've pasted. That means two extra clicks after each paste, to get rid of lines I don't want. Can we keep the previous functionality and disable this option by default? As an alternative, can it not operate when pasting over? Also worth considering as well is making the black lines only one pixel wide, as they currently obscure samples close to the joins. --James. |