Bug 430325 - kstars segmentation faulted in DetailDialog::createGeneralTab
Summary: kstars segmentation faulted in DetailDialog::createGeneralTab
Status: RESOLVED WORKSFORME
Alias: None
Product: kstars
Classification: Applications
Component: general (show other bugs)
Version: 3.4.3
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Jasem Mutlaq
URL: https://bugzilla.redhat.com/show_bug....
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2020-12-13 04:51 UTC by Matt Fagnani
Modified: 2021-04-30 04:46 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
gdb output when run on kstars followed by the crash with the full trace (948.54 KB, text/plain)
2020-12-14 03:55 UTC, Matt Fagnani
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Fagnani 2020-12-13 04:51:45 UTC
Application: kstars (3.4.3)

Qt Version: 5.15.2
Frameworks Version: 5.75.0
Operating System: Linux 5.9.14-200.fc33.x86_64 x86_64
Windowing system: Wayland
Distribution: Fedora 33 (KDE Plasma)

-- Information about the crash:
- What I was doing when the application crashed:

I was using Plasma 5.20.4 on Wayland in Fedora 33. I started kstars 3.4.3 and clicked on Pointing > Find Object. I entered sagittarius in Filter by name then clicked OK. I moved the map around a bit. I clicked on Pointing > Find Object. I selected the Details button. kstars segmentation faulted in DetailDialog::createGeneralTab at /usr/src/debug/kstars-3.4.3-5.fc33.x86_64/kstars/dialogs/detaildialog.cpp:312 This crash happened 2/2 times.

The crash can be reproduced every time.

-- Backtrace:
Application: KStars (kstars), signal: Segmentation fault

[KCrash Handler]
#4  DetailDialog::createGeneralTab (this=0x563726e7c5e0) at /usr/src/debug/kstars-3.4.3-5.fc33.x86_64/kstars/dialogs/detaildialog.cpp:312
#5  0x00005637216cc1fd in DetailDialog::DetailDialog (this=<optimized out>, o=<optimized out>, ut=..., geo=<optimized out>, parent=<optimized out>, this=<optimized out>, o=<optimized out>, ut=..., geo=<optimized out>, parent=<optimized out>) at /usr/src/debug/kstars-3.4.3-5.fc33.x86_64/kstars/dialogs/detaildialog.cpp:72
#6  0x00005637218384f3 in FindDialog::slotDetails (this=<optimized out>) at /usr/src/debug/kstars-3.4.3-5.fc33.x86_64/kstars/dialogs/finddialog.cpp:504
#7  FindDialog::qt_static_metacall (_o=<optimized out>, _id=<optimized out>, _a=<optimized out>, _c=<optimized out>) at /usr/src/debug/kstars-3.4.3-5.fc33.x86_64/x86_64-redhat-linux-gnu/kstars/KStarsLib_autogen/2NRMJ5X7RK/moc_finddialog.cpp:170
#8  0x00007f0a686a03c0 in doActivate<false> (sender=0x563726c5dae0, signal_index=9, argv=0x7ffd076650d0) at kernel/qobject.cpp:3898
#9  0x00007f0a6928c316 in QAbstractButton::clicked (this=this@entry=0x563726c5dae0, _t1=<optimized out>) at .moc/moc_qabstractbutton.cpp:308
#10 0x00007f0a6928ccde in QAbstractButtonPrivate::emitClicked (this=this@entry=0x563725868a00) at widgets/qabstractbutton.cpp:415
#11 0x00007f0a6928e673 in QAbstractButtonPrivate::click (this=this@entry=0x563725868a00) at widgets/qabstractbutton.cpp:408
#12 0x00007f0a6928e855 in QAbstractButton::mouseReleaseEvent (this=0x563726c5dae0, e=0x7ffd07665690) at widgets/qabstractbutton.cpp:1044
#13 0x00007f0a691ddb1e in QWidget::event (this=0x563726c5dae0, event=0x7ffd07665690) at kernel/qwidget.cpp:9019
#14 0x00007f0a6919cec3 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x563726c5dae0, e=0x7ffd07665690) at kernel/qapplication.cpp:3632
#15 0x00007f0a691a3eeb in QApplication::notify(QObject*, QEvent*) () at kernel/qapplication.cpp:3076
#16 0x00007f0a68670bd8 in QCoreApplication::notifyInternal2 (receiver=0x563726c5dae0, event=0x7ffd07665690) at kernel/qcoreapplication.cpp:1063
#17 0x00007f0a691a2efa in QApplicationPrivate::sendMouseEvent (receiver=0x563726c5dae0, event=0x7ffd07665690, alienWidget=0x563726c5dae0, nativeWidget=0x56372659e2c0, buttonDown=<optimized out>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2614
#18 0x00007f0a691f6375 in QWidgetWindow::handleMouseEvent (this=0x563725864ed0, event=0x7ffd07665940) at kernel/qwidgetwindow.cpp:683
#19 0x00007f0a691f96be in QWidgetWindow::event (this=0x563725864ed0, event=0x7ffd07665940) at kernel/qwidgetwindow.cpp:300
#20 0x00007f0a6919cec3 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x563725864ed0, e=0x7ffd07665940) at kernel/qapplication.cpp:3632
#21 0x00007f0a68670bd8 in QCoreApplication::notifyInternal2 (receiver=0x563725864ed0, event=0x7ffd07665940) at kernel/qcoreapplication.cpp:1063
#22 0x00007f0a68b3f143 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at kernel/qguiapplication.cpp:2275
#23 0x00007f0a68b208cc in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#24 0x00007f0a55f7de24 in userEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5WaylandClient.so.5
#25 0x00007f0a66b7a7ef in g_main_dispatch (context=0x5637232e9ed0) at ../glib/gmain.c:3325
#26 g_main_context_dispatch (context=0x5637232e9ed0) at ../glib/gmain.c:4043
#27 0x00007f0a66bcc5d8 in g_main_context_iterate.constprop.0 (context=context@entry=0x5637232e9ed0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4119
#28 0x00007f0a66b77bc3 in g_main_context_iteration (context=0x5637232e9ed0, may_block=1) at ../glib/gmain.c:4184
#29 0x00007f0a686bd6f3 in QEventDispatcherGlib::processEvents (this=0x5637232cda50, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#30 0x00007f0a6866f57b in QEventLoop::exec (this=0x7ffd07665c80, flags=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#31 0x00007f0a6939cf8f in QDialog::exec (this=0x56372659e2c0) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#32 0x00005637217f4a4f in KStars::slotFind (this=0x5637232db550) at /usr/src/debug/kstars-3.4.3-5.fc33.x86_64/kstars/kstarsactions.cpp:1174
#33 KStars::qt_static_metacall (_o=0x5637232db550, _c=<optimized out>, _id=<optimized out>, _a=0x7ffd07665f10) at /usr/src/debug/kstars-3.4.3-5.fc33.x86_64/x86_64-redhat-linux-gnu/kstars/KStarsLib_autogen/EWIEGA46WW/moc_kstars.cpp:723
#34 0x00007f0a686a03c0 in doActivate<false> (sender=0x5637261e4710, signal_index=4, argv=0x7ffd07665f10) at kernel/qobject.cpp:3898
#35 0x00007f0a69196646 in QAction::triggered (this=this@entry=0x5637261e4710, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#36 0x00007f0a69198f31 in QAction::activate (this=0x5637261e4710, event=<optimized out>) at kernel/qaction.cpp:1161
#37 0x00007f0a69317e9a in QMenuPrivate::activateCausedStack (this=this@entry=0x563726832e00, causedStack=..., action=action@entry=0x5637261e4710, action_e=action_e@entry=QAction::Trigger, self=self@entry=true) at widgets/qmenu.cpp:1384
#38 0x00007f0a6931f512 in QMenuPrivate::activateAction (this=0x563726832e00, action=0x5637261e4710, action_e=QAction::Trigger, self=<optimized out>) at widgets/qmenu.cpp:1461
#39 0x00007f0a691ddb1e in QWidget::event (this=0x5637268166f0, event=0x7ffd07666580) at kernel/qwidget.cpp:9019
#40 0x00007f0a6919cec3 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5637268166f0, e=0x7ffd07666580) at kernel/qapplication.cpp:3632
#41 0x00007f0a691a3eeb in QApplication::notify(QObject*, QEvent*) () at kernel/qapplication.cpp:3076
#42 0x00007f0a68670bd8 in QCoreApplication::notifyInternal2 (receiver=0x5637268166f0, event=0x7ffd07666580) at kernel/qcoreapplication.cpp:1063
#43 0x00007f0a691a2efa in QApplicationPrivate::sendMouseEvent (receiver=0x5637268166f0, event=0x7ffd07666580, alienWidget=0x0, nativeWidget=0x5637268166f0, buttonDown=<optimized out>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at kernel/qapplication.cpp:2614
#44 0x00007f0a691f68e3 in QWidgetWindow::handleMouseEvent (this=0x5637264e5200, event=0x7ffd07666830) at kernel/qwidgetwindow.cpp:580
#45 0x00007f0a691f96be in QWidgetWindow::event (this=0x5637264e5200, event=0x7ffd07666830) at kernel/qwidgetwindow.cpp:300
#46 0x00007f0a6919cec3 in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5637264e5200, e=0x7ffd07666830) at kernel/qapplication.cpp:3632
#47 0x00007f0a68670bd8 in QCoreApplication::notifyInternal2 (receiver=0x5637264e5200, event=0x7ffd07666830) at kernel/qcoreapplication.cpp:1063
#48 0x00007f0a68b3f143 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () at kernel/qguiapplication.cpp:2275
#49 0x00007f0a68b208cc in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#50 0x00007f0a55f7de24 in userEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /lib64/libQt5WaylandClient.so.5
#51 0x00007f0a66b7a7ef in g_main_dispatch (context=0x5637232e9ed0) at ../glib/gmain.c:3325
#52 g_main_context_dispatch (context=0x5637232e9ed0) at ../glib/gmain.c:4043
#53 0x00007f0a66bcc5d8 in g_main_context_iterate.constprop.0 (context=context@entry=0x5637232e9ed0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:4119
#54 0x00007f0a66b77bc3 in g_main_context_iteration (context=0x5637232e9ed0, may_block=1) at ../glib/gmain.c:4184
#55 0x00007f0a686bd6f3 in QEventDispatcherGlib::processEvents (this=0x5637232cda50, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#56 0x00007f0a6866f57b in QEventLoop::exec (this=0x7ffd07666b60, flags=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#57 0x00007f0a686771b4 in QCoreApplication::exec () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#58 0x00005637215eb05e in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kstars-3.4.3-5.fc33.x86_64/kstars/main.cpp:346
[Inferior 1 (process 1830) detached]

Reported using DrKonqi
Comment 1 Matt Fagnani 2020-12-14 03:53:53 UTC
Clicking on Pointing > Find Object, entering sagittarius in Filter by name, and selecting the Details button was all that was required for the crash to happen in further tries. When I ran kstars from konsole and under gdb, the following error was shown when the crash occurred.
QWaylandShmBuffer: mmap failed (Invalid argument)

Running kstars under gdb indicated that the pointer this in frame 0 pointed to an inaccessible address.
(gdb) p this
$1 = (DetailDialog * const) 0x555558b4ecc0
(gdb) x this
0x555558b4ecc0: 0x561463b8
(gdb) x 0x561463b8
0x561463b8:     Cannot access memory at address 0x561463b8

I'm attaching the gdb output with the full trace. The pointer dso = 0x0 in frame 0 in DetailDialog::createGeneralTab in the full trace which might indicate a null pointer dereference happened at detaildialog.cpp:312 
if (!dso->longname().isEmpty() && dso->longname() != dso->name())

Crashes with this trace happened with both of kstars-3.4.3-4.fc33 with LTO disabled due to the problem at https://bugzilla.redhat.com/show_bug.cgi?id=1881915 and kstars-3.4.3-5.fc33 with LTO enabled and -fPIC from koji. This problem isn't likely to be related to the LTO problem. The crash happened when I ran kstars on X in Plasma on Wayland with QT_QPA_PLATFORM=xcb kstars & so the problem probably isn't specific to Wayland.
Comment 2 Matt Fagnani 2020-12-14 03:55:00 UTC
Created attachment 134068 [details]
gdb output when run on kstars followed by the crash with the full trace
Comment 3 Bernie Innocenti 2021-04-01 14:21:58 UTC
Maybe this is related (same EINVAL error in mmap()):
https://bugs.kde.org/show_bug.cgi?id=429967
Comment 4 Jasem Mutlaq 2021-04-15 08:35:15 UTC
Cannot reproduce. Please try with more recent KStars (e.g. 3.5.2)
Comment 5 Bernie Innocenti 2021-04-15 08:42:01 UTC
> Cannot reproduce. Please try with more recent KStars (e.g. 3.5.2)

Fedora 34 is still shipping kstars 3.4.3, and even rawhide doesn't have the latest version: https://src.fedoraproject.org/rpms/kstars

Did you test on a device with Intel graphics?
Comment 6 Bernie Innocenti 2021-04-15 09:01:51 UTC
Actually rawhide attempted to update to 3.5.2 one month ago:
https://src.fedoraproject.org/rpms/kstars/c/7d370caa3efe7a6844517713b53e3e41b0bc11e1?branch=rawhide

But something went wrong during the build (and I couldn't find the build.log):
https://koji.fedoraproject.org/koji/taskinfo?taskID=63692520
Comment 7 Matt Fagnani 2021-04-15 15:41:45 UTC
(In reply to Jasem Mutlaq from comment #4)
> Cannot reproduce. Please try with more recent KStars (e.g. 3.5.2)

KStars 3.4.3 is the most recent available version in Fedora 34 and rawhide as Bernie wrote. I installed the KStars 3.5.3 beta flatpak with the following based on https://community.kde.org/Guidelines_and_HOWTOs/Flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --if-not-exists kdeapps --from https://distribute.kde.org/kdeapps.flatpakrepo
flatpak install kstars
flatpak run org.kde.kstars

QWaylandShmBuffer: mmap failed (Invalid argument) was shown many times in Konsole as KStars started. The crash didn't happen when clicking on Pointing > Find Object, entering sagittarius in Filter by name, and selecting the Details button. The problem might've been fixed in 3.5.3 beta or earlier. The system is using Fedora 34 Plasma installation with Plasma 5.21.4, KF 5.80.0, Qt 5.15.2 with an integrated AMD Radeon R5 GPU using the radeonsi mesa 21.0.2 driver
Comment 8 Bug Janitor Service 2021-04-30 04:33:38 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!