LMMS / lmms

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

Crash when closing #2633

Closed tresf closed 6 years ago

tresf commented 8 years ago

May only happen with DummyAudio, but no user-way to change it, since closing it crashes and the ~.lmmsrc.xml file never gets written, so I consider this critical as it potentially makes master branch unusable on Mac to the average user.

I haven't provided a stack trace because I feel the OS provided one has enough information to investigate this.

Edit: Switching audio device to PortAudio/CoreAudio causes the crash to occur in a different place with a different backtrace, so this may not be specifically related to stopProcessing but rather to some free() memory call somewhere. A full backtrace is most likely needed here for proper investigation.

Apple provided crash report:

Crashed Thread:        8  QThread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
abort() called
*** error for object 0x7f95c2ea5510: pointer being freed was not allocated

Thread 0:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff8c9cddb6 __psynch_cvwait + 10
1   libsystem_pthread.dylib         0x00007fff8c869728 _pthread_cond_wait + 767
2   QtCore                          0x00000001047d740f QWaitConditionPrivate::wait_relative(unsigned long) + 287
3   QtCore                          0x00000001047d724b QWaitConditionPrivate::wait(unsigned long) + 43
4   QtCore                          0x00000001047d7122 QWaitCondition::wait(QMutex*, unsigned long) + 162
5   QtCore                          0x00000001047d68ee QThread::wait(unsigned long) + 110
6   io.lmms                         0x000000010358aea6 AudioDummy::stopProcessing() + 38
7   io.lmms     [...]
tresf commented 8 years ago

Came across this comment while working on another bug. May be related to the crash: https://github.com/LMMS/lmms/pull/2339#issuecomment-139929668

lukas-w commented 8 years ago

Trying this on Linux, I get a crash when closing with DummyAudio in line AudioDummy.h#L104

tresf commented 8 years ago

Changing title as this affects multiple OSs.

tresf commented 8 years ago

Although this was automatically closed by #2793... when testing an unrelated PR which included this commit, Mac still had a hard crash when closing.

Reopening. Someone with a Mac, please provide a backtrace with latest master. If not, it'll have to wait for me to provide one.

simonvanderveldt commented 8 years ago

@tresf I can probably get a backtrace for this. Is there a debug build straight from master available anywhere (is there CI in place?)?

teeberg commented 8 years ago

Here's the stacktrace from Mac OS' (10.11.6) crash reporter when running with the dummy audio interface:

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT

Application Specific Information:
objc_msgSend() selector name: lock

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                 0x00007fff93d544e9 objc_msgSend + 41
1   com.apple.AppKit                0x00007fff8fbd4e43 -[NSWindow dealloc] + 798
2   QtGui                           0x0000000107e8d3a6 -[QCocoaWindow dealloc] + 77
3   com.apple.AppKit                0x00007fff8f95c637 -[NSWindow release] + 190
4   QtGui                           0x0000000107e8136c QWidget::destroy(bool, bool) + 814
5   QtGui                           0x0000000107f1397b QWidget::~QWidget() + 903
6   lmms                            0x0000000107cea6ae SideBarButton::~SideBarButton() + 14
7   QtGui                           0x0000000107f24ca6 QWidgetAction::~QWidgetAction() + 246
8   QtGui                           0x0000000107f24d2f QWidgetAction::~QWidgetAction() + 15
9   QtCore                          0x0000000108b4573f QObjectPrivate::deleteChildren() + 93
10  QtGui                           0x0000000107f13952 QWidget::~QWidget() + 862
11  lmms                            0x0000000107cea327 SideBar::~SideBar() + 87
12  QtCore                          0x0000000108b4573f QObjectPrivate::deleteChildren() + 93
13  QtGui                           0x0000000107f13952 QWidget::~QWidget() + 862
14  QtGui                           0x0000000107f13e31 QWidget::~QWidget() + 15
15  QtCore                          0x0000000108b4573f QObjectPrivate::deleteChildren() + 93
16  QtGui                           0x0000000107f13952 QWidget::~QWidget() + 862
17  QtGui                           0x0000000107f13e31 QWidget::~QWidget() + 15
18  QtCore                          0x0000000108b4573f QObjectPrivate::deleteChildren() + 93
19  QtGui                           0x0000000107f13952 QWidget::~QWidget() + 862
20  lmms                            0x0000000107c8ad09 MainWindow::~MainWindow() + 457
21  lmms                            0x0000000107c8ad4e MainWindow::~MainWindow() + 14
22  QtCore                          0x0000000108b45cea QObject::event(QEvent*) + 686
23  QtGui                           0x0000000107f1f799 QWidget::event(QEvent*) + 3509
24  QtGui                           0x000000010823febf QMainWindow::event(QEvent*) + 827
25  QtGui                           0x0000000107edc55e QApplicationPrivate::notify_helper(QObject*, QEvent*) + 194
26  QtGui                           0x0000000107edeeb4 QApplication::notify(QObject*, QEvent*) + 6146
27  QtCore                          0x0000000108b354f6 QCoreApplication::notifyInternal(QObject*, QEvent*) + 118
28  QtCore                          0x0000000108b35e69 QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 599
29  com.apple.CoreFoundation        0x00007fff98fdd881 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
30  com.apple.CoreFoundation        0x00007fff98fbcfbc __CFRunLoopDoSources0 + 556
31  com.apple.CoreFoundation        0x00007fff98fbc4df __CFRunLoopRun + 927
32  com.apple.CoreFoundation        0x00007fff98fbbed8 CFRunLoopRunSpecific + 296
33  com.apple.HIToolbox             0x00007fff92573935 RunCurrentEventLoopInMode + 235
34  com.apple.HIToolbox             0x00007fff92573677 ReceiveNextEventCommon + 184
35  com.apple.HIToolbox             0x00007fff925735af _BlockUntilNextEventMatchingListInModeWithFilter + 71
36  com.apple.AppKit                0x00007fff8f948df6 _DPSNextEvent + 1067
37  com.apple.AppKit                0x00007fff8f948226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
38  com.apple.AppKit                0x00007fff8f93cd80 -[NSApplication run] + 682
39  QtGui                           0x0000000107e99ace QEventDispatcherMac::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 1496
40  QtCore                          0x0000000108b32bc7 QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 77
41  QtCore                          0x0000000108b32d41 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 365
42  QtCore                          0x0000000108b3594b QCoreApplication::exec() + 199
43  lmms                            0x0000000107bee6d1 main + 14913
44  libdyld.dylib                   0x00007fff8ea0a5ad start + 1

Is that what you were looking for?

miketurn commented 7 years ago

Sorry if I am calling out somethings that is known, but this topic is a little confusing. It appears that this thread is calling out an error on Mac systems that occurs when closing LMMS 1.2.0 RC. At the bottom of this thread it shows that a different post #3104 has been closed because it is a duplicate, but that one is stating that it is happening in Windows 7. I was not able to get LMMS version 1.2.0 RC1 (32Bit) to work on my PC (Windows 7 64Bit) at all (instant close error), but the other day I was able to get it to work on a labtop (Windows 7 64Bit). Problem is I am getting the same issue on Windows found in #3104. I am sure it is, but I am just making sure that it is known that it is not just on Mac OS systems. Thank You

tresf commented 7 years ago

I am just making sure that it is known that it is not just on Mac OS systems.

Yes we are aware, thank you. We believe the Windows issue to be resolved, but we can track it here if it resurfaces in RC2.

musikBear commented 7 years ago

so sorry to do this 1.2.0 RC2 win32 xp closecrash I must have closed ~100 times before that one happened. In respect to this close-down-bug, 1.2 is the most reliable version to date! But it did it.. darn :/ It however did not leave a orphan lmms process running. So after clicking the 'dont-tell-ms' button, a full close process did take place! Unfortunately, i did not have any vst in this project, so i cant say if those would have stayed.

musikBear commented 7 years ago

Have anyone had the popup with rc3? I have even tried to force it by x-shutting down during playback. I just dont get it with rc3. win32 xp Precise ver: rc3version

tresf commented 7 years ago

I still get it about 20% of the time closing LMMS on MacOS

musikBear commented 7 years ago

@tresf .. darn. so MAC is still problematic, but it looks much better for windows, at least here. Linux?

irrenhaus3 commented 7 years ago

Since no linux reports came in so far, let me assist. I'm not a particularly heavy-duty user, but since coming across this issue, I've been paying attention to the behavior of 1.2, especially upon exit. I haven't experienced any crashes in regular usage (without a MIDI controller in use). Quitting the program after letting it sit idle for a while works fine, as does quitting during playback of a 18-track project. So I assume that there aren't any particularly nasty memory leaks or cleanup issues around.

Addendum, since it was just mentioned in Discord:
It appears that not using VST instruments in a project reduces the likelihood of crashes. So maybe the VST related PRs that are going on at the moment may help fix this particular problem as well. :smile:

tresf commented 7 years ago

@irrenhaus3 that's a good theory however as the creator of this bug report and a Mac user, I can confirm this still happens rather frequently and Mac doesn't support VST yet.

Since the crash logs specify AudioDummy this may be related to rendering actually. I will post an updated crashlog the next time this happens.

tresf commented 7 years ago

Crash logs from 1.2.0-rc3. Rendering wasn't performed this time around.

Process:               LMMS [426]
Path:                  /Applications/LMMS.app/Contents/MacOS/LMMS
Identifier:            io.lmms
Version:               1.2.0-rc3 (1.2.0-rc3)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           LMMS [426]
User ID:               501

Date/Time:             2017-09-12 00:34:20.362 -0400
OS Version:            Mac OS X 10.11.6 (15G1217)
Report Version:        11
Anonymous UUID:        9D3D5722-F43B-E5EF-E7F2-9F03ED83B956

Time Awake Since Boot: 37000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   QtGui                           0x000000010240f4a8 typeinfo name for QMovie + 28
1   QtWidgets                       0x0000000101793e71 0x101602000 + 1646193
2   QtWidgets                       0x0000000101788c00 0x101602000 + 1600512
3   QtWidgets                       0x00000001017893fe 0x101602000 + 1602558
4   QtCore                          0x00000001027aa789 QObjectPrivate::deleteChildren() + 201
5   QtWidgets                       0x0000000101661fd2 QWidget::~QWidget() + 1410
6   io.lmms                         0x000000010148ee3f SubWindow::~SubWindow() + 47
7   QtCore                          0x00000001027aa789 QObjectPrivate::deleteChildren() + 201
8   QtWidgets                       0x0000000101661fd2 QWidget::~QWidget() + 1410
9   QtWidgets                       0x00000001016629fe QWidget::~QWidget() + 14
10  QtCore                          0x00000001027aa789 QObjectPrivate::deleteChildren() + 201
11  QtWidgets                       0x0000000101661fd2 QWidget::~QWidget() + 1410
12  QtWidgets                       0x00000001017832cf QMdiArea::~QMdiArea() + 159
13  QtCore                          0x00000001027aa789 QObjectPrivate::deleteChildren() + 201
14  QtWidgets                       0x0000000101661fd2 QWidget::~QWidget() + 1410
15  QtWidgets                       0x00000001017b8b3e QSplitter::~QSplitter() + 14
16  QtCore                          0x00000001027aa789 QObjectPrivate::deleteChildren() + 201
17  QtWidgets                       0x0000000101661fd2 QWidget::~QWidget() + 1410
18  QtWidgets                       0x00000001016629fe QWidget::~QWidget() + 14
19  QtCore                          0x00000001027aa789 QObjectPrivate::deleteChildren() + 201
20  QtWidgets                       0x0000000101661fd2 QWidget::~QWidget() + 1410
21  QtWidgets                       0x00000001016629fe QWidget::~QWidget() + 14
22  QtCore                          0x00000001027aa789 QObjectPrivate::deleteChildren() + 201
23  QtWidgets                       0x0000000101661fd2 QWidget::~QWidget() + 1410
24  io.lmms                         0x00000001013e3e87 MainWindow::~MainWindow() + 519
25  io.lmms                         0x00000001013e3ece MainWindow::~MainWindow() + 14
26  QtCore                          0x00000001027aaec0 QObject::event(QEvent*) + 128
27  QtWidgets                       0x0000000101673894 QWidget::event(QEvent*) + 5476
28  QtWidgets                       0x000000010177410a QMainWindow::event(QEvent*) + 1658
29  QtWidgets                       0x000000010163403b QApplicationPrivate::notify_helper(QObject*, QEvent*) + 251
30  QtWidgets                       0x0000000101635551 QApplication::notify(QObject*, QEvent*) + 433
31  QtCore                          0x0000000102783a95 QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 1029
32  libqcocoa.dylib                 0x00000001070f5ede 0x1070d4000 + 138974
33  libqcocoa.dylib                 0x00000001070f6771 0x1070d4000 + 141169
34  com.apple.CoreFoundation        0x00007fff8a16f7e1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
35  com.apple.CoreFoundation        0x00007fff8a14ef1c __CFRunLoopDoSources0 + 556
36  com.apple.CoreFoundation        0x00007fff8a14e43f __CFRunLoopRun + 927
37  com.apple.CoreFoundation        0x00007fff8a14de38 CFRunLoopRunSpecific + 296
38  com.apple.HIToolbox             0x00007fff8afcc935 RunCurrentEventLoopInMode + 235
39  com.apple.HIToolbox             0x00007fff8afcc677 ReceiveNextEventCommon + 184
40  com.apple.HIToolbox             0x00007fff8afcc5af _BlockUntilNextEventMatchingListInModeWithFilter + 71
41  com.apple.AppKit                0x00007fff94783df6 _DPSNextEvent + 1067
42  com.apple.AppKit                0x00007fff94783226 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
43  com.apple.AppKit                0x00007fff94777d80 -[NSApplication run] + 682
44  libqcocoa.dylib                 0x00000001070f5515 0x1070d4000 + 136469
45  QtCore                          0x000000010277fefd QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 429
46  QtCore                          0x0000000102783027 QCoreApplication::exec() + 343
47  io.lmms                         0x000000010131dc50 main + 11984
48  libdyld.dylib                   0x00007fff8ccb95ad start + 1

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00007fff8f592efa kevent_qos + 10
1   libdispatch.dylib               0x00007fff8f106165 _dispatch_mgr_invoke + 216
2   libdispatch.dylib               0x00007fff8f105dcd _dispatch_mgr_thread + 52

Thread 2:: com.apple.NSEventThread
0   libsystem_kernel.dylib          0x00007fff8f58bf72 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8f58b3b3 mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff8a14f124 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff8a14e5ec __CFRunLoopRun + 1356
4   com.apple.CoreFoundation        0x00007fff8a14de38 CFRunLoopRunSpecific + 296
5   com.apple.AppKit                0x00007fff948d9d95 _NSEventThread + 149
6   libsystem_pthread.dylib         0x00007fff89b1399d _pthread_body + 131
7   libsystem_pthread.dylib         0x00007fff89b1391a _pthread_start + 168
8   libsystem_pthread.dylib         0x00007fff89b11351 thread_start + 13

Thread 3:
0   libsystem_kernel.dylib          0x00007fff8f58bfc6 semaphore_timedwait_trap + 10
1   libdispatch.dylib               0x00007fff8f10bc67 _dispatch_semaphore_wait_slow + 149
2   libdispatch.dylib               0x00007fff8f105d1b _dispatch_worker_thread + 148
3   libsystem_pthread.dylib         0x00007fff89b1399d _pthread_body + 131
4   libsystem_pthread.dylib         0x00007fff89b1391a _pthread_start + 168
5   libsystem_pthread.dylib         0x00007fff89b11351 thread_start + 13

Thread 4:
0   libsystem_kernel.dylib          0x00007fff8f58bf72 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8f58b3b3 mach_msg + 55
2   com.apple.audio.midi.CoreMIDI   0x0000000101fedbb7 XServerMachPort::ReceiveMessage(int&, void*, int&) + 125
3   com.apple.audio.midi.CoreMIDI   0x0000000102009095 MIDIProcess::RunMIDIInThread() + 135
4   com.apple.audio.midi.CoreMIDI   0x0000000101feed02 XThread::RunHelper(void*) + 10
5   com.apple.audio.midi.CoreMIDI   0x0000000101fee92e CAPThread::Entry(CAPThread*) + 80
6   libsystem_pthread.dylib         0x00007fff89b1399d _pthread_body + 131
7   libsystem_pthread.dylib         0x00007fff89b1391a _pthread_start + 168
8   libsystem_pthread.dylib         0x00007fff89b11351 thread_start + 13

Thread 5:
0   libsystem_kernel.dylib          0x00007fff8f5925e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff89b13578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff89b11341 start_wqthread + 13

Thread 6:
0   libsystem_kernel.dylib          0x00007fff8f5925e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff89b13578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff89b11341 start_wqthread + 13

Thread 7:
0   libsystem_kernel.dylib          0x00007fff8f5925e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff89b13578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff89b11341 start_wqthread + 13

Thread 8:
0   libsystem_kernel.dylib          0x00007fff8f5925e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff89b13578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff89b11341 start_wqthread + 13

Thread 9:
0   libsystem_kernel.dylib          0x00007fff8f5925e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff89b13578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff89b11341 start_wqthread + 13

Thread 10:
0   libsystem_kernel.dylib          0x00007fff8f5925e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff89b13578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff89b11341 start_wqthread + 13

Thread 11:
0   libsystem_kernel.dylib          0x00007fff8f5925e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff89b13578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff89b11341 start_wqthread + 13

Thread 12:
0   libsystem_kernel.dylib          0x00007fff8f5925e2 __workq_kernreturn + 10
1   libsystem_pthread.dylib         0x00007fff89b13578 _pthread_wqthread + 1283
2   libsystem_pthread.dylib         0x00007fff89b11341 start_wqthread + 13

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x00000001024ca500  rbx: 0x00007f83582bc420  rcx: 0x00007f83534ebc50  rdx: 0x0000000000168d10
  rdi: 0x00007f83582bbc00  rsi: 0x0000000000000000  rbp: 0x00007fff5e8e80a0  rsp: 0x00007fff5e8e8088
   r8: 0x000000000000003f   r9: 0x00007f8358259760  r10: 0x00000000216b8609  r11: 0x00007f8358200000
  r12: 0x00007f83582b5750  r13: 0x0000000000000118  r14: 0x00007f83582bc5b0  r15: 0x00007f83582b5800
  rip: 0x000000010240f4a8  rfl: 0x0000000000010206  cr2: 0x00000001017298d0

Logical CPU:     0
Error Code:      0x00000000
Trap Number:     6

Binary Images:
<removed to shorten logs>
tresf commented 7 years ago

Ok... I was having a hard time reproducing this until I closed it from the taskbar. Perhaps this sheds some light. Closing it from the "X" in the upper left wasn't causing the crash to occur.

lldb backtrace available:

* thread #1: tid = 0x129e70, 0x00000001004ffc1e QtGui`___lldb_unnamed_symbol2427$$QtGui + 86, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x9)
  * frame #0: 0x00000001004ffc1e QtGui`___lldb_unnamed_symbol2427$$QtGui + 86
    frame #1: 0x00000001004cfe92 QtGui`QWidgetPrivate::deleteExtra() + 182
    frame #2: 0x00000001004cfa9e QtGui`QWidgetPrivate::~QWidgetPrivate() + 62
    frame #3: 0x000000010081b71e QtGui`___lldb_unnamed_symbol7826$$QtGui + 378
    frame #4: 0x000000010081a899 QtGui`___lldb_unnamed_symbol7800$$QtGui + 15
    frame #5: 0x0000000100fc73b2 QtCore`QObject::~QObject() + 1470
    frame #6: 0x00000001004d2eeb QtGui`QWidget::~QWidget() + 1031
    frame #7: 0x000000010018befb lmms`SubWindow::~SubWindow(this=0x00000001160f3f30) + 75 at SubWindow.h:44
    frame #8: 0x000000010018b695 lmms`SubWindow::~SubWindow(this=0x00000001160f3f30) + 21 at SubWindow.h:44
    frame #9: 0x000000010018b6b9 lmms`SubWindow::~SubWindow(this=0x00000001160f3f30) + 25 at SubWindow.h:44
    frame #10: 0x0000000100fc7566 QtCore`QObjectPrivate::deleteChildren() + 94
    frame #11: 0x00000001004d2e50 QtGui`QWidget::~QWidget() + 876
    frame #12: 0x00000001004d333d QtGui`QWidget::~QWidget() + 15
    frame #13: 0x0000000100fc7566 QtCore`QObjectPrivate::deleteChildren() + 94
    frame #14: 0x00000001004d2e50 QtGui`QWidget::~QWidget() + 876
    frame #15: 0x000000010080c7b9 QtGui`QMdiArea::~QMdiArea() + 15
    frame #16: 0x0000000100fc7566 QtCore`QObjectPrivate::deleteChildren() + 94
    frame #17: 0x00000001004d2e50 QtGui`QWidget::~QWidget() + 876
    frame #18: 0x00000001008369f9 QtGui`QSplitter::~QSplitter() + 15
    frame #19: 0x0000000100fc7566 QtCore`QObjectPrivate::deleteChildren() + 94
    frame #20: 0x00000001004d2e50 QtGui`QWidget::~QWidget() + 876
    frame #21: 0x00000001004d333d QtGui`QWidget::~QWidget() + 15
    frame #22: 0x0000000100fc7566 QtCore`QObjectPrivate::deleteChildren() + 94
    frame #23: 0x00000001004d2e50 QtGui`QWidget::~QWidget() + 876
    frame #24: 0x00000001004d333d QtGui`QWidget::~QWidget() + 15
    frame #25: 0x0000000100fc7566 QtCore`QObjectPrivate::deleteChildren() + 94
    frame #26: 0x00000001004d2e50 QtGui`QWidget::~QWidget() + 876
    frame #27: 0x00000001000d464e lmms`MainWindow::~MainWindow(this=0x0000000101f70c10) + 414 at MainWindow.cpp:232
    frame #28: 0x00000001000d4695 lmms`MainWindow::~MainWindow(this=0x0000000101f70c10) + 21 at MainWindow.cpp:218
    frame #29: 0x00000001000d46d9 lmms`MainWindow::~MainWindow(this=0x0000000101f70c10) + 25 at MainWindow.cpp:218
    frame #30: 0x0000000100fc7b39 QtCore`QObject::event(QEvent*) + 725
    frame #31: 0x00000001004def8c QtGui`QWidget::event(QEvent*) + 3844
    frame #32: 0x00000001007ff06c QtGui`QMainWindow::event(QEvent*) + 804
    frame #33: 0x000000010049b372 QtGui`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 194
    frame #34: 0x000000010049d941 QtGui`QApplication::notify(QObject*, QEvent*) + 5205
    frame #35: 0x0000000100fb6e66 QtCore`QCoreApplication::notifyInternal(QObject*, QEvent*) + 118
    frame #36: 0x0000000100fb7801 QtCore`QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) + 625
    frame #37: 0x0000000100fb7318 QtCore`QCoreApplication::exec() + 288
    frame #38: 0x00000001000085f7 lmms`main(argc=1, argv=0x00007fff5fbffb28) + 10007 at main.cpp:925
    frame #39: 0x00007fff8601f5ad libdyld.dylib`start + 1
    frame #40: 0x00007fff8601f5ad libdyld.dylib`start + 1
lukas-w commented 7 years ago

I also get this backtrace occasionally. The QHash instance is probably the one in embed.cpp.

1  QImageReader::read(QImage *)                                                                  0x100ffe863    
2  QImageReader::read()                                                                          0x100ffe80a    
3  QPlatformPixmap::fromImageReader(QImageReader *, QFlags<Qt::ImageConversionFlag>)             0x101012fef    
4  QPixmap::~QPixmap()                                                                           0x10100d1fa    
5  QHashNode<QString, QPixmap>::~QHashNode()                                         qhash.h 149 0x1000d6a43    
6  QHashNode<QString, QPixmap>::~QHashNode()                                         qhash.h 149 0x1000d6a15    
7  QHash<QString, QPixmap>::deleteNode2(QHashData::Node *)                           qhash.h 536 0x1000d69cd    
8  QHashData::free_helper(void ( *)(QHashData::Node *))                                          0x1014e6f59    
9  QHash<QString, QPixmap>::freeData(QHashData *)                                    qhash.h 576 0x1000d69a3    
10 QHash<QString, QPixmap>::~QHash()                                                 qhash.h 254 0x1000d697a    
11 QHash<QString, QPixmap>::~QHash()                                                 qhash.h 254 0x1000d60d5    
12 __cxa_finalize_ranges                                                                         0x7fffa25e1178 
13 exit                                                                                          0x7fffa25e14b2 
14 start                                                                                         0x7fffa254c23c 
vwren commented 7 years ago

Using 1.2.0-RC4, I get a zombie process every time I close and re-start LMMS on the WIN32 version (W7). There's no errors displayed—just a process in the task manager that can't be killed. I first noticed it because if I do a save then quit before the "File was saved" message box closes, that message box will not leave the desktop EVER (at least until reboot). This seems to happen no matter what audio back-end I'm using (even dummy). I don't know enough about compiling on PCs to build a debugging version (if such even works). The task manager gives me the option of doing a core dump, but I have no idea if that would be in any way useful.

lmms_zombie_process

(UPDATE: I thought it might have been because I had an ASIO version of libportaudio-2, but I changed it back to the default installed version and it made no difference).

musikBear commented 7 years ago

@vwren have you tried to shut completely down -not sleep, and then restart? Then try open lmms and shut it down, normally. Do you have a lmms process running in TM then? -Cant reproduce on win32 xp rc4

vwren commented 7 years ago

@musikBear a full S5 restart is the way I've been getting rid of the zombie processes, though logging my user off should technically be enough to dump all processes running under my username (I haven't tried it). I get this first thing in the morning, which is an S5+G3 restart (I don't use Sleep or Hibernate)

Since you're not having a problem, (Albeit XP is essentially Windows NT, where Windows 7/Vista is quite a bit different under the hood), I wanted to be sure there was nothing left over from my 1.1.3 install, so I uninstalled RC4, deleted the Program Files\LMMS directory (I noticed that uninstall leaves behind the QT5 dlls), rebooted, and reinstalled RC4 from scratch. It's still leaving zombies.

The only other thing I can think to do is go through the Registry and delete all trace of LMMS before reinstalling, because I noticed that the new install retains the 1.1.3 file paths (not a great upgrade path from 1.1.3 if Registry cleaning is necessary). I am shutting down LMMS by hitting the "X" button, but using the File/Quit menu does the same thing. I also deleted the few VST plugins that I added, all from the "safe" list (even though there are no VST instruments active). Still getting zombies. Weird if I'm the only one, but since it gives no error messages, more people might be getting them and never know it if they don't check the task manager.

lmms_task_manager

tresf commented 7 years ago

@vwren does this occur when you use DummyAudio as the backend? This may be a separate issue and I recommend we track it as such. That said, we need someone to reproduce on similar OS and hardware. I don't mean to sound like a broken record, but if you're running an SSD, scan it for errors, worn bits can cause the strangest of problems with Windows processes and it happens on two of my machines semi-annually.

vwren commented 7 years ago

I wanted to make sure I was running clean, so I wiped everything off, including any registry mentions of LMMS, and installed 1.2.0RC4 from scratch. I think this is a driver-related issue. Interestingly enough, it's not sound-related. If I put the audio to dummy, it still hangs. If I point the MIDI to dummy, however, it does not hang. I'm using an M-Audio MIDISport 2+2 (the original ugly green one). The only options in the drop-down are Dummy and WinMM. I'm going to try upgrading the MIDISport driver from 6.1.2 to 6.1.3 (the last available)

UPDATE: Nope. Going to 6.1.3 makes no difference. It's a problem with WinMM.

follower commented 6 years ago

In relation to the "crash on close" issue in general, I recently noticed the following recommendation in the QApplication::exec() documentation:

We recommend that you connect clean-up code to the aboutToQuit() signal, instead of putting it in your application's main() function. This is because, on some platforms the QApplication::exec() call may not return. For example, on the Windows platform, when the user logs off, the system terminates the process after Qt closes all top-level windows. Hence, there is no guarantee that the application will have time to exit its event loop and execute code at the end of the main() function, after the QApplication::exec() call.

It would appear LMMS doesn't currently follow this advice:

https://github.com/LMMS/lmms/blob/9d317e158e09fb236da7bb75f81218d715e5dd2f/src/core/main.cpp#L966-L980

Could be worth trying out the aboutToQuit() approach to see if it makes any difference.

(I don't know if any of the code that appears after app->exec() is likely to be affected by this or not...)

zonkmachine commented 6 years ago

Possible duplicate here: https://github.com/LMMS/lmms/issues/3357 Crash on exit in MidiPort.cpp (backtrace). Edit: Setting MIDI to dummy as above doesn't prevent this crash.

tresf commented 6 years ago

Although this was automatically closed by #2793... when testing an unrelated PR which included this commit, Mac still had a hard crash when closing.

Closing as duplicate of #3357 since this problem seems to be isolated to macOS now.