Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Segmentation fault: Debugging tips
QtWS25 Last Chance

Segmentation fault: Debugging tips

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bgraysea
    wrote on last edited by
    #1

    I'm looking into a open source code set; and running into a Segmentation fault.

    Whilst I am discussing the issue here; https://github.com/OctoMap/octomap/issues/306 - perhaps I can get some general debugging suggestions from this forum.

    I am running inside a Ubuntu 18.04.4 docker container, and my host OS is Ubuntu 20.04. My GPU is a Radeon RX 570. I'm using this script to give the container GPU access - https://github.com/ros-planning/moveit/blob/master/.docker/gui-docker

    There most definitely could be things not working in my setup, the glxgears test described on http://wiki.ros.org/docker/Tutorials/Hardware Acceleration works.

    Running in gdb I get:

    (gdb) 
    (gdb) file octovis 
    Reading symbols from octovis...done.
    (gdb) run
    Starting program: /repos/octomap/bin/octovis 
    warning: Error disabling address space randomization: Operation not permitted
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    Program received signal SIGSEGV, Segmentation fault.
    0x00007f28c717c604 in ?? () from /usr/lib/x86_64-linux-gnu/libQtGui.so.4
    (gdb) bt
    #0  0x00007f28c717c604 in  () at /usr/lib/x86_64-linux-gnu/libQtGui.so.4
    #1  0x00007f28cd441783 in call_init (env=0x7ffd88e7aeb8, argv=0x7ffd88e7aea8, argc=1, l=<optimized out>) at dl-init.c:72
    #2  0x00007f28cd441783 in _dl_init (main_map=0x7f28cd65a170, argc=1, argv=0x7ffd88e7aea8, env=0x7ffd88e7aeb8) at dl-init.c:119
    #3  0x00007f28cd4320ca in _dl_start_user () at /lib64/ld-linux-x86-64.so.2
    #4  0x0000000000000001 in  ()
    #5  0x00007ffd88e7c6eb in  ()
    #6  0x0000000000000000 in  ()
    

    Thanks

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      If you run it outside of docker, on your host system - does it crash?

      My recommendations:

      • use debug build of Qt, or supply debug symbols to GDB so it will show you more information where the crash occurs
      • compile your app in debug mode, too
      • compile with address sanitizer, it often gives better output than debugger does

      Looks like the issue happens when loading the library itself. Perhaps you have some Qt version mismatch, or build architecture differs?

      (Z(:^

      1 Reply Last reply
      4
      • B Offline
        B Offline
        bgraysea
        wrote on last edited by
        #3

        Thanks for those pointers

        After further investigation; I realized I did indeed have qt4 & 5 dependencies installed - I thought I only had qt4.

        And; after rebuilding with only qt5 (further digging around the repo in question make me think this was viable) - it worked.

        So; not much of a learning on my part other than how to check for library dependencies

        Thanks again

        Pablo J. RoginaP 1 Reply Last reply
        1
        • B bgraysea

          Thanks for those pointers

          After further investigation; I realized I did indeed have qt4 & 5 dependencies installed - I thought I only had qt4.

          And; after rebuilding with only qt5 (further digging around the repo in question make me think this was viable) - it worked.

          So; not much of a learning on my part other than how to check for library dependencies

          Thanks again

          Pablo J. RoginaP Offline
          Pablo J. RoginaP Offline
          Pablo J. Rogina
          wrote on last edited by
          #4

          @bgraysea said in Segmentation fault: Debugging tips:

          it worked.

          great. So if your issue is solved, then please don't forget to mark your post as solved!

          Upvote the answer(s) that helped you solve the issue
          Use "Topic Tools" button to mark your post as Solved
          Add screenshots via postimage.org
          Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved