LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
7.81k stars 987 forks source link

Crashes with VST plugins that dynamically change parameter count #6064

Open musikBear opened 3 years ago

musikBear commented 3 years ago

Bug Summary

If more than 8 bands are created in REAeq, the project crashes instead of saving

Steps to reproduce

My setup was REAeq on MASTER in FX. After adding band 9 lmms crash when save is pressed. No warning

Actual behavior

Band 9+ can be added and influence the output as expected, but if the project is 'saved', it just shuts down.

Screenshot

image

Affected LMMS versions

1.2.2 off. win10 64b

musikBear commented 3 years ago

( cant add this to report ) I then decided to try and see if the crash was exclusively for manual saving. It is not! Autosave after Set time in Settings also crashes lmms, when a autosave is performed under the condition above

Monospace-V commented 3 years ago

Not only 9 bands. I tried further crashing, and at some point it started crashing with 4 bands, 5 bands, etc. And to be sure, I did these tests on a fresh project. However, this was with reaEQ on instruments, with two instruments and thus two instances of reaEQ. When I say 4 bands 5 bands etc, I mean total no. of bands combined.

Monospace-V commented 2 years ago

Forgot about this issue: I have a little more information on this. When the project-wide number of bands on ReaEQ is a multiple of five, then the project crashes upon save. There was one exception where I could save it the first time with a project-wide band count which was a multiple of five. But when I tried changing it to a non-multiple of five and saving, it crashed each time.

This bug is slightly tricky to replicate exactly. Here are the closest instructions I can give. You will probably be able to replicate a crash between them:

  1. Create a new project and save it.

  2. Add two separate 3o instruments.

  3. Add ReaEQ to both.

  4. ReaEQ by default has four bands. (This gives us a project wide number of bands of 8.) Save the file again. (There will be no crash here. But this has to be done.)

  5. Close LMMS.

  6. Reopen the file in LMMS.

  7. Add two bands to any instance of ReaEQ. (This gives us a project-wide number of bands of ten.)

  8. Save file. (If your file, perchance, does not crash here, it will crash on step 11.)

If it does not crash, follow steps 9 through 12.

  1. Close LMMS.
  2. Reopen file in LMMS.
  3. Change the number of bands on any of the instruments' ReaEQ instances, in such a way that the new total number of bands is no longer a multiple of five. ie, add or delete a band.
  4. Save file.

I presume the way to actually make it save is to not close LMMS between adding ReaEQ and saving with a multiple-of-five band number: ie, if you forget step 5 and follow every other step you will lead to that one exception I mentioned earlier.

Note: when I say "Close LMMS" I mean closing LMMS. Not opening a new project for the purpose of refreshing; not reopening the project from in-LMMS. A proper restart of LMMS.

PhysSong commented 2 years ago

Reproduced. The parameter count of ReaEQ VST plugins changes as the number of band changes. This is also true for some other ReaPlugs plugins such as ReaXcomp(see #6223). knobFModel member of VstEffectControls which holds models for each parameter, however, doesn't resize automatically on parameter count changes, leading to crashes due to invalid memory access.

This can be also reproduced with VeSTige because vestigeInstrument has the same issue, too.

Edit zonkmachine: fixed link

michaelgregorius commented 1 month ago

Proposal to rename this issue to "Crashes with VST plugins that dynamically change parameter count" to better reflect the results of the investigations.

musikBear commented 1 month ago

Proposal to rename this issue to "Crashes with VST plugins that dynamically change parameter count" to better reflect the results of the investigations.

Since it now is known to not be exclusive for REAeq i think that it is a valid idea, and a tittle that better targets the issue 👍 -and done.