Qt cross remote debug displays SIGSEGV popup but otherwise seem to operate, using gdb-multiarch



  • I created a remote cross compile setup for the IMX6 using qt 4.8.6. I have five projects and using the same kit, can compile and remotely single step them all except one, the main controller. I use boost 1.62.0 and IPC message parsing.,, and threads.

    What happens is when I place a breakpoint in main and run, the program stops at the start of main with a SIGSEGV message, but if I press F10 it run to the next breakpoint and repeat the message, you can then do line stepping etc, all seem fine but the annoying SIGSEGV message. I do not have any stack operations yet, only classes in threads that was instantiated. It seems to work but have the annoying message that pops up, on every run, step etc. On the other module things seem to operate fine, and debugging seem to be in order., Some modules also have IPC , boost and threads.

    Please note that if I run the application on the target all work as advertised, I only experience the problem in the debugger (Host) All the applications that run fine on the target.

    I tried to suppress the messages on the host, adding Debugger (GDB) a startup script 'handle.... '

    info sharedlibrary
    set sysroot /opt/riot
    handle SIGSEGV pass nostop noprint
    

    But the addition of SIGSEGV stops everything.

    How can I start to determine to culprit, it happens before any code is actually running?.

    Setup.
    Kubuntu 17.10 Virtual Box 5.2.2 . Guest addition installed (64 bit )

    gdb-multiarch (as the normal gdb supplied with kubuntu had some issues) used in kit.

    Please note I link the stdc++ libraries statically as I have a GLIBCXX version issue (application want xx.21 but only xx.20 available) on target. Not sure howto fix this without manually compile the stdc++ libs on the target. But this seem to be fine on the the other modules. The target is running Debian Wheezy (32 bit) and the repo updates only have the .20 as the last version. To update the target is a huge step with LVDS , touch, RS485 drivers and device tree specials written in the kernel code (drivers)

    Build Environment (added)

    BOOST_LIBS=/opt/riot/usr/local/lib
    LD_LIBRARY_PATH=/opt/riot/usr/lib
    

    Project file

    # -------------------------------------------------
    # Project Main Controller
    # Please update the version on any release
    #-------------------------------------------------
    VERSION  = v.2.08
    DEFINES += VERSION_STRING=\\\"$$VERSION\\\"
    DEFINES += DISPLAY_INTERNET_ICON
    DEFINES += MAIN_CONTROLLER
    
    DEFINES += DISPLAY_INTERNET_ICON
    
    #uncomment this for riot
    #    TARGET   = main_controller.\\\"$$VERSION\\\".bin
       DEFINES += EMBEDDED
    #endif
    
    # uncomment this for the pc
       TARGET   = main_controller
    #endif
    
    CONFIG += debug_and_release
    CONFIG += declarative_debug
    
    QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter
    
    QMAKE_CXXFLAGS += -std=c++11
    
    # Defines enable profiling 
    #DEFINES += GPROFILER
    GPROFILER{
      QMAKE_CXXFLAGS += -pg
      QMAKE_CFLAGS   += -pg
      QMAKE_LFLAGS   += -pg
      message(">>>>  CPP Profiler -------------- ")
      message(">>>>  Please run manually to create output file -------------- ")
    }
    
    DEFINES += MAIN_CONTROLLER
    DEFINES += FIRMWARE_VERSION=208
    
    DEFINES += COPY_DB_EVERY_MONTH
    DEFINES += USE_ALPHA
    
    #DEFINES += TEST_DB_RENAME_CHANGE
    
    message($$QMAKESPEC)
    # operate from Riot
    linux-arm-gnueabihf-g++_r {
        DEFINES += EMBEDDED
        QMAKE_CFLAGS=-no-pie
        message(">>>>  QT EMBEDDED TARGET UPLOAD -------------- ")
        target.path  = /home/mit/main_controller
        INSTALLS += target
    }
    
    QT       += core gui sql
    QT       += network
    QT       += testlib
    
    CONFIG   += USE_USB_ENUMERATOR
    
    # You can use the LIBS variable in the regular way, as in:
    # pass the path of your static library to it along with the library name,
    # so something like this:
    # LIBS += -L/path/to/the/static/library -lstaticlibraryname
    unix:LIBS += -L/opt/riot/usr/local/lib/ -lboost_system -lboost_thread -lrt
    unix:LIBS += -static-libstdc++
    
    INCLUDEPATH += ../lib \
                   ../common \
                   ../ipc \
                   ../lib/calc_volume \
                   ./utils \
                   ./i2c \
                   ./database \
                   ../interface \
                   ../boost_1_61_0 \
                   wizards/loading \
                   pcb \
    
    # -----------------------------------------------------------------------------
    #  Provision for QT5
    # -----------------------------------------------------------------------------
    greaterThan(QT_MAJOR_VERSION, 4) {
        message(">>>>  QT 5 ------------------------- ")
    
        QT += widgets
        QT += printsupport
    }
    lessThan(QT_MAJOR_VERSION, 5) {
         message(">>>>  QT 4 ------------------------- ")
         DEFINES += USE_QWS
    }
    
    CONFIG   += qt \
                warn_on
    
    TEMPLATE = app
    
    SOURCES  += main.cpp\
                mainwindow.cpp \
                delivery.cpp \
                configuration.cpp \
                compartment.cpp \
                wizards/print/print_wizard.cpp \
                wizards/print/print_preview_page.cpp \
                widgets/multi_select_widget.cpp \
                system.cpp \
                wizards/print/print_preview.cpp \
                md5/md5_qt.c \
                wizards/print/print_options_page.cpp \
                gps/gps_distance.c \
                scrollbar.cpp \
                wizards/compartment_widget.cpp \
                i2c/i2c.cpp \
                database/dbase.cpp \
                database/xdatabase.cpp \
                database/dbase_loading.cpp \
                database/dbase_tracking.cpp \
                fuel_logs.cpp \
                display_ini_logs.cpp \
                onmessage.cpp \
                fuelbus_scheduler.cpp \
                tracking.cpp
    
    HEADERS  += mainwindow.h \
                delivery.h \
                structure.h \
                configuration.h \
                compartment.h \
                wizards/print/print_wizard.h \
                wizards/print/print_preview_page.h \
                widgets/multi_select_widget.h \
                system.h \
                wizards/compartment_widget.h  \
                wizards/print/print_preview.h \
                gps/gps_distance.h \
                sys_constants.h \
                md5/md5_qt.h \
                wizards/print/print_options_page.h \
                scrollbar.h \
                i2c/ansi.h \
                i2c/i2c.h \
                i2c/struct_touch.h \
                ../interface/fuel_const.h \
                xstruct.h \
                database/dbase.h \
                database/xdatabase.h \
                cab_structure.h \
                ../interface/error_count.h \
                valve_struct.h \
                database/dbase_loading.h \
                database/dbase_tracking.h \
                hardware_main_router.h \
                event_lists.h \
                fuel_logs.h \
                display_ini_logs.h \
                onmessage.h \
                fuelbus_scheduler.h \
                tracking.h
    
    FORMS    += mainwindow.ui
    
    unix {
        MOC_DIR     = .moc
        OBJECTS_DIR = .obj
        DEFINES    += _LINUX_
        include (lock_file/lock_file.pri)
        include (daemon/MyDaemon.pri)
    }
    win32 {
        MOC_DIR     = .moc
        OBJECTS_DIR = .obj
        DEFINES    += _WIN32_
        # comment next line for release version
        CONFIG += console
    }
    
    RESOURCES += virtualboard.qrc
    RESOURCES += images.qrc
    
    MOC_DIR     = .moc
    OBJECTS_DIR = .obj
    
    include (keyboard/keyboard.pri)
    include (liteboard/liteboard.pri)
    
    include (sqlite/sqlite.pri)
    include (load_sqlite/load_sqlite.pri)
    
    include (socket_client/socket_client.pri)
    include (qpush/pushbutton.pri)
    include (dialogs/dialogs.pri)
    include (qgauge/qgauge.pri)
    include (penmount/penmount.pri)
    include (../common/common.pri)
    include (../ipc/ipc.pri)
    include (../lib/lib.pri)
    include (../lib/gprintf.pri)
    include (pcb/pcb.pri)
    include (wizards/loading/loading.pri)
    include (utils/utils.pri)
    
    include (internet/internet.pri)
    
    # -------------------------------------------------------
    # Main gui update, public to all protocols classes
    # -------------------------------------------------------
    include (display_gui/display_gui.pri)
    
    OTHER_FILES += mit_cfg.ini
    OTHER_FILES += mit_display.ini
    
    OTHER_FILES += ../interface/fuel_const.h
    OTHER_FILES += ../interface/xconfig.h.h
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.