Frequent segfault that happens without doign anything in LMMS except playing the song
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 1.3k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 7
Description
Hi,
Sorry for another raw backtrace but I have the following happening randomly way to much:
```
Thread 30 "lmms::AudioEngi" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff82ffd6c0 (LWP 7869)]
0x000055555586bd28 in lmms::NotePlayHandle::updateFrequency (this=0x20) at /usr/local/src/lmms/src/core/NotePlayHandle.cpp:522
522 int masterPitch = m_instrumentTrack->m_useMasterPitchModel.value() ? Engine::getSong()->masterPitch() : 0;
(gdb) bt full
#0 0x000055555586bd28 in lmms::NotePlayHandle::updateFrequency() (this=0x20) at /usr/local/src/lmms/src/core/NotePlayHandle.cpp:522
masterPitch = 32767
baseNote = -2097165672
detune = 4.59163468e-41
instrumentPitch = -3.75851476e-37
#1 0x000055555586bffa in lmms::NotePlayHandle::updateFrequency() (this=0x7ffff2a50a48) at /usr/local/src/lmms/src/core/NotePlayHandle.cpp:553
it = 0x20
__for_range = @0x7ffff2a50b08: {> = {}, {p = {static shared_null = {ref = {atomic = {_q_value = std::atomic = { -1 }}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x7fff440519c0}, d = 0x7fff440519c0}}
__for_begin = {i = 0x7fff6c005960}
__for_end = {i = 0x7fff440519d0}
masterPitch = 0
baseNote = 57
detune = 0
instrumentPitch = 74
#2 0x000055555586bffa in lmms::NotePlayHandle::updateFrequency() (this=0x7ffff2a4ff58) at /usr/local/src/lmms/src/core/NotePlayHandle.cpp:553
it = 0x7ffff2a50a48
__for_range = @0x7ffff2a50018: {> = {}, {p = {static shared_null = {ref = {atomic = {_q_value = std::atomic = { -1 }}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x7fff441199b0}, d = 0x7fff441199b0}}
__for_begin = {i = 0x7fff4405e4d0}
__for_end = {i = 0x7fff4405e4d8}
masterPitch = 0
baseNote = 57
detune = 0
instrumentPitch = 74
#3 0x000055555586bffa in lmms::NotePlayHandle::updateFrequency() (this=0x7ffff2a511f0) at /usr/local/src/lmms/src/core/NotePlayHandle.cpp:553
it = 0x7ffff2a4ff58
__for_range = @0x7ffff2a512b0: {> = {}, {p = {static shared_null = {ref = {atomic = {_q_value = std::atomic = { -1 }}}, alloc = 0, begin = 0, end = 0, array = {0x0}}, d = 0x7fff440b6340}, d = 0x7fff440b6340}}
__for_begin = {i = 0x7fff440b6350}
__for_end = {i = 0x7fff440b6358}
masterPitch = 0
baseNote = 57
detune = 0
instrumentPitch = 74
#4 0x000055555586af5d in lmms::NotePlayHandle::play(std::array*) (this=0x7ffff2a511f0, _working_buffer=0x0) at /usr/local/src/lmms/src/core/NotePlayHandle.cpp:239
framesThisPeriod = 32767
#5 0x0000555555879143 in lmms::PlayHandle::doProcessing() (this=0x7ffff2a511f0) at /usr/local/src/lmms/src/core/PlayHandle.cpp:63
#6 0x00005555557eb962 in lmms::ThreadableJob::process() (this=0x7ffff2a511f0) at /usr/local/src/lmms/include/ThreadableJob.h:77
expected = lmms::ThreadableJob::ProcessingState::Queued
#7 0x000055555584bfa9 in lmms::InstrumentPlayHandle::play(std::array*) (this=0x555568d9c7a0, working_buffer=0x7ffff2a82c80)
at /usr/local/src/lmms/src/core/InstrumentPlayHandle.cpp:61
notePlayHandle = 0x7ffff2a511f0
constNotePlayHandle = 0x7ffff2a511f0
__for_range = @0x7fff82ffccc8: {> = {}, {p = {d = 0x7fff44091aa0}, d = 0x7fff44091aa0}}
__for_begin = {i = 0x7fff44091ab0}
__for_end = {i = 0x7fff44091ac0}
instrumentTrack = 0x7fff00eb0080
nphv = {> = {}, {p = {d = 0x7fff44091aa0}, d = 0x7fff44091aa0}}
--Type for more, q to quit, c to continue without paging--
nphsLeft = true
frames = 0
#8 0x0000555555879125 in lmms::PlayHandle::doProcessing() (this=0x555568d9c7a0) at /usr/local/src/lmms/src/core/PlayHandle.cpp:59
#9 0x00005555557eb962 in lmms::ThreadableJob::process() (this=0x555568d9c7a0) at /usr/local/src/lmms/include/ThreadableJob.h:77
expected = lmms::ThreadableJob::ProcessingState::Queued
#10 0x00005555557eb316 in lmms::AudioEngineWorkerThread::JobQueue::run() (this=0x555555c0e380 )
at /usr/local/src/lmms/src/core/AudioEngineWorkerThread.cpp:88
job = 0x555568d9c7a0
i = 2
processedJob = false
#11 0x00005555557eb651 in lmms::AudioEngineWorkerThread::run() (this=0x5555569865f0) at /usr/local/src/lmms/src/core/AudioEngineWorkerThread.cpp:178
mmThreadGuard = {}
m = { = {d_ptr = {_q_value = std::atomic = { 0x1 }}}, }
#12 0x00007ffff64cbd43 in () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff62a8044 in start_thread (arg=) at ./nptl/pthread_create.c:442
ret =
pd =
unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140735391192768, 7883113816014119873, -288, 0, 140737488343984, 140735382802432, -7883138004678679615, -7883095489330224191}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call =
#14 0x00007ffff632861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
```
LMMS 1.3.0-alpha.1.483+g67ce16777 (Debian Bookworm)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/core/NotePlayHandle.cpp at updateFrequency(), especially lines 522 and 553, then trace the callers through PlayHandle.cpp, InstrumentPlayHandle.cpp, and AudioEngineWorkerThread.cpp. Use the supplied backtrace and reproduce playback to determine why an invalid NotePlayHandle is reached; done means playback no longer produces this segmentation fault.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- audio-video-rtc
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100