Open Gregaras opened 1 year ago
@Gregaras Why did you delete this? This bug is still unfixed and in master currently.
Ok, I will restore it.
The problem occurs on this line and it might be a threading problem (at least it feels like one). It seems that two different threads access m_notes
.
I have changed the code as follows:
case MidiNoteOff:
{
auto key = event.key();
auto * nph = m_notes[key];
if( nph != nullptr )
{
// do actual note off and remove internal reference to NotePlayHandle (which itself will
// be deleted later automatically)
Engine::audioEngine()->requestChangeInModel();
m_notes[event.key()]->noteOff( offset );
// ... Snip ... //
}
eventHandled = true;
break;
}
At the time of the crash nph
is not nullptr
. However when m_notes
is accessed all its fields are nullptr
. So before entering the if
condition m_notes
holds a value that is not nullptr
but then it is removed.
@michaelgregorius is there a PR for this yet ?
No, @luzpaz. I'll leave this to someone with more knowledge about the internals of the engine.
OS: GNU/Linux Distribution: Manjaro
Bug Summary
Crash (segfault) related to instruments that are connected through MIDI inputs/outputs.
Steps to reproduce
128:0 LMMS:first
)Expected behavior
No crash.
Actual behavior
Crash, segmentation fault.
Screenshot
Affected LMMS versions (versions in which crash happens)
LMMS 1.3.0-alpha.1.278+gfb529a19c
(master) (logs are from this version)LMMS 1.2.2
(appimage)LMMS 1.3.0-alpha.1.102+g89fc6c9
(appimage)Logs