Dan created a new topic ' KStars/EQMod Segmentation Fault' in the forum. 3 years ago

Greetings! This is my first post, so if I've put this in the wrong spot for a debugging/crash analysis question, please feel free to shuffle it around as necessary.

I am currently experiencing a segmentation fault when connecting to my HEQ5 Pro using the EQMod Mount driver, when running a debug build on my raspberry pi. I don't want to log it as a bug just yet because chances are that it's something that I've done (or not done) causing the segfault, hence why I'm posting here first.

I'm hoping for some help to try and figure out why I'm getting this segfault, so I can fix it up and get back to dealing with the original crashes...!

If I have not provided something that might be important please let me know and I'll gather it for you.

Thanks in advance!



Key Details

  • I am running on a Raspberry Pi 4 (8GB RAM)
  • I have performed a full build of the following software using standard the cmake instructions for each repo:



Background
I was originally running Astroberry on my Raspberry Pi, but I was having unpredictable crashes overnight. I tried doing a few things like enabling logging, and running stars from the command line to get visibility of additional STDOUT/STDERR output, but nothing useful was coming back and the crashes were silent. I was hoping to get a stack trace to figure out what was triggering the crashes but couldn't find a way to do it.

Fast forward to a few days ago. I've wiped the Pi and thrown on vanilla Raspbian Desktop, set up some basic stuff (VNC access, udev alias rules), grabbed the repos for the key software, and performed a build of it all. (Insert obligatory XKCD reference ).

I tried spinning things up, and was greeted with a segfault.



Steps
  1. Spin up gdb with 'gdb kstars'
  2. Type 'r' to run kstars
  3. After launch, dismiss tip of the day
  4. Open Ekos
  5. Select my 'Vector' profile (which has auto-connect unchecked)
  6. Click the 'Start' button to launch INDI from Ekos
  7. Click 'Connect' for GPSD, no issues
  8. Click 'Connect' for my CCD, no issues
  9. Click 'Connect' for my EQMod Mount, instant segmentation fault



Devices
  • SkyWatcher HEQ5 Pro Mount, attached via USB 2.0 direct to pi
  • ZWO ASI294MM Pro, attached via USB 3.0 direct to pi
  • UBlox GPS Dongle, attached via USB 2.0 direct to pi
  • Local ethernet cable, attached direct to onboard ethernet port on pi



Ekos Configuration
Ekos 'Vector' Profile:
  • Mode = Local
  • Guiding = Internal
  • Auto Connect = unchecked
  • Mount = EQMod Mount
  • CCD = ZWO CCD
  • Guider = ZWO CCD
  • AUX 1 = GPSD
  • Primary Scope = SkyWatcher ED80 (80mm aperture / 510mm focal including reducer)
  • Guide Scope = SkyWatcher Finderscope 9x50 (50mm aperture / 450mm focal length)



Debugger Output
pi@raspberrypi:~ $ gdb kstars 
GNU gdb (Raspbian 8.2.1-2) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from kstars...done.
(gdb) r
Starting program: /usr/bin/kstars 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0xaf6740a0 (LWP 2023)]
qt5ct: using qt5ct plugin
[New Thread 0xa95460a0 (LWP 2024)]
[New Thread 0xa88d60a0 (LWP 2025)]
[New Thread 0xa66ff0a0 (LWP 2026)]
[New Thread 0xa44ff0a0 (LWP 2027)]
[New Thread 0xa18f40a0 (LWP 2028)]
[New Thread 0xa0a410a0 (LWP 2029)]
[New Thread 0xa00ff0a0 (LWP 2030)]
[New Thread 0x9f8fe0a0 (LWP 2031)]
[New Thread 0x9f0fd0a0 (LWP 2032)]
[New Thread 0x9e8fc0a0 (LWP 2033)]
[New Thread 0x9ddfb0a0 (LWP 2034)]
[New Thread 0x9bdfa0a0 (LWP 2035)]
[Thread 0x9bdfa0a0 (LWP 2035) exited]
[Thread 0xa0a410a0 (LWP 2029) exited]
[Thread 0x9f0fd0a0 (LWP 2032) exited]
[Thread 0xa00ff0a0 (LWP 2030) exited]
[Thread 0x9ddfb0a0 (LWP 2034) exited]
[Thread 0xa44ff0a0 (LWP 2027) exited]
[Thread 0xa66ff0a0 (LWP 2026) exited]
[Thread 0xa88d60a0 (LWP 2025) exited]
[New Thread 0x9ddfb0a0 (LWP 2036)]
[New Thread 0xa66ff0a0 (LWP 2037)]
[New Thread 0xa44ff0a0 (LWP 2038)]
[New Thread 0x9b1ff0a0 (LWP 2039)]
[Detaching after fork from child process 2040]
[Detaching after fork from child process 2041]
[Detaching after fork from child process 2042]
[New Thread 0xa88a30a0 (LWP 2046)]
[New Thread 0xa7e860a0 (LWP 2050)]
Dispatch command error(-1): Device ZWO CCD ASI294MM Pro not found
<setTextVector device="ZWO CCD ASI294MM Pro" name="DRIVER_INFO" state="Idle" timeout="60" timestamp="2021-03-03T10:26:28">
    <oneText name="DRIVER_NAME">
ZWO CCD
    </oneText>
    <oneText name="DRIVER_EXEC">
indi_asi_ccd
    </oneText>
    <oneText name="DRIVER_VERSION">
1.9
    </oneText>
    <oneText name="DRIVER_INTERFACE">
2
    </oneText>
</setTextVector>
Dispatch command error(-1): 
<setTextVector device="GPSD" name="TIME_UTC" state="Busy" timeout="60" timestamp="2021-03-03T10:26:32">
    <oneText name="UTC"/>
    <oneText name="OFFSET"/>
</setTextVector>
Dispatch command error(-1): INDI: Could not find property GEOGRAPHIC_COORD in GPSD
<setNumberVector device="GPSD" name="GEOGRAPHIC_COORD" state="Busy" timeout="60" timestamp="2021-03-03T10:26:32">
    <oneNumber name="LAT">
0
    </oneNumber>
    <oneNumber name="LONG">
0
    </oneNumber>
    <oneNumber name="ELEV">
0
    </oneNumber>
</setNumberVector>
Dispatch command error(-1): INDI: Could not find property GEOGRAPHIC_COORD in GPSD
<setTextVector device="GPSD" name="GPS_STATUS" state="Busy" timeout="60" timestamp="2021-03-03T10:26:32">
    <oneText name="GPS_FIX"/>
</setTextVector>
Dispatch command error(-1): INDI: Could not find property POLARIS in GPSD
<setNumberVector device="GPSD" name="POLARIS" state="Busy" timeout="60" timestamp="2021-03-03T10:26:32">
    <oneNumber name="HA">
0
    </oneNumber>
</setNumberVector>
Dispatch command error(-1): INDI: Could not find property POLARIS in GPSD
<setSwitchVector device="GPSD" name="GPS_REFRESH" state="Busy" timeout="0" timestamp="2021-03-03T10:26:32">
    <oneSwitch name="REFRESH">
Off
    </oneSwitch>
</setSwitchVector>
Dispatch command error(-1): INDI: Could not find property POLARIS in GPSD
<setTextVector device="GPSD" name="GPS_STATUS" state="Busy" timeout="60" timestamp="2021-03-03T10:26:32">
    <oneText name="GPS_FIX">
NO FIX
    </oneText>
</setTextVector>
[New Thread 0xa0a410a0 (LWP 2055)]
[New Thread 0xa00ff0a0 (LWP 2056)]

Thread 1 "kstars" received signal SIGSEGV, Segmentation fault.
0xb4567068 in QObject::setProperty(char const*, QVariant const&) () from /lib/arm-linux-gnueabihf/libQt5Core.so.5
(gdb) bt
#0  0xb4567068 in QObject::setProperty(char const*, QVariant const&) () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
#1  0x00c019a0 in Ekos::Mount::Mount() (this=0x4d036b0) at /home/pi/repos/kstars/kstars/ekos/mount/mount.cpp:231
#2  0x0095dff4 in Ekos::Manager::initMount() (this=0x4273b80) at /home/pi/repos/kstars/kstars/ekos/manager.cpp:2432
#3  0x00956750 in Ekos::Manager::setTelescope(ISD::GDInterface*) (this=0x4273b80, scopeDevice=0x4e73f40)
    at /home/pi/repos/kstars/kstars/ekos/manager.cpp:1439
#4  0x00998678 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<ISD::GDInterface*>, void, void (Ekos::Manager::*)(ISD::GDInterface*)>::call(void (Ekos::Manager::*)(ISD::GDInterface*), Ekos::Manager*, void**) (f=
    (void (Ekos::Manager::*)(Ekos::Manager * const, ISD::GDInterface *)) 0x9566a4 <Ekos::Manager::setTelescope(ISD::GDInterface*)>, o=0x4273b80, arg=0xbeffeb5c) at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:134
#5  0x00992d28 in QtPrivate::FunctionPointer<void (Ekos::Manager::*)(ISD::GDInterface*)>::call<QtPrivate::List<ISD::GDInterface*>, void>(void (Ekos::Manager::*)(ISD::GDInterface*), Ekos::Manager*, void**) (f=
    (void (Ekos::Manager::*)(Ekos::Manager * const, ISD::GDInterface *)) 0x9566a4 <Ekos::Manager::setTelescope(ISD::GDInterface*)>, o=0x4273b80, arg=0xbeffeb5c) at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:167
#6  0x009871fc in QtPrivate::QSlotObject<void (Ekos::Manager::*)(ISD::GDInterface*), QtPrivate::List<ISD::GDInterface*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
    (which=1, this_=0x46b0230, r=0x4273b80, a=0xbeffeb5c, ret=0x0)
    at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:396
#7  0xb455f380 in QMetaObject::activate(QObject*, int, int, void**) () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
#8  0x007c342c in INDIListener::newTelescope(ISD::GDInterface*) (this=0x452ec88, _t1=0x4e73f40)
    at /home/pi/Projects/build/kstars/kstars/KStarsLib_autogen/FRI4DANIHA/moc_indilistener.cpp:401
#9  0x00895154 in INDIListener::registerProperty(INDI::Property*) (this=0x452ec88, prop=0x4e0dd70)
    at /home/pi/repos/kstars/kstars/indi/indilistener.cpp:256
#10 0x0089ab7c in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<INDI::Property*>, void, void (INDIListener::*)(INDI::Property*)>::call(void (INDIListener::*)(INDI::Property*), INDIListener*, void**) (f=
    (void (INDIListener::*)(INDIListener * const, INDI::Property *)) 0x894e00 <INDIListener::registerProperty(INDI::Property*)>, o=0x452ec88, arg=0x4e71a70) at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:134
#11 0x0089a5ac in QtPrivate::FunctionPointer<void (INDIListener::*)(INDI::Property*)>::call<QtPrivate::List<INDI::Property*>, void>(void (INDIListener::*)(INDI::Property*), INDIListener*, void**) (f=
    (void (INDIListener::*)(INDIListener * const, INDI::Property *)) 0x894e00 <INDIListener::registerProperty(INDI::Property*)>, o=0x452ec88, arg=0x4e71a70) at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:167
#12 0x008993d4 in QtPrivate::QSlotObject<void (INDIListener::*)(INDI::Property*), QtPrivate::List<INDI::Property*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x46b9400, r=0x452ec88, a=0x4e71a70, ret=0x0)
    at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:396
#13 0xb455bc68 in QMetaCallEvent::placeMetaCall(QObject*) () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
#14 0xb455fbec in QObject::event(QEvent*) () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
#15 0xb4ce2db4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/arm-linux-gnueabihf/libQt5Widgets.so.5
#16 0xb4ceb2a8 in QApplication::notify(QObject*, QEvent*) () at /lib/arm-linux-gnueabihf/libQt5Widgets.so.5
#17 0x0452ec88 in  ()
(gdb) where
#0  0xb4567068 in QObject::setProperty(char const*, QVariant const&) () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
#1  0x00c019a0 in Ekos::Mount::Mount() (this=0x4d036b0) at /home/pi/repos/kstars/kstars/ekos/mount/mount.cpp:231
#2  0x0095dff4 in Ekos::Manager::initMount() (this=0x4273b80) at /home/pi/repos/kstars/kstars/ekos/manager.cpp:2432
#3  0x00956750 in Ekos::Manager::setTelescope(ISD::GDInterface*) (this=0x4273b80, scopeDevice=0x4e73f40)
    at /home/pi/repos/kstars/kstars/ekos/manager.cpp:1439
#4  0x00998678 in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<ISD::GDInterface*>, void, void (Ekos::Manager::*)(ISD::GDInterface*)>::call(void (Ekos::Manager::*)(ISD::GDInterface*), Ekos::Manager*, void**) (f=
    (void (Ekos::Manager::*)(Ekos::Manager * const, ISD::GDInterface *)) 0x9566a4 <Ekos::Manager::setTelescope(ISD::GDInterface*)>, o=0x4273b80, arg=0xbeffeb5c) at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:134
#5  0x00992d28 in QtPrivate::FunctionPointer<void (Ekos::Manager::*)(ISD::GDInterface*)>::call<QtPrivate::List<ISD::GDInterface*>, void>(void (Ekos::Manager::*)(ISD::GDInterface*), Ekos::Manager*, void**) (f=
    (void (Ekos::Manager::*)(Ekos::Manager * const, ISD::GDInterface *)) 0x9566a4 <Ekos::Manager::setTelescope(ISD::GDInterface*)>, o=0x4273b80, arg=0xbeffeb5c) at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:167
#6  0x009871fc in QtPrivate::QSlotObject<void (Ekos::Manager::*)(ISD::GDInterface*), QtPrivate::List<ISD::GDInterface*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
    (which=1, this_=0x46b0230, r=0x4273b80, a=0xbeffeb5c, ret=0x0)
    at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:396
#7  0xb455f380 in QMetaObject::activate(QObject*, int, int, void**) () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
#8  0x007c342c in INDIListener::newTelescope(ISD::GDInterface*) (this=0x452ec88, _t1=0x4e73f40)
    at /home/pi/Projects/build/kstars/kstars/KStarsLib_autogen/FRI4DANIHA/moc_indilistener.cpp:401
#9  0x00895154 in INDIListener::registerProperty(INDI::Property*) (this=0x452ec88, prop=0x4e0dd70)
    at /home/pi/repos/kstars/kstars/indi/indilistener.cpp:256
#10 0x0089ab7c in QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<INDI::Property*>, void, void (INDIListener::*)(INDI::Property*)>::call(void (INDIListener::*)(INDI::Property*), INDIListener*, void**) (f=
    (void (INDIListener::*)(INDIListener * const, INDI::Property *)) 0x894e00 <INDIListener::registerProperty(INDI::Property*)>, o=0x452ec88, arg=0x4e71a70) at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:134
#11 0x0089a5ac in QtPrivate::FunctionPointer<void (INDIListener::*)(INDI::Property*)>::call<QtPrivate::List<INDI::Property*>, void>(void (INDIListener::*)(INDI::Property*), INDIListener*, void**) (f=
    (void (INDIListener::*)(INDIListener * const, INDI::Property *)) 0x894e00 <INDIListener::registerProperty(INDI::Property*)>, o=0x452ec88, arg=0x4e71a70) at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:167
#12 0x008993d4 in QtPrivate::QSlotObject<void (INDIListener::*)(INDI::Property*), QtPrivate::List<INDI::Property*>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) (which=1, this_=0x46b9400, r=0x452ec88, a=0x4e71a70, ret=0x0)
    at /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobjectdefs_impl.h:396
#13 0xb455bc68 in QMetaCallEvent::placeMetaCall(QObject*) () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
#14 0xb455fbec in QObject::event(QEvent*) () at /lib/arm-linux-gnueabihf/libQt5Core.so.5
#15 0xb4ce2db4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/arm-linux-gnueabihf/libQt5Widgets.so.5
#16 0xb4ceb2a8 in QApplication::notify(QObject*, QEvent*) () at /lib/arm-linux-gnueabihf/libQt5Widgets.so.5
#17 0x0452ec88 in  ()
(gdb) frame 1
#1  0x00c019a0 in Ekos::Mount::Mount (this=0x4d036b0) at /home/pi/repos/kstars/kstars/ekos/mount/mount.cpp:231
231	    m_leftRightCheck->setProperty("checked", Options::leftRightReversed());
(gdb) print m_leftRightCheck
$1 = (QQuickItem *) 0x0
(gdb) frame 2
#2  0x0095dff4 in Ekos::Manager::initMount (this=0x4273b80) at /home/pi/repos/kstars/kstars/ekos/manager.cpp:2432
2432	    mountProcess.reset(new Ekos::Mount());
(gdb) frame 3
#3  0x00956750 in Ekos::Manager::setTelescope (this=0x4273b80, scopeDevice=0x4e73f40)
    at /home/pi/repos/kstars/kstars/ekos/manager.cpp:1439
1439	    initMount();


Read More...