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. Program Crashing while attempting to connect through Serial Port
Forum Updated to NodeBB v4.3 + New Features

Program Crashing while attempting to connect through Serial Port

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 5 Posters 1.0k Views 3 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.
  • N Offline
    N Offline
    ndijkhoffz
    wrote on last edited by
    #1

    This is an application that connects to a device product via Serial Port. The program always worked until I started making some changes to the project to add data logging capabilities. All of a sudden when I try to run the program to see my changes in effect; the program crashes during the attempted connection and all it outputs is:

    16:26:03: Starting C:\Work\SVN\Spartacus\build-Spartacus-Desktop_Qt_5_11_2_MinGW_32bit-Debug\debug\spartacus...
    libpng warning: iCCP: profile 'ICC Profile': 'CMYK': invalid ICC profile color space
    
    
    
    
    
    "Semaphore resource could not be acquired."
    
    
    
    
    "Semaphore resource could not be acquired."
    
    
    
    "Semaphore resource could not be acquired."
    

    What does "Semaphore resource could not be acquired" mean?.

    I reverted all my changes. went back to the original project files that I branched from and have the same error happen. I even went back to the trunk and it still happens. I did not have this issue before I tried making the changes for this new feature. I have made changes before and did not have the issue either. The error description is obvious but how do I correct it? Is this a Qt issue? Thanks for the help.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Did you try to run your application through the debugger to get a stack trace ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • N Offline
        N Offline
        ndijkhoffz
        wrote on last edited by
        #3

        Can you explain how to do that? I'm running Qt in Windows. Do you mean debugging with GDB?

        aha_1980A 1 Reply Last reply
        0
        • N ndijkhoffz

          Can you explain how to do that? I'm running Qt in Windows. Do you mean debugging with GDB?

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @ndijkhoffz

          exactly. start the debugger an on crash inspect the stack trace in QtCreator.

          Note that the debugger might first show system or Qt code, but usually go some stack levevls up and there is an bug in your code

          Qt has to stay free or it will die.

          1 Reply Last reply
          2
          • N Offline
            N Offline
            ndijkhoffz
            wrote on last edited by
            #5

            So I ran the cleanup in SVN and checked the delete all non-versioned items. This seemed to clear up the issue. I can't recreate the error again. However I found it really odd that this issue even came up.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MrShawn
              wrote on last edited by
              #6

              Looks to me from your errors and your comment later that the resource itself was being consumed by another process.

              I have had occasions in multiple languages where my program crashes or closes without releasing the serial resource. in which case firing up the program again has issues because it believes the resource is still in use.

              N 1 Reply Last reply
              4
              • M MrShawn

                Looks to me from your errors and your comment later that the resource itself was being consumed by another process.

                I have had occasions in multiple languages where my program crashes or closes without releasing the serial resource. in which case firing up the program again has issues because it believes the resource is still in use.

                N Offline
                N Offline
                ndijkhoffz
                wrote on last edited by
                #7

                @MrShawn I think that is what the issue was. Oh well. Thanks.

                Pablo J. RoginaP 1 Reply Last reply
                0
                • N ndijkhoffz

                  @MrShawn I think that is what the issue was. Oh well. Thanks.

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

                  @ndijkhoffz if your issue is solved, please don't forget to mark your post as such! Thanks.

                  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