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

Windows: viewer crashed when opening linear_wave #132

Open
tigercosmos opened this issue Oct 19, 2022 · 13 comments
Open

Windows: viewer crashed when opening linear_wave #132

tigercosmos opened this issue Oct 19, 2022 · 13 comments
Labels
bug Something isn't working crash The system crashes viewer Visualize stuff

Comments

@tigercosmos
Copy link
Collaborator

tigercosmos commented Oct 19, 2022

Windows11, VS2022, QT6.3.2, source code with the latest master

when loading an app except the sample_mesh, it will crash with:

Unhandled exception at 0x00007FF9CB82428C in viewer.exe: Microsoft C++ exception: pybind11::error_already_set at memory location 0x00000085989B7E68.
 	KernelBase.dll!00007ff9cb82428c()	Unknown
 	vcruntime140d.dll!00007ff901cab650()	Unknown
>	viewer.exe!pybind11::module_::import(const char * name) Line 1199	C++
 	viewer.exe!modmesh::RApplication::{ctor}::__l2::<lambda_3>::operator()() Line 96	C++
 	[External Code]	
 	viewer.exe!QtPrivate::FunctorCall<QtPrivate::IndexesList<>,QtPrivate::List<>,void,std::function<void __cdecl(void)>>::call(std::function<void __cdecl(void)> & f, void * * arg) Line 163	C++
 	viewer.exe!QtPrivate::Functor<std::function<void __cdecl(void)>,0>::call<QtPrivate::List<>,void>(std::function<void __cdecl(void)> & f, void * __formal, void * * arg) Line 278	C++
 	viewer.exe!QtPrivate::QFunctorSlotObject<std::function<void __cdecl(void)>,0,QtPrivate::List<>,void>::impl(int which, QtPrivate::QSlotObjectBase * this_, QObject * r, void * * a, bool * ret) Line 450	C++
 	Qt6Cored.dll!QtPrivate::QSlotObjectBase::call(QObject * r, void * * a) Line 399	C++
 	Qt6Cored.dll!doActivate<0>(QObject * sender, int signal_index, void * * argv) Line 3921	C++
 	Qt6Cored.dll!QMetaObject::activate(QObject * sender, const QMetaObject * m, int local_signal_index, void * * argv) Line 3982	C++
 	Qt6Guid.dll!QAction::triggered(bool _t1) Line 501	C++
 	Qt6Guid.dll!QAction::activate(QAction::ActionEvent event) Line 1133	C++
 	Qt6Widgetsd.dll!QMenuPrivate::activateCausedStack(const QList<QPointer<QWidget>> & causedStack, QAction * action, QAction::ActionEvent action_e, bool self) Line 1430	C++
 	Qt6Widgetsd.dll!QMenuPrivate::activateAction(QAction * action, QAction::ActionEvent action_e, bool self) Line 1508	C++
 	Qt6Widgetsd.dll!QMenu::mouseReleaseEvent(QMouseEvent * e) Line 2931	C++
 	Qt6Widgetsd.dll!QWidget::event(QEvent * event) Line 8834	C++
 	Qt6Widgetsd.dll!QMenu::event(QEvent * e) Line 3056	C++
 	Qt6Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3350	C++
 	Qt6Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 2839	C++
 	Qt6Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1067	C++
 	Qt6Cored.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) Line 1498	C++
 	Qt6Widgetsd.dll!QApplicationPrivate::sendMouseEvent(QWidget * receiver, QMouseEvent * event, QWidget * alienWidget, QWidget * nativeWidget, QWidget * * buttonDown, QPointer<QWidget> & lastMouseReceiver, bool spontaneous, bool onlyDispatchEnterLeave) Line 2423	C++
 	Qt6Widgetsd.dll!QWidgetWindow::handleMouseEvent(QMouseEvent * event) Line 564	C++
 	Qt6Widgetsd.dll!QWidgetWindow::event(QEvent * event) Line 286	C++
 	Qt6Widgetsd.dll!QApplicationPrivate::notify_helper(QObject * receiver, QEvent * e) Line 3350	C++
 	Qt6Widgetsd.dll!QApplication::notify(QObject * receiver, QEvent * e) Line 3301	C++
 	Qt6Cored.dll!QCoreApplication::notifyInternal2(QObject * receiver, QEvent * event) Line 1067	C++
 	Qt6Cored.dll!QCoreApplication::sendSpontaneousEvent(QObject * receiver, QEvent * event) Line 1498	C++
 	Qt6Guid.dll!QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent * e) Line 2278	C++
 	Qt6Guid.dll!QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent * e) Line 2027	C++
 	Qt6Guid.dll!QWindowSystemInterface::sendWindowSystemEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 1143	C++
 	Qt6Guid.dll!QWindowsGuiEventDispatcher::sendPostedEvents() Line 81	C++
 	Qt6Cored.dll!QEventDispatcherWin32::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 476	C++
 	Qt6Guid.dll!QWindowsGuiEventDispatcher::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 72	C++
 	Qt6Cored.dll!QEventLoop::processEvents(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 137	C++
 	Qt6Cored.dll!QEventLoop::exec(QFlags<enum QEventLoop::ProcessEventsFlag> flags) Line 218	C++
 	Qt6Cored.dll!QCoreApplication::exec() Line 1388	C++
 	Qt6Guid.dll!QGuiApplication::exec() Line 1888	C++
 	Qt6Widgetsd.dll!QApplication::exec() Line 2632	C++
 	viewer.exe!main(int argc, char * * argv) Line 63	C++
 	viewer.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 97	C++
@tigercosmos tigercosmos changed the title viewer crashed when opening linear_wave Windows: viewer crashed when opening linear_wave Oct 19, 2022
@yungyuc
Copy link
Member

yungyuc commented Oct 19, 2022

It looks like an uncaught Python exception of missing module on import. Could you try adding Python exception handling code around it to see what is the Python call stack?

And most likely you did not have PySide6 installed.

@yungyuc yungyuc added bug Something isn't working viewer Visualize stuff labels Oct 19, 2022
@tigercosmos
Copy link
Collaborator Author

#106 (comment)

@yungyuc
Copy link
Member

yungyuc commented Oct 20, 2022

Do you want to use a separate issue for the Python call stack enhancement, or just this one?

@tigercosmos
Copy link
Collaborator Author

@yungyuc Maybe a new issue. I think they are separated.

@tigercosmos
Copy link
Collaborator Author

the reason is due to this line win = ApplicationWindow(), when it run super().__init__() in ApplicationWindow
error message: QWidget: Must construct a QApplication before a QWidget

if MacOS or Linux work, maybe it's an issue from upstream (from matplotlib.backends.qt_compat import QtWidgets)?
cc @yungyuc

@yungyuc
Copy link
Member

yungyuc commented Nov 25, 2022

QtWidgets uses PySide6, in which you can trace into too (through the mpl code).

@tigercosmos
Copy link
Collaborator Author

cc @tychuang1211

@tychuang2385
Copy link
Contributor

If it's about matplotlib, maybe it's related with this?

@yungyuc yungyuc added the crash The system crashes label Dec 7, 2022
@yungyuc
Copy link
Member

yungyuc commented Dec 8, 2022

linear_wave is an old prototype. Once the prototype euler1d is done, it should be migrated to the new style.

@tigercosmos
Copy link
Collaborator Author

@yungyuc this issue is caused by win = ApplicationWindow(), which is in both old and new prototypes.

@yungyuc
Copy link
Member

yungyuc commented Dec 8, 2022

@tigercosmos euler1d does not work like that anymore. Please take a look at:

plt = Plotter(shocktube=st, max_steps=max_steps)

@yungyuc
Copy link
Member

yungyuc commented Dec 10, 2022

@tigercosmos could you help test if #168 fixes this issue?

@tigercosmos tigercosmos removed their assignment Dec 22, 2022
@yungyuc
Copy link
Member

yungyuc commented Jan 23, 2023

@tigercosmos do you think this issue is still there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crash The system crashes viewer Visualize stuff
Projects
None yet
Development

No branches or pull requests

3 participants