Bugzilla – Bug 1735
Crash when pasting Note selection in Note track that starts after zero
Last modified: 2018-08-20 11:51:39 UTC
1) Import a MIDI file 2) Time shift the note track so that it starts after zero 3) Select and copy (Ctrl+C) a portion of the Note track 4) Click some time beyond the end of the Note track 5) Ctrl+V to paste Audacity crashes Terminal output: audacity: ../../lib-src/portsmf/allegro.h:454: Alg_beat& Alg_beats::operator[](int): Assertion `i >= 0 && i < len' failed. Aborted (core dumped)
Testing with Beta 02Sep17 a) on Mac - macOS Sierra 10.12.6 - I also get the crash both if I try to past fter the shifter original or in the time space before it b) on Windows the paste works fine and properly (afaict) and with no crash
Fixed at https://github.com/audacity/audacity/commit/47552acfc389c4d6068f5146e071199c9b4f2ff3
(In reply to Paul L from comment #2) Tested in macOS Sierra 10.12.6 761bd6b 08Sep16 Fails on Mac The original steps to reproduce work fine - pasting to the right of the time shifted MIDI Note track seesm to paste fine. But when pasting to the time space prior to the time shifted MIDI Note track: a) the length of the pasted notes approximately doubles (stretched) and can push the original Note track further over to the right b) this pasted section obviously palys slow c) some notes at the beginning are not actually part of the track, they are outside the gridded area of the Notes d) a Cmd+A and Cmd+K deletes the proper gridded section of the note track but leaves the non-gridded notes e) these non-gridded standed notes can be played f) these non-gridded standed notes cannot be selected by any means and thus cannot be deleted (except by deleting the whole track)
This is no no longer a crash-cause so probably can be reduced from P1. But it's still a bit embarrassing for one of our new 2.2.0 headline Features. But it's definitely not a regression - the same crash occurs in 2.1.3 and 2.1.2
(In reply to Peter Sampson from comment #3) Peter wrote: > But when pasting to the time space prior to the time shifted MIDI Note track: On Linux, the notes / tempo slows. The "bar lines" become very widely spaced, with erratic spacing. Undo the paste works as expected, but if I then "redo" ("Ctrl + Shift + Z" or "Edit menu > Redo") Audacity crashes. audacity: ../../../lib-src/portsmf/allegro.h:579: void Serial_read_buffer::check_input_buffer(long int): Assertion `get_posn() + needed <= len' failed. Aborted (core dumped)
(In reply to Steve Daulton from comment #5) >Undo the paste works as expected, but if I then "redo" >("Ctrl + Shift + Z" or "Edit menu > Redo") Audacity crashes. On Mac Undo and then Redo works fine (repeatedly) - no crash
Tesrting the refix cee28ab 09Sep17 on macOS Sierra 10.12.6 This now appears to work correctly on Mac. I tested 1) pasting to the right of the time shifted track - stiill works properly 2) pasting to the left of the time shifted track with sufficient space for the pasted audio 3) pasting to the left of the time shifted track with insufficient space for the pasted audio In both cased 2&3 the notes get pasted in correctly with no stretcking, any intervening space betwwen that pasted and the origial notes is filed with the note grid. All can be selected and deleted 4) also tested repeated undos and redos Looks to be fixed ok on Mac - but in the light of Steve's crash on Linux thsi must be tested on Linux before closure (and should be tested on Windows too)
Martyn tested this as ok on W10 - he wrote by email: "I have tested this on Win 10. On a previous build I see the bug, I updated and now I don't. It looks ok, I tried the same tests as Peter at Comment #7 and no crashes."
It is no longer crashing on Linux, but pasting does NOT appear to be doing the right thing. Exporting edited MIDI files is producing very strange ("wrong") results for me. This bug, as worded, can probably be closed as QUICK FIX, though the 'residual' issues that I'm seeing still appear to be high priority.
(In reply to Steve Daulton from comment #9) The case described in comment 9 is fixed at: https://github.com/audacity/audacity/commit/4a0fbf83af2940d473dfab32aa913162cd71737d This should be tested for region selections entirely left of the note track, and for regions beginning left but ending in the track.
Testing on W10 audacity-win-4a0fbf8-2.2.0-beta-26Sep17 and on macOS Sierra 10.12.6 4a0fbf8 27Sep17 With a note track that starts after zero I can select from withn the note track, copy that selection and than paste it either after the existing Note track with no crashing. Therefore I am going to mark this bug as resolved. ---------------------------------------------- However ther may well be reamining some odd Note trarack pasting behaviors - but they, whn identified, not form part of thsi P1 crash bug - and thus should be reported and tracked in separate Bugzilla thread(s).