Lmms: Ctrl+drag from song editor between instances causes crash

Created on 22 Feb 2019  路  10Comments  路  Source: LMMS/lmms

Bug seems to have been introduced in RC7.
To reproduce:

  1. Open two instances of LMMS
  2. Create a note block in one instance
  3. Ctrl+click and drag it from that instance's song editor to the other's (to copy it over)
  4. A runtime error should appear in the instance its being dragged to
    image
bug

All 10 comments

It works fine for me.

Ctrl+click and drag it from that instance's song editor to the other's (to copy it over)

For me as well with two instances of RC8 in win32 (and only 2gb ram..!)
Afaik -That is new!
Instance to instance copy, was previously only for whole tracks, now it actually do work with only one block/tco -Nice!

Should perhaps add. that even though it works, one issue exists, Opening 2. instance of LMMS will cast the 'Recover' popup. That may be confusing, but both whole track copying and single-tco copying do work in win 32 -No crash.

Related to or possible duplicate of #3862.

On discord it is mentioned that those that had crashes are on win64 and uses x64 RC8. I I have x32 -That could be explain why i have no crash.
Someone else with x32 need to retest

So I did a bit of testing and it seems to be linked to Windows' display scaling for high DPI monitors. When on default scaling, it doesn't occur, but when I use a higher scaling setting, the bug arises.

(For reference, this is the setting I'm referring to:)
image

Per Discord convo, we were able to rule-out HiDPI as the cause... this may be project-version-specific. @haicat let us know if you can provide a project file (or steps) that reproduce it.

The error is an assertion failure in QVector::at due an out-of-bounds access, which calls std::abort, displaying that dialog.

This comes from TrackContentWidget::canPasteSelection:
https://github.com/LMMS/lmms/blob/ad1fa16a9525776a19d8a760c484d0837c20d621/src/core/Track.cpp#L1391-L1397
This checks that the source track type (instrument, sample, automation, b+b) for the TCO copy operation matches the destination track type. The source track is assumed to be in the same track container in the same LMMS instance, so trackIndex should be in-bounds here. However, when copying from another LMMS instance, it is possible for the source track index to be greater than the total number of tracks in the destination instance, resulting in a crash. This can also occur without using two LMMS instances when, e.g., copying a TCO from the B+B editor to the song editor where the source track index in the B+B editor is greater than the number of tracks in the song editor.

Related to or possible duplicate of #3862.

I think it's a duplicate of #3862, too.

Did some test:
There are differences between copying from first-openedinstance (1oi), in respect to second-opened instance (2oi)!
From 1oi i can drag both whole tracks from 1oi to 2oi and single pattern-blocks -Eg there are no issues.
From 2oi i can drag whole tracks, but even contact with the border of 1oi with a pattern-block, will cause a crash in 1oi! I do not even have to release the mouse. Simple mouse-over with the dragged pattern-block crashes 1oi. The mouse-hanging pattern-block is not influenced by this crash. I can drag it right back to 2oi, and drop it there with no issue at all. Knowing this, i have to remake the first test, and see if there is a 1oi / 2oi relationseship too, with brand new files. I also have to test old->new,and new-> old

Was this page helpful?
5 / 5 - 1 ratings