Closed charlesfleche closed 4 years ago
Ah, something new: importing QtWidgets
before QtCore
does not segfault anymore:
$ python -c 'from pxr.UsdQt._Qt import QtWidgets, QtCore'
Tests fail with AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
, though:
$ python pxr/usdQt/testenv/testUsdQtHierarchyModel.py
test_ActivateAndDeactivate (__main__.TestSimpleHierarchyAllLoaded) ... ERROR
test_ActivateOnly (__main__.TestSimpleHierarchyAllLoaded) ... ERROR
test_BadVariantSwitch (__main__.TestSimpleHierarchyAllLoaded) ... ERROR
test_DeactivateAndReactivate (__main__.TestSimpleHierarchyAllLoaded) ... ERROR
test_DeactivateOnly (__main__.TestSimpleHierarchyAllLoaded) ... ERROR
test_RootStructure (__main__.TestSimpleHierarchyAllLoaded) ... ERROR
test_SelectionLayoutChanged (__main__.TestSimpleHierarchyAllLoaded) ... ERROR
test_UnmodifiedFilterModel (__main__.TestSimpleHierarchyAllLoaded) ... ERROR
test_UnmodifiedStage (__main__.TestSimpleHierarchyAllLoaded) ... ERROR
test_VariantSwitch (__main__.TestSimpleHierarchyAllLoaded) ... ERROR
test_ActivateAndDeactivate (__main__.TestSimpleHierarchyDefault) ... ERROR
test_ActivateOnly (__main__.TestSimpleHierarchyDefault) ... ERROR
test_BadVariantSwitch (__main__.TestSimpleHierarchyDefault) ... ERROR
test_DeactivateAndReactivate (__main__.TestSimpleHierarchyDefault) ... ERROR
test_DeactivateOnly (__main__.TestSimpleHierarchyDefault) ... ERROR
test_RootStructure (__main__.TestSimpleHierarchyDefault) ... ERROR
test_SelectionLayoutChanged (__main__.TestSimpleHierarchyDefault) ... ERROR
test_UnmodifiedFilterModel (__main__.TestSimpleHierarchyDefault) ... ERROR
test_UnmodifiedStage (__main__.TestSimpleHierarchyDefault) ... ERROR
test_VariantSwitch (__main__.TestSimpleHierarchyDefault) ... ERROR
======================================================================
ERROR: test_ActivateAndDeactivate (__main__.TestSimpleHierarchyAllLoaded)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_ActivateOnly (__main__.TestSimpleHierarchyAllLoaded)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_BadVariantSwitch (__main__.TestSimpleHierarchyAllLoaded)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_DeactivateAndReactivate (__main__.TestSimpleHierarchyAllLoaded)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_DeactivateOnly (__main__.TestSimpleHierarchyAllLoaded)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_RootStructure (__main__.TestSimpleHierarchyAllLoaded)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_SelectionLayoutChanged (__main__.TestSimpleHierarchyAllLoaded)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_UnmodifiedFilterModel (__main__.TestSimpleHierarchyAllLoaded)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_UnmodifiedStage (__main__.TestSimpleHierarchyAllLoaded)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_VariantSwitch (__main__.TestSimpleHierarchyAllLoaded)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_ActivateAndDeactivate (__main__.TestSimpleHierarchyDefault)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_ActivateOnly (__main__.TestSimpleHierarchyDefault)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_BadVariantSwitch (__main__.TestSimpleHierarchyDefault)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_DeactivateAndReactivate (__main__.TestSimpleHierarchyDefault)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_DeactivateOnly (__main__.TestSimpleHierarchyDefault)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_RootStructure (__main__.TestSimpleHierarchyDefault)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_SelectionLayoutChanged (__main__.TestSimpleHierarchyDefault)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_UnmodifiedFilterModel (__main__.TestSimpleHierarchyDefault)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_UnmodifiedStage (__main__.TestSimpleHierarchyDefault)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
======================================================================
ERROR: test_VariantSwitch (__main__.TestSimpleHierarchyDefault)
----------------------------------------------------------------------
Traceback (most recent call last):
File "pxr/usdQt/testenv/testUsdQtHierarchyModel.py", line 53, in setUp
self.model = UsdQt.HierarchyStandardModel(self.stage)
AttributeError: 'module' object has no attribute 'HierarchyStandardModel'
----------------------------------------------------------------------
Ran 20 tests in 0.134s
FAILED (errors=20)
Hey @charlesfleche,
The UsdQt
and UsdQtEditors
modules are intentionally empty. The intent is for you to import what you need and nothing else.
However, you're definitely right that all of the tests are broken... It looks like we didn't update them after we stopped importing everything into the top-level package modules. Luckily they should be easy to fix - I'll try to take care of that shortly.
In terms of the crashing, you're sort of in unexplored territory there. We're still on CentOS 7.3 here for the time being, and we've only gone as far as VFXPlatform 2018. I'll see if I can put together a newer build environment at some point, but I'm not sure when that will be right now.
Great news, thanks @nrusch If the tests work, I'm happy to take a look at building on a more recent environment.
By the way, this segfaults as well:
$ python -c 'from pxr.UsdQt import hierarchyModel'
Segmentation fault
(tested on CentOS 7.4, gcc 4.8.5, USD 19.07 compiled with their build script, usq-qt compiled against the USD platform)
Hmm. Have you confirmed that both PySide2 and the Python bindings for your USD build work independently in your runtime environment (i.e. without getting UsdQt involved at all)?
If both of those work fine, but importing UsdQt causes a crash, it would be helpful if you could capture and post a stack trace of the crash (using GDB), and maybe also include your runtime environment.
Thanks.
Yes: usdview
works, using the PySide2 bindings. I'll send you a stack trace ASAP.
Within usdview
:
Usdviewq.qt.QtWidgets.__file__
'/devLocal/src/PixarAnimationStudios/USD/env/lib/python2.7/site-packages/PySide2/QtWidgets.so'
For some reason I'm having an hard time importing PySide2
in python-debug
, so I can't meaningfully run it in gdb. However, here is a trace for:
$ strace python -c 'from pxr.UsdQt import hierarchyModel' &> trace.txt
You don't need to run any debug builds to capture a stack trace. Since I don't have a comparable test environment on my end, at this point I'm mostly interested in figuring out if the crash is actually occurring in UsdQt itself, or if UsdQt is just happening to trip something up in another library.
Unfortunately strace output isn't much to go on in this instance.
/opt/usd-qt/build# make install
Scanning dependencies of target _usdQt_pythonfiles
[ 2%] Generating _Qt.pyc
[ 4%] Generating init.pyc
[ 6%] Generating _bindings.pyc
[ 8%] Generating compatability.pyc
[ 11%] Generating hierarchyModel.pyc
[ 13%] Generating hooks.pyc
[ 15%] Generating layerModel.pyc
[ 17%] Generating opinionModel.pyc
[ 20%] Generating opinionStackModel.pyc
[ 22%] Generating qtUtils.pyc
[ 24%] Generating roles.pyc
[ 26%] Generating stageCacheModel.pyc
[ 28%] Generating usdUtils.pyc
[ 31%] Generating valueDelegate.pyc
[ 33%] Generating valueWidgets.pyc
[ 33%] Built target _usdQt_pythonfiles
Scanning dependencies of target _usdQt
[ 35%] Building CXX object pxr/usdQt/CMakeFiles/_usdQt.dir/attributeProxy.cpp.o
[ 37%] Building CXX object pxr/usdQt/CMakeFiles/_usdQt.dir/debugCodes.cpp.o
[ 40%] Building CXX object pxr/usdQt/CMakeFiles/_usdQt.dir/displayGroupProxy.cpp.o
[ 42%] Building CXX object pxr/usdQt/CMakeFiles/_usdQt.dir/hierarchyCache.cpp.o
/opt/usd-qt/pxr/usdQt/hierarchyCache.cpp: 在成员函数‘void pxrInternal_v0_19pxrReserved::UsdQt_HierarchyCache::DebugFullIndex()’中:
/opt/usd-qt/pxr/usdQt/hierarchyCache.cpp:241:15: 错误:无法将左值‘std::basic_ostream
Closing this one out, as it's pretty old, and we are running usd-qt successfully on CentOS 7.7 now.
After importing
UsdQt
, the module is actually empty:I then wanted to run the tests to see if everything was OK on that side, but
UsdQt
segfaults when importing bothQtCore
andQtWidgets
fromUsdQt._Qt
:Importing just one or the other
QtCore
orQtWidgets
works fine.I've built
usq-qt
(with patches) against different built USD 19.07 and 19.05:In every case the imports fail.
I've built
usd-qt
with gcc 4.8.5 and gcc 6 (from devtoolset-6 using this cmake command:Am I doing something wrong here ?
Thanks,