-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
Have you checked the latest release for fixes?
- Yes, I’ve tested on the latest release
Description
Expected Behavior
QGC displays a blank MAVLink page like normal and can gracefully reconnect to the autopilot without user intervention (and ideally bring back the same plot if possible).
Current Behavior
QGC crashes.
Steps To Reproduce
- Open MAVLink live plotter
- Select something to plot
- Unplug autopilot
Additional Details
Stack trace
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x4f3c62a6e260)
* frame #0: 0x000000010a6b777c QtCore`convertMetaObject(QMetaType, void const*, QMetaType, void*) + 270
frame #1: 0x000000010a6b6441 QtCore`QMetaType::convert(QMetaType, void const*, QMetaType, void*) + 679
frame #2: 0x000000010018aeb1 QGroundControl`QObject* qvariant_cast<QObject*>(v=0x00006000004030d0) at qvariant.h:766:5
frame #3: 0x000000010018a72f QGroundControl`MAVLinkChartController::_refreshSeries(this=0x0000600007c70000) at MAVLinkChartController.cc:136:33
frame #4: 0x000000010018bf71 QGroundControl`QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (MAVLinkChartController::*)()>::call(this=0x00007ff7bfefcb90)(), MAVLinkChartController*, void**)::'lambda'()::operator()() const at qobjectdefs_impl.h:152:24
frame #5: 0x000000010018bea9 QGroundControl`void QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (MAVLinkChartController::*)()>::call(void (MAVLinkChartController::*)(), MAVLinkChartController*, void**)::'lambda'()>(args=0x00007ff7bfefcd90, fn=0x00007ff7bfefcb90) at qobjectdefs_impl.h:65:17
frame #6: 0x000000010018be0e QGroundControl`QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (MAVLinkChartController::*)()>::call(f=(QGroundControl`MAVLinkChartController::_refreshSeries() at MAVLinkChartController.cc:130), o=0x0000600007c70000, arg=0x00007ff7bfefcd90) at qobjectdefs_impl.h:151:13
frame #7: 0x000000010018bd7d QGroundControl`void QtPrivate::FunctionPointer<void (MAVLinkChartController::*)()>::call<QtPrivate::List<>, void>(f=(QGroundControl`MAVLinkChartController::_refreshSeries() at MAVLinkChartController.cc:130), o=0x0000600007c70000, arg=0x00007ff7bfefcd90) at qobjectdefs_impl.h:199:13
frame #8: 0x000000010018bca1 QGroundControl`QtPrivate::QCallableObject<void (MAVLinkChartController::*)(), QtPrivate::List<>, void>::impl(which=1, this_=0x0000600001dfc720, r=0x0000600007c70000, a=0x00007ff7bfefcd90, ret=0x0000000000000000) at qobjectdefs_impl.h:570:21
frame #9: 0x000000010a6da61f QtCore`void doActivate<false>(QObject*, int, void**) + 1340
frame #10: 0x000000010a6eb538 QtCore`QTimer::timerEvent(QTimerEvent*) + 128
frame #11: 0x000000010a6d42ea QtCore`QObject::event(QEvent*) + 418
frame #12: 0x0000000106bdc88e QtWidgets`QApplicationPrivate::notify_helper(QObject*, QEvent*) + 228
frame #13: 0x0000000106bdd78a QtWidgets`QApplication::notify(QObject*, QEvent*) + 526
frame #14: 0x000000010a69bab0 QtCore`QCoreApplication::notifyInternal2(QObject*, QEvent*) + 160
frame #15: 0x000000010a7e72dc QtCore`QTimerInfoList::activateTimers() + 556
frame #16: 0x000000010c76b4a9 libqcocoa.dylib`QCocoaEventDispatcherPrivate::activateTimersSourceCallback(void*) + 391
frame #17: 0x00007ff80832cc00 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
frame #18: 0x00007ff80832cba2 CoreFoundation`__CFRunLoopDoSource0 + 157
frame #19: 0x00007ff80832c9c9 CoreFoundation`__CFRunLoopDoSources0 + 311
frame #20: 0x00007ff80832b5c6 CoreFoundation`__CFRunLoopRun + 973
frame #21: 0x00007ff80832abc2 CoreFoundation`CFRunLoopRunSpecific + 536
frame #22: 0x00007ff813e0b0d4 HIToolbox`RunCurrentEventLoopInMode + 281
frame #23: 0x00007ff813e0df97 HIToolbox`ReceiveNextEventCommon + 499
frame #24: 0x00007ff813f9719a HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 63
frame #25: 0x00007ff80bd91e2d AppKit`_DPSNextEvent + 912
frame #26: 0x00007ff80c81fd27 AppKit`-[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1263
frame #27: 0x00007ff80bd82f19 AppKit`-[NSApplication run] + 610
frame #28: 0x000000010c76c174 libqcocoa.dylib`QCocoaEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 2390
frame #29: 0x000000010a6a294b QtCore`QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 411
frame #30: 0x000000010a69bfe8 QtCore`QCoreApplication::exec() + 196
frame #31: 0x00000001001484f3 QGroundControl`main(argc=1, argv=0x00007ff7bfeff4e0) at main.cc:220:24
frame #32: 0x00007ff807e9e530 dyld`start + 3056
I looked into this a bit and it looks like the QGCMAVLinkMessageFields referenced in MAVLinkChartController::_chartFields get deleted, then you get a use after free in MAVLinkChartController::_refreshSeries(). Not sure how to address this properly, and figure the devs can do it much better and faster than I could. Maybe stop the update timer or delete plots alongside the event that triggers the deletion of the message field objects. If something could be added to restore the state of the plots on reconnection that would be nice, but seems annoying to implement.
I've run into this a lot while messing with the ArduPilot firmware since it disconnects every time I upload a new version.
System Information
- QGC version: 5.0.3
- QGC build: from source
- Operating system: macOS 15.5 (x64)
- Flight controller: Pixhawk 6X
- Autopilot software: ArduPlane 4.6.0
Log Files and Screenshots
No response