Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault ( QtWebEngineCore ) #36

Open
hamedsabri opened this issue May 30, 2023 · 4 comments
Open

Segmentation fault ( QtWebEngineCore ) #36

hamedsabri opened this issue May 30, 2023 · 4 comments

Comments

@hamedsabri
Copy link

Hi there,

I am getting a crash every time I try to open either "Prim Composition" , "Taxonomy Editor", or " LayerStack composition". From the crash repot it appears that calling into QtWebEngineCore cause the issue.

Specs:

USD Version: v22.11
Python Version: 3.9.16
OS: Ventura 13.3.1 ( Apple M1 Max )

Installed packages:

Package            Version
------------------ -------
graphviz           0.20.1
grill              0.15.0
grill-names        2.6.0
Jinja2             3.1.2
MarkupSafe         2.1.1
naming             0.7.0
networkx           3.1
pip                23.1.2
pygraphviz         1.10
PyOpenGL           3.1.6
PySide6            6.4.3
PySide6-Addons     6.4.3
PySide6-Essentials 6.4.3
setuptools         65.6.3
shiboken6          6.4.3
six                1.16.0
wheel              0.38.4

Crash report:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               Python [89440]
Path:                  /opt/local/Library/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python
Identifier:            org.python.python
Version:               3.9.16 (3.9.16)
Code Type:             ARM-64 (Native)
Parent Process:        zsh [89151]
Responsible:           Terminal [59366]
User ID:               502

Date/Time:             2023-05-30 09:31:37.4956 -0400
OS Version:            macOS 13.3.1 (22E772610a)
Report Version:        12
Anonymous UUID:        055A5BC9-2682-3689-DCEF-2ECEB6CC6612

Sleep/Wake UUID:       1C1C655C-668C-491B-AFC5-BF10381D980B

Time Awake Since Boot: 740000 seconds
Time Since Wake:       43622 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000008
Exception Codes:       0x0000000000000001, 0x0000000000000008

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [89440]

VM Region Info: 0x8 is not in any region.  Bytes before following region: 105553518919672
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      MALLOC_NANO (reserved)   600018000000-600020000000 [128.0M] rw-/rwx SM=NUL  ...(unallocated)

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   QtGui                         	       0x13fb220b8 QOpenGLContext::format() const + 0
1   QtWebEngineCore               	       0x2a4d3e5cc 0x2a4c6c000 + 861644
2   QtWebEngineCore               	       0x2a4d3c5b4 0x2a4c6c000 + 853428
3   QtWebEngineCore               	       0x2a4d2b098 QtWebEngineCore::WebContentsAdapter::WebContentsAdapter() + 68
4   QtWebEngineCore               	       0x2a4c8e718 QWebEnginePagePrivate::QWebEnginePagePrivate(QWebEngineProfile*) + 104
5   QtWebEngineCore               	       0x2a4c91bb8 QWebEnginePage::QWebEnginePage(QObject*) + 52
6   QtWebEngineWidgets            	       0x17b9e0788 QWebEngineView::showEvent(QShowEvent*) + 56
@chrizzFTD
Copy link
Collaborator

chrizzFTD commented May 31, 2023

Hi @hamedsabri, thanks for giving this a try and logging this.

I have not seen this particular crash but I have seen other crashes related to QtWebEngine on other environments. Could you give these a try and share the outcome, please?

  1. From a shell, launch USDView via python and having QtWebEngineWidgets to be imported before anything else. For example:
    python -c "from PySide6 import QtWebEngineWidgets;from pxr import Usdviewq;Usdviewq.Launcher().Run()" /path/to/Kitchen_set.usd
    and then confirming if the "Prim Composition" , "Taxonomy Editor", or " LayerStack Composition" widgets continue to crash.
  2. On your current environment, creating a QtWebEngineView widget, running python to a script with the following:
    import sys
    from PySide6 import QtWidgets, QtWebEngineWidgets
    app = QtWidgets.QApplication([])
    
    widget = QtWebEngineWidgets.QWebEngineView()
    widget.resize(300, 150)
    widget.show()
    
    sys.exit(app.exec())
    (or a one-liner, for convenience):
    python -c "import sys;from PySide6 import QtWidgets, QtWebEngineWidgets;app = QtWidgets.QApplication([]);widget = QtWebEngineWidgets.QWebEngineView();widget.resize(800, 600);widget.show();sys.exit(app.exec())"
    This should pop-up a blank window:
    image
    and print information about the qt.webenginecontext:
    qt.webenginecontext:
    
    GL Type: desktop
    Surface Type: OpenGL
    Surface Profile: CompatibilityProfile
    Surface Version: 4.6
    QSG RHI Backend: OpenGL
    Using Supported QSG Backend: yes
    Using Software Dynamic GL: no
    Using Multithreaded OpenGL: yes
    
    Init Parameters:
      *  application-name python
      *  browser-subprocess-path C:\Users\Christian\.conda\envs\py310usd2211\lib\site-packages\PySide6\.\QtWebEngineProcess.exe
      *  create-default-gl-context
      *  disable-es3-gl-context
      *  disable-features ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture
      *  disable-speech-api
      *  enable-features NetworkServiceInProcess,TracingServiceInProcess
      *  enable-threaded-compositing
      *  in-process-gpu
      *  use-gl desktop
    

Also, was PySide6 installed via pip or built from source?

@hamedsabri
Copy link
Author

Hi @chrizzFTD Thanks for the quick reply.

  1. I still get a crash but this time it happens in the pyside6 library.
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               Python [86248]
Path:                  /opt/local/Library/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/Python
Identifier:            org.python.python
Version:               3.9.16 (3.9.16)
Code Type:             ARM-64 (Native)
Parent Process:        zsh [89151]
Responsible:           Terminal [59366]
User ID:               502

Date/Time:             2023-06-05 10:53:43.3454 -0400
OS Version:            macOS 13.3.1 (22E772610a)
Report Version:        12
Anonymous UUID:        055A5BC9-2682-3689-DCEF-2ECEB6CC6612

Sleep/Wake UUID:       2587DF5C-D9F8-4BA7-9381-1C3DF26481DE

Time Awake Since Boot: 1100000 seconds
Time Since Wake:       9378 seconds

System Integrity Protection: enabled

Crashed Thread:        0  CrBrowserMain  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000008
Exception Codes:       0x0000000000000001, 0x0000000000000008

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [86248]

VM Region Info: 0x8 is not in any region.  Bytes before following region: 105553518919672
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      MALLOC_NANO (reserved)   600018000000-600020000000 [128.0M] rw-/rwx SM=NUL  ...(unallocated)

Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread
0   libpyside6.abi3.6.4.dylib     	       0x1174a8918 PySide::getWrapperForQObject(QObject*, _typeobject*) + 248
1   QtCore.abi3.so                	       0x12696f184 QObjectWrapper::eventFilter(QObject*, QEvent*) + 184
2   QtCore                        	       0x12734904c QCoreApplicationPrivate::sendThroughApplicationEventFilters(QObject*, QEvent*) + 228
  1. This is the print information about the qt.webenginecontext:
GL Type: core_profile
Surface Type: OpenGL
Surface Profile: CoreProfile
Surface Version: 4.1
QSG RHI Backend: OpenGL
Using Supported QSG Backend: yes
Using Software Dynamic GL: no
Using Multithreaded OpenGL: yes

Init Parameters:
  *  application-name Python 
  *  browser-subprocess-path /opt/homebrew/lib/python3.9/site-packages/PySide6/Qt/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess 
  *  disable-features ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture 
  *  disable-speech-api  
  *  enable-features NetworkServiceInProcess,TracingServiceInProcess 
  *  enable-threaded-compositing  
  *  in-process-gpu  
  *  use-gl core_profile 

I installed PySide6 via pip.

@chrizzFTD
Copy link
Collaborator

Hi @hamedsabri, thanks for the feedback.

I've not been able to get a Mac to try this on and my web searches have not brought anything meaningful, so I'm afraid I don't have any updates yet. In the meantime, the only two next steps that I can think of are:

  1. PySide6-6.5.1.1 was released earlier this month, it would be good to confirm if the crash continues on that version.
  2. If crash continues, and if you are in control of building USD from source, is there a chance you could give this a try with PySide2 instead? For that, I think you'd have to build USD again, which can be time consuming, so I understand if you prefer not to.

On my side I've tested successfully PySide2 and PySide6 on Windows, as well as PySide2 on CentOS-7 :/

@chrizzFTD
Copy link
Collaborator

Hi @hamedsabri, it's been a while!

From #35 (grill=0.16.0), there is now a possibility to avoid the use of QtWebEngineWidgets which is what leads to crashes in a couple of systems, controlled through an environment variable (more details here). You should be able to achieve this with:

GRILL_SVG_VIEW_AS_PIXMAP=1 usdview /path/to/Kitchen_set.usd

And no crashes should appear.

Could you give it a try and let me know if this works out for you, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants