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

Random crash when importing matplotlib after PySide2

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P1: Critical
    • Resolution: Duplicate
    • Affects Version/s: 5.12.1
    • Fix Version/s: 5.12.2
    • Component/s: PySide
    • Labels:
      None
    • Environment:
      OS: Windows 10 64-bit
      Python: 3.7.2 64-bit
      PySide2/shiboken2: 5.12.1
      matplotlib: 3.0.2
    • Platform/s:
      Linux/X11, Windows
    • Commits:
      8aa9cdf783e926e9d9a5543b77a54d3a34e90782 (pyside/pyside-setup/5.12)

      Description

      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 *
      
      print('pyside')
      
      import matplotlib.pyplot
      
      print('matplotlib')
      

      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.

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              • Assignee:
                crmaurei Cristian Maureira-Fredes
                Reporter:
                blkserene blkserene
              • Votes:
                2 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes