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. How can I debug my qt project with coredump?
Forum Updated to NodeBB v4.3 + New Features

How can I debug my qt project with coredump?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 3.1k 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.
  • V Offline
    V Offline
    v.raj
    wrote on 13 Jan 2022, 12:11 last edited by v.raj
    #1

    Hi All,

    I am getting "Segmentation fault (core dumped)" error with my Qt application. As I am bit new to Qt, may I know how to debug my Qt project with the coredump?
    And where can I found the coredump file?

    Here are the full error message:
    "malloc(): mismatching next->prev_size (unsorted)
    Segmentation fault (core dumped)"

    I have done some googling, but nothing found really helpful, may be I didn't find the exact link. So someone already know the solution then please share it.

    Qt version: Qt Creator 4.11.0
    OS: Ubuntu20.04
    gcc: 9.3.0

    Kind regards,
    Raj

    J 1 Reply Last reply 13 Jan 2022, 12:20
    0
    • V v.raj
      13 Jan 2022, 12:11

      Hi All,

      I am getting "Segmentation fault (core dumped)" error with my Qt application. As I am bit new to Qt, may I know how to debug my Qt project with the coredump?
      And where can I found the coredump file?

      Here are the full error message:
      "malloc(): mismatching next->prev_size (unsorted)
      Segmentation fault (core dumped)"

      I have done some googling, but nothing found really helpful, may be I didn't find the exact link. So someone already know the solution then please share it.

      Qt version: Qt Creator 4.11.0
      OS: Ubuntu20.04
      gcc: 9.3.0

      Kind regards,
      Raj

      J Offline
      J Offline
      JonB
      wrote on 13 Jan 2022, 12:20 last edited by
      #2

      @v-raj
      All you should have to do is run your application from within Qt Creator via Debug (instead of Run). You should find it is set up to use Ubuntu gdb, that will cut in when you hit the crash, and the stack trace window should show you the calling sequence from your code to the error location.

      1 Reply Last reply
      2
      • V Offline
        V Offline
        v.raj
        wrote on 14 Jan 2022, 15:02 last edited by
        #3

        Thanks for your reply @JonB

        I did some debugging using GDB, and here are the stack trace. So how can I analyse more with this logs? still I am not getting the exact code part.

        malloc(): mismatching next->prev_size (unsorted)
        
        Thread 1 "Camera_Filter" received signal SIGABRT, Aborted.
        __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
        50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
        (gdb) backtrace
        #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
        #1  0x00007fffee0c1859 in __GI_abort () at abort.c:79
        #2  0x00007fffee12c3ee in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7fffee256285 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
        #3  0x00007fffee13447c in malloc_printerr (str=str@entry=0x7fffee258aa0 "malloc(): mismatching next->prev_size (unsorted)") at malloc.c:5347
        #4  0x00007fffee1374dc in _int_malloc (av=av@entry=0x7fffee287b80 <main_arena>, bytes=bytes@entry=1256) at malloc.c:3741
        #5  0x00007fffee13ad15 in __libc_calloc (n=<optimised out>, elem_size=<optimised out>) at malloc.c:3428
        #6  0x00007fffe5b79248 in  () at /usr/local/cuda/lib64/libcublas.so.11
        #7  0x00007fffe5b7a8d8 in  () at /usr/local/cuda/lib64/libcublas.so.11
        #8  0x00007fffee0e615e in __cxa_finalize (d=0x7fffed84b620) at cxa_finalize.c:83
        #9  0x00007fffe55032d3 in  () at /usr/local/cuda/lib64/libcublas.so.11
        #10 0x00007fffffffd600 in  ()
        
        J 1 Reply Last reply 14 Jan 2022, 15:32
        0
        • V v.raj
          14 Jan 2022, 15:02

          Thanks for your reply @JonB

          I did some debugging using GDB, and here are the stack trace. So how can I analyse more with this logs? still I am not getting the exact code part.

          malloc(): mismatching next->prev_size (unsorted)
          
          Thread 1 "Camera_Filter" received signal SIGABRT, Aborted.
          __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
          50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
          (gdb) backtrace
          #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
          #1  0x00007fffee0c1859 in __GI_abort () at abort.c:79
          #2  0x00007fffee12c3ee in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7fffee256285 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
          #3  0x00007fffee13447c in malloc_printerr (str=str@entry=0x7fffee258aa0 "malloc(): mismatching next->prev_size (unsorted)") at malloc.c:5347
          #4  0x00007fffee1374dc in _int_malloc (av=av@entry=0x7fffee287b80 <main_arena>, bytes=bytes@entry=1256) at malloc.c:3741
          #5  0x00007fffee13ad15 in __libc_calloc (n=<optimised out>, elem_size=<optimised out>) at malloc.c:3428
          #6  0x00007fffe5b79248 in  () at /usr/local/cuda/lib64/libcublas.so.11
          #7  0x00007fffe5b7a8d8 in  () at /usr/local/cuda/lib64/libcublas.so.11
          #8  0x00007fffee0e615e in __cxa_finalize (d=0x7fffed84b620) at cxa_finalize.c:83
          #9  0x00007fffe55032d3 in  () at /usr/local/cuda/lib64/libcublas.so.11
          #10 0x00007fffffffd600 in  ()
          
          J Offline
          J Offline
          JonB
          wrote on 14 Jan 2022, 15:32 last edited by JonB
          #4

          @v-raj
          Your stack trace shows this is all to do with something happening in libcublas

          libcublas.so The cuBLAS library is an implementation of BLAS (Basic Linear Algebra Subprograms) on top of the NVIDIA CUDA runtime. It allows the user to access the computational resources of NVIDIA Graphics Processing Unit (GPU), but does not auto-parallelize across multiple GPUs.

          which is something I know nothing about. Nor about what Thread 1 "Camera_Filter". Does it have anything to do with Qt or is it some library your code is using?

          I see nothing about your own program/code in the traceback. Do you at least compile your code for debug? When does the error occur relative to running your program? Do you have anything calling this from your code? Did you try a minimal C++ or Qt program, like a Hello World, to see whether this always happens or depends on something in your code?

          1 Reply Last reply
          0
          • V Offline
            V Offline
            v.raj
            wrote on 14 Jan 2022, 15:56 last edited by
            #5

            @JonB

            1. if I run the project with minimal code, then this issue is not happening.

            2. I am getting this error while my program exits, and I am using "std::exit()" all for that, if I use "std::quick_exit()" this issue is not happening.

            3. "Camera_Filter' is my Qt application

            Output from nvidia-smi command:

            "NVIDIA-SMI 470.82.01 Driver Version: 470.82.01 CUDA Version: 11.4"

            J 1 Reply Last reply 14 Jan 2022, 16:00
            0
            • V v.raj
              14 Jan 2022, 15:56

              @JonB

              1. if I run the project with minimal code, then this issue is not happening.

              2. I am getting this error while my program exits, and I am using "std::exit()" all for that, if I use "std::quick_exit()" this issue is not happening.

              3. "Camera_Filter' is my Qt application

              Output from nvidia-smi command:

              "NVIDIA-SMI 470.82.01 Driver Version: 470.82.01 CUDA Version: 11.4"

              J Offline
              J Offline
              JonB
              wrote on 14 Jan 2022, 16:00 last edited by
              #6

              @v-raj said in How can I debug my qt project with coredump?:

              if I run the project with minimal code, then this issue is not happening.

              I am getting this error while my program exits

              So what is the difference between the "minimal code" versus "your program"? I certainly don't know, only you do, since you have said nothing about your application which crashes.

              Maybe it's an error in libcublas or NVIDIA/CUDA stuff.

              and I am using "std::exit()" all for that, if I use "std::quick_exit()" this issue is not happening.

              Doubtless because quick_exit() does less/no clean up. I do not know why you would use either of these in a Qt program.

              1 Reply Last reply
              0

              1/6

              13 Jan 2022, 12:11

              • Login

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