Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-937

Random crash when importing matplotlib after PySide2



    • Bug
    • Status: Closed
    • P1: Critical
    • Resolution: Duplicate
    • 5.12.1
    • 5.12.2
    • PySide
    • None
    • OS: Windows 10 64-bit
      Python: 3.7.2 64-bit
      PySide2/shiboken2: 5.12.1
      matplotlib: 3.0.2
    • Linux/X11, Windows
    • 8aa9cdf783e926e9d9a5543b77a54d3a34e90782 (pyside/pyside-setup/5.12)


      I've encounterd a weird bug in my program. I'm currently using PyQt5, and my program crash occasionally on startup (sometimes okay). There's no error message and I only got:

      Process finished with exit code -1073741819 (0xC0000005)

      Since my program is a bit complex, it's hard for me to reduce it to a minimal example. After some debugging, it seems that the program crashes when a wrapper widget is added to a QStackedWidget, but I can't figure out why.

      So I tried to switch to PySide2, then the crash occasionally happens during import, before any of my codes are executed.

      I've fixed the bug in my program in PyQt 5.12 now, the problem is a custom label inherited from QLabel used to display some HTML, but I still have no idea why this would cause crash occassionally. And I am not able to reproduce the issue after some testing. Not sure whether these two issues are related or not.

      from PySide2.QtCore import *
      from PySide2.QtGui import *
      from PySide2.QtWidgets import *
      import matplotlib.pyplot

      When the order of import is reversed, the occasional crash goes away. I'm not sure whether this is PySide2's problem or matplotlib's. I'll try to also raise the issue on matplotlib's github repo.


        Issue Links

          For Gerrit Dashboard: PYSIDE-937
          # Subject Branch Project Status CR V



              crmaurei Cristian Maureira-Fredes
              blkserene blkserene
              2 Vote for this issue
              4 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes