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. Placing breakpoint kills child processes on remote debug
Forum Updated to NodeBB v4.3 + New Features

Placing breakpoint kills child processes on remote debug

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 738 Views 1 Watching
  • 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.
  • MuratUrsavasM Offline
    MuratUrsavasM Offline
    MuratUrsavas
    wrote on last edited by
    #1

    Hi,

    I have a console application which executes some child processes with QProcess. I mainly remote debug this application. While running the debug session, If I put a breakpoint anywhere, the running child processes got killed even though the application never stops at that breakpoint. App loop continues to run as is.

    Have you ever encountered something like this? If yes, did you found any solution?

    Regards,

    JonBJ 1 Reply Last reply
    0
    • MuratUrsavasM MuratUrsavas

      Hi,

      I have a console application which executes some child processes with QProcess. I mainly remote debug this application. While running the debug session, If I put a breakpoint anywhere, the running child processes got killed even though the application never stops at that breakpoint. App loop continues to run as is.

      Have you ever encountered something like this? If yes, did you found any solution?

      Regards,

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @MuratUrsavas
      Platform? Debugger? gdb has a couple of follow fork settings, just make quite sure you are set to stay in parent not follow children in your settings (that's supposed to be the default, but check)?

      1 Reply Last reply
      0
      • MuratUrsavasM Offline
        MuratUrsavasM Offline
        MuratUrsavas
        wrote on last edited by
        #3

        Using Qt 5.15.0, on Ubuntu 20.04 host machine. Target machine is Raspbian Kernel 5.4 (armhf). I'm using GDB Multi-Arch.

        I'll look at follow fork settings. Additionally I've made sure that the "debug all child processes" option is not selected in Qt Creator as it makes everything worse.

        1 Reply Last reply
        0
        • MuratUrsavasM Offline
          MuratUrsavasM Offline
          MuratUrsavas
          wrote on last edited by
          #4

          You're right @JonB , the correct place to look at the root cause is forking.

          https://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_25.html

          This page says why the problem ocurres:

          "If you have set a breakpoint in any code which the child then executes, the child will get a SIGTRAP signal which (unless it catches the signal) will cause it to terminate."

          Let's find out how this can be prevented.

          JonBJ 1 Reply Last reply
          0
          • MuratUrsavasM MuratUrsavas

            You're right @JonB , the correct place to look at the root cause is forking.

            https://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_25.html

            This page says why the problem ocurres:

            "If you have set a breakpoint in any code which the child then executes, the child will get a SIGTRAP signal which (unless it catches the signal) will cause it to terminate."

            Let's find out how this can be prevented.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @MuratUrsavas
            Are you saying the child process is not some random, third-party program but one which actually uses the same source code as you have in the parent where you have the breakpoints?

            1 Reply Last reply
            0
            • MuratUrsavasM Offline
              MuratUrsavasM Offline
              MuratUrsavas
              wrote on last edited by MuratUrsavas
              #6

              Are you saying the child process is not some random, third-party program

              Yes, other programs are also developed by me with Qt and executed on demand.

              but one which actually uses the same source code as you have in the parent where you have the breakpoints?

              They don't share the same source code and I don't have an intention to debug child processes at this point. Only the parent program is debugged and I'm adding breakpoints in that source.

              Note: I've found a way to ignore SIGTRAP signal but it didn't work. This could be something different.

              1 Reply Last reply
              0
              • MuratUrsavasM Offline
                MuratUrsavasM Offline
                MuratUrsavas
                wrote on last edited by
                #7

                Really confused at this point. If I run the secondary software manually it can dodge SIGTRAP and continues its way normally. But if I start it with its own source code via GDB, it is terminated with SIGTRAP signal exception message.

                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