Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. App crash during valgrind, on QProcess::start
Forum Updated to NodeBB v4.3 + New Features

App crash during valgrind, on QProcess::start

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
14 Posts 2 Posters 1.5k 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.
  • JoeCFDJ JoeCFD

    @ocgltd valgrind runs very slow normally. Do you have any syn actions or updates or sort of multi-threading after process starts?

    ocgltdO Offline
    ocgltdO Offline
    ocgltd
    wrote on last edited by
    #5

    @JoeCFD I have other threads running, but this thread is blocked at the start method. Those other threads don't interact with this thread in any way....(not sure how to interpret your question)

    JoeCFDJ 1 Reply Last reply
    0
    • ocgltdO ocgltd

      @JoeCFD I have other threads running, but this thread is blocked at the start method. Those other threads don't interact with this thread in any way....(not sure how to interpret your question)

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #6

      @ocgltd not sure if the process needs any resources from somewhere else. If no, simply comment out this piece of code to run valgrind. The purpose of running valgrind is to find memory issues. If this process is a simple run and your code works fine, this part of the code will not cause any memory problem and you can simply ignore it.

      ocgltdO JoeCFDJ 2 Replies Last reply
      0
      • JoeCFDJ JoeCFD

        @ocgltd not sure if the process needs any resources from somewhere else. If no, simply comment out this piece of code to run valgrind. The purpose of running valgrind is to find memory issues. If this process is a simple run and your code works fine, this part of the code will not cause any memory problem and you can simply ignore it.

        ocgltdO Offline
        ocgltdO Offline
        ocgltd
        wrote on last edited by
        #7

        @JoeCFD The data returned by this QProcess is actually important to the program. But I'll assume this is a valgrind + FC34 issue.

        I'll try the same under Red Hat 7 in the near future and will update the thread.

        ocgltdO 1 Reply Last reply
        0
        • JoeCFDJ JoeCFD

          @ocgltd not sure if the process needs any resources from somewhere else. If no, simply comment out this piece of code to run valgrind. The purpose of running valgrind is to find memory issues. If this process is a simple run and your code works fine, this part of the code will not cause any memory problem and you can simply ignore it.

          JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by
          #8

          @JoeCFD
          Another tool to check memory issue is asan. Add this to your cmake
          set( CMAKE_CXX_FLAGS_DEBUG "-g -fsanitize-recover=address -fsanitize=address" CACHE STRING "compile flags" FORCE )
          try it out as well.

          1 Reply Last reply
          0
          • JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on last edited by
            #9

            https://forum.qt.io/topic/16837/program-started-with-qprocess-results-in-segmentation-fault-works-fine-on-console/7

            1 Reply Last reply
            0
            • ocgltdO ocgltd

              @JoeCFD The data returned by this QProcess is actually important to the program. But I'll assume this is a valgrind + FC34 issue.

              I'll try the same under Red Hat 7 in the near future and will update the thread.

              ocgltdO Offline
              ocgltdO Offline
              ocgltd
              wrote on last edited by
              #10

              @ocgltd I tried valgrind under Fedora 38 and the problem remains...

              JoeCFDJ 1 Reply Last reply
              0
              • ocgltdO ocgltd

                @ocgltd I tried valgrind under Fedora 38 and the problem remains...

                JoeCFDJ Offline
                JoeCFDJ Offline
                JoeCFD
                wrote on last edited by JoeCFD
                #11

                @ocgltd
                in the link I posted above. There is something like:
                today I tried to run my sender process with QProcess::startDetached() and it worked without any problems.
                Try it out. If it works, simply change it back if you prefer the process to be attached after valgrind run.

                I have a few processes running in my app and do not have this issue.

                ocgltdO 1 Reply Last reply
                0
                • JoeCFDJ JoeCFD

                  @ocgltd
                  in the link I posted above. There is something like:
                  today I tried to run my sender process with QProcess::startDetached() and it worked without any problems.
                  Try it out. If it works, simply change it back if you prefer the process to be attached after valgrind run.

                  I have a few processes running in my app and do not have this issue.

                  ocgltdO Offline
                  ocgltdO Offline
                  ocgltd
                  wrote on last edited by ocgltd
                  #12

                  @JoeCFD I tried using startDetached and my app still crashed at the same point. However, it dumped the stdout of my process to the terminal window, following by html tag structured valgrind output.

                  Another clue, is that after crashing valgrind reports:

                  syscall param waitid(infop) points to unaddressable byte(s)
                  

                  on the QProcess.start line

                  1 Reply Last reply
                  0
                  • JoeCFDJ Offline
                    JoeCFDJ Offline
                    JoeCFD
                    wrote on last edited by
                    #13

                    https://bugreports.qt.io/browse/QTBUG-82351

                    ocgltdO 1 Reply Last reply
                    0
                    • JoeCFDJ JoeCFD

                      https://bugreports.qt.io/browse/QTBUG-82351

                      ocgltdO Offline
                      ocgltdO Offline
                      ocgltd
                      wrote on last edited by
                      #14

                      @JoeCFD Well that sure looks similar, so I'll chalk it up to a Qt bug for now. My app does lots of forking, so hard to temporarily disable this (to test for other leaks). So I'll just have to wait until this is fixed and recheck for leaks later.

                      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