Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. PySide6 application silent crash in windows 11
Forum Updated to NodeBB v4.3 + New Features

PySide6 application silent crash in windows 11

Scheduled Pinned Locked Moved Unsolved Qt for Python
9 Posts 3 Posters 3.2k Views 2 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.
  • A Offline
    A Offline
    ajithkgshk
    wrote on last edited by
    #1

    Hi all.

    I have developed a pyside6 desktop application that interfaces with a camera and records the feeds from the camera. While testing the app in windows 11, I am seeing silent crashes. It crashes at random times, sometimes when the app just starts recording, sometimes the app crashes after recording for a long time.

    There is not error shown in QTCreator, nor in the command prompt. I checked windows event viewer and got the following error

    Faulting application name: python.exe, version: 3.11.1150.1013, time stamp: 0x638f9f80
    Faulting module name: Qt6Gui.dll, version: 6.4.2.0, time stamp: 0x63970839
    Exception code: 0xc0000005
    Fault offset: 0x00000000001438ab
    Faulting process id: 0x0x460
    Faulting application start time: 0x0x1D9392C9C7B2869
    Faulting application path: C:\Program Files\Python311\python.exe
    Faulting module path: C:\Users\Amaldev\AppData\Roaming\Python\Python311\site-packages\PySide6\Qt6Gui.dll
    Report Id: a1afc3fe-74e6-461c-8dd5-c82452c6e366
    Faulting package full name: 
    Faulting package-relative application ID: 
    

    From the details in the event viewer I could figure out the crash happened from inside the Qt6Gui.dll file and the exception code 0xc0000005 means there is some memory access violation. How do I figure what exactly is wrong?

    Is this a known issue in windows 11 or could it be something wrong in the code?

    Thanks in advance

    JonBJ 1 Reply Last reply
    0
    • A ajithkgshk

      Hi all.

      I have developed a pyside6 desktop application that interfaces with a camera and records the feeds from the camera. While testing the app in windows 11, I am seeing silent crashes. It crashes at random times, sometimes when the app just starts recording, sometimes the app crashes after recording for a long time.

      There is not error shown in QTCreator, nor in the command prompt. I checked windows event viewer and got the following error

      Faulting application name: python.exe, version: 3.11.1150.1013, time stamp: 0x638f9f80
      Faulting module name: Qt6Gui.dll, version: 6.4.2.0, time stamp: 0x63970839
      Exception code: 0xc0000005
      Fault offset: 0x00000000001438ab
      Faulting process id: 0x0x460
      Faulting application start time: 0x0x1D9392C9C7B2869
      Faulting application path: C:\Program Files\Python311\python.exe
      Faulting module path: C:\Users\Amaldev\AppData\Roaming\Python\Python311\site-packages\PySide6\Qt6Gui.dll
      Report Id: a1afc3fe-74e6-461c-8dd5-c82452c6e366
      Faulting package full name: 
      Faulting package-relative application ID: 
      

      From the details in the event viewer I could figure out the crash happened from inside the Qt6Gui.dll file and the exception code 0xc0000005 means there is some memory access violation. How do I figure what exactly is wrong?

      Is this a known issue in windows 11 or could it be something wrong in the code?

      Thanks in advance

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

      @ajithkgshk
      Hello and welcome.

      I would expect this to show up in a debugger with perhaps some further useful information. Did you try running your application under the Python debugger and/or running the python.exe process under a C++/Windows debugger to see what you get?

      A 1 Reply Last reply
      0
      • JonBJ JonB

        @ajithkgshk
        Hello and welcome.

        I would expect this to show up in a debugger with perhaps some further useful information. Did you try running your application under the Python debugger and/or running the python.exe process under a C++/Windows debugger to see what you get?

        A Offline
        A Offline
        ajithkgshk
        wrote on last edited by
        #3

        Hi @JonB . I tried debugging using windbg. I am not getting any more details except this. I am attaching the screenshot of the debugger. I am guessing there is no further info since the call crashes from within a dll file.

        Any tips of how I can dig into the dll file during execution to figure out who is calling the QVectorPath::convertToPainterPath function

        windbg_crash.jpg

        JonBJ 1 Reply Last reply
        0
        • A ajithkgshk

          Hi @JonB . I tried debugging using windbg. I am not getting any more details except this. I am attaching the screenshot of the debugger. I am guessing there is no further info since the call crashes from within a dll file.

          Any tips of how I can dig into the dll file during execution to figure out who is calling the QVectorPath::convertToPainterPath function

          windbg_crash.jpg

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

          @ajithkgshk
          If windbg cannot display a stack trace then you need to use a debugger like VS/MSVC. Whether it will show you back into calling code outside the DLL I cannot say, you may also need to have compiled for debug.

          A 1 Reply Last reply
          0
          • JonBJ JonB

            @ajithkgshk
            If windbg cannot display a stack trace then you need to use a debugger like VS/MSVC. Whether it will show you back into calling code outside the DLL I cannot say, you may also need to have compiled for debug.

            A Offline
            A Offline
            ajithkgshk
            wrote on last edited by
            #5

            @JonB Do you mean pyside has to be compiled for debug? since the DLL file is provided by pyside, it needs to be compiled for debug correct?

            JonBJ 1 Reply Last reply
            0
            • A ajithkgshk

              @JonB Do you mean pyside has to be compiled for debug? since the DLL file is provided by pyside, it needs to be compiled for debug correct?

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

              @ajithkgshk
              We don't know yet. First thing is to try to see whether with a different debugger you can get a stack trace when it crashes, leading back into your code. Debug might be necessary/wanted for variable values, but you may not get that far anyway.

              A 1 Reply Last reply
              0
              • JonBJ JonB

                @ajithkgshk
                We don't know yet. First thing is to try to see whether with a different debugger you can get a stack trace when it crashes, leading back into your code. Debug might be necessary/wanted for variable values, but you may not get that far anyway.

                A Offline
                A Offline
                ajithkgshk
                wrote on last edited by
                #7

                @JonB Ok. I will try VS or MSVC. I will keep posting the updates here.

                By the way, just for information's sake, the app is rock stable in Windows 10 and Linux. There are no crashes that happen in this regard. We are seeing the crash behavior only in windows 11

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  ajithkgshk
                  wrote on last edited by ajithkgshk
                  #8

                  I have figured out why the application was crashing. The app is threaded, one thread to capture an image from an industrial camera and submits to a queue, another thread to process the images and updates a label used as an image view.

                  The image view is updated by converting the image into a pixmap and then set the pixmap to the label.

                  We had assumed that the final draw call QT does to show the updated image was done synchronously. But it is not. The reference of the image was being lost and GCed before the draw call was made.

                  I solved the issue by holding reference of the images in a cache for about 5 seconds before clearing it from the cache.

                  Edit: Do not know why the app was not crashing in windows 10. It could be that thread scheduling in Win 11 is different from Win 10 and that is causing the UI thread to complete drawing before the next update.

                  SGaistS 1 Reply Last reply
                  1
                  • A ajithkgshk

                    I have figured out why the application was crashing. The app is threaded, one thread to capture an image from an industrial camera and submits to a queue, another thread to process the images and updates a label used as an image view.

                    The image view is updated by converting the image into a pixmap and then set the pixmap to the label.

                    We had assumed that the final draw call QT does to show the updated image was done synchronously. But it is not. The reference of the image was being lost and GCed before the draw call was made.

                    I solved the issue by holding reference of the images in a cache for about 5 seconds before clearing it from the cache.

                    Edit: Do not know why the app was not crashing in windows 10. It could be that thread scheduling in Win 11 is different from Win 10 and that is causing the UI thread to complete drawing before the next update.

                    SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @ajithkgshk hi, that lifetime issue is described in the constructor of the QPixmap you are using. One other way to that is to send a copy of the QPixmap when you call the signal. It might be slower though.

                    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
                    0

                    • Login

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