QT Creator keeps crashing when run
-
I have a project using QTabWidget that crashes most times I try to run it. I have some output from debugger mode below. I am not sure what the issue is as I have not touched the code related to QWidget/QTabWidget, and I have reverted back to a commit that I marked as "working" in the past (I know this is sus but I trust myself and it seems like this issue started happening independent of code changes. or accumulated somehow, like a memory leak?)
I have restarted my machine just in case, still crashes. Any thoughts about what I can change to stop this crash from happening? It's preventing dev work. Thanks. The debugger arrow comes out on the bolded line about QTabWidget.
// groupings by project
QWidget *brushGroup = new QWidget();
QVBoxLayout *brushLayout = new QVBoxLayout();
brushLayout->setAlignment(Qt::AlignTop);
brushGroup->setLayout(brushLayout);QWidget *filterGroup = new QWidget(); QVBoxLayout *filterLayout = new QVBoxLayout(); filterLayout->setAlignment(Qt::AlignTop); filterGroup->setLayout(filterLayout); QScrollArea *controlsScroll = new QScrollArea(); **QTabWidget *tabs = new QTabWidget();** controlsScroll->setWidget(tabs); controlsScroll->setWidgetResizable(true); tabs->addTab(brushGroup, "Brush"); tabs->addTab(filterGroup, "Filter"); vLayout->addWidget(controlsScroll); // brush selection addHeading(brushLayout, "Brush"); addRadioButton(brushLayout, "Constant", settings.brushType == BRUSH_CONSTANT, [this]{ setBrushType(BRUSH_CONSTANT); }); addRadioButton(brushLayout, "Linear", settings.brushType == BRUSH_LINEAR, [this]{ setBrushType(BRUSH_LINEAR); }); addRadioButton(brushLayout, "Quadratic", settings.brushType == BRUSH_QUADRATIC, [this]{ setBrushType(BRUSH_QUADRATIC); }); addRadioButton(brushLayout, "Smudge", settings.brushType == BRUSH_SMUDGE, [this]{ setBrushType(BRUSH_SMUDGE); }); // brush parameters addSpinBox(brushLayout, "red", 0, 255, 1, settings.brushColor.r, [this](int value){ setUIntVal(settings.brushColor.r, value); });
Translated Report (Full Report Below)
Process: projects_raster [1488]
Path: /Users/USER/*/projects_raster
Identifier: projects_raster
Version: ???
Code Type: ARM-64 (Native)
Parent Process: qtcreator_processlauncher [584]
User ID: 501Date/Time: 2023-10-20 09:41:28.1433 -0400
OS Version: macOS 13.4 (22F66)
Report Version: 12
Anonymous UUID: 2AB17256-3298-5654-ED0A-BF255C4E1077Time Awake Since Boot: 580 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000Application Specific Information:
abort() calledThread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x181b04724 __pthread_kill + 8
1 libsystem_pthread.dylib 0x181b3bc28 pthread_kill + 288
2 libsystem_c.dylib 0x181a49ae8 abort + 180
3 libsystem_malloc.dylib 0x18196ae28 malloc_vreport + 908
4 libsystem_malloc.dylib 0x1819815d4 malloc_zone_error + 104
5 libsystem_malloc.dylib 0x181979148 nanov2_guard_corruption_detected + 44
6 libsystem_malloc.dylib 0x181978344 nanov2_allocate_outlined + 404
7 Foundation 0x182b4a250 NSKeyValueShareableObservationInfoNSHTHash + 152
8 Foundation 0x182b87290 _NSKeyValueObservationInfoCreateByRemoving + 540
9 Foundation 0x182b86e50 -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:] + 212
10 Foundation 0x182b86d28 -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] + 136
11 ViewBridge 0x1896245f8 -[NSViewRemoteBridge dealloc] + 148
12 ViewBridge 0x1896298e8 -[NSViewBridge release] + 368
13 ViewBridge 0x1896244e4 -[NSRemoteViewMarshal dealloc] + 104
14 ViewBridge 0x18968bce8 -[NSRemoteViewMarshal release] + 368
15 ViewBridge 0x18966e0fc -[NSRemoteView dealloc] + 348
16 ViewBridge 0x189619bd0 -[NSRemoteView release] + 368
17 libsystem_blocks.dylib 0x18186f198 _call_dispose_helpers_excp + 48
18 libsystem_blocks.dylib 0x18186ef64 _Block_release + 252
19 libsystem_blocks.dylib 0x18186f198 _call_dispose_helpers_excp + 48
20 libsystem_blocks.dylib 0x18186ef64 _Block_release + 252
21 ViewBridge 0x1896b121c LIKELY_AN_OVER_RELEASE_BUG_IN_APPLICATION_CODE + 24
22 ViewBridge 0x1896abf14 kNotRunningOnAppKitCompatibleThread_block_invoke + 560
23 CoreFoundation 0x181c1a1d4 CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 28
24 CoreFoundation 0x181c1a0e8 __CFRunLoopDoBlocks + 364
25 CoreFoundation 0x181c18f38 __CFRunLoopRun + 812
26 CoreFoundation 0x181c184b8 CFRunLoopRunSpecific + 612
27 HIToolbox 0x18b462c40 RunCurrentEventLoopInMode + 292
28 HIToolbox 0x18b4628d0 ReceiveNextEventCommon + 220
29 HIToolbox 0x18b4627d4 _BlockUntilNextEventMatchingListInModeWithFilter + 76
30 AppKit 0x184e39d44 _DPSNextEvent + 636
31 AppKit 0x184e38ee0 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
32 AppKit 0x184e2d344 -[NSApplication run] + 464
33 libqcocoa.dylib 0x1056a6600 0x105690000 + 91648
34 QtCore 0x1062155d4 QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) + 532
35 QtCore 0x10620c2e0 QCoreApplication::exec() + 112
36 projects_raster 0x104462514 main + 80 (main.cpp:10)
37 dyld 0x1817e3f28 start + 2236 -
@jakemaggieronan Your app is crashing, not QtCreator, right?
-
Hi,
Nothing obvious stands out from your code. One thing you can do is comment out everything and add back elements one after the other until the crash occurs again.
-
@SGaist Thanks, I was able to fix the issue (as in, the crash stopped happening) by editing some code in a different file. I had been confusing two data structures and using them interchangeably, causing errors. I am new at this, clearly. Thanks.
-
@jakemaggieronan glad you found out and thanks for the feed back !
Please mark the thread as solved since all is working now.