Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
GraphPerspective fix: the program may hang on close as soon as a QtWe…
Browse files Browse the repository at this point in the history
…bProcessEngineProcess is still running after a geographic has been created, so force an exit call
  • Loading branch information
p-mary committed Mar 12, 2019
1 parent 8ded4f2 commit 00cf587
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins/perspective/GraphPerspective/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
INCLUDE_DIRECTORIES(${TulipCoreBuildInclude} ${TulipCoreInclude} ${TulipOGLInclude} ${TulipGUIInclude} ${OPENGL_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include)

QTXWEB_SET_INCLUDES_AND_DEFINITIONS()

SET(LIB_SRCS
src/AlgorithmRunner.cpp
src/AlgorithmRunnerItem.cpp
7 changes: 7 additions & 0 deletions plugins/perspective/GraphPerspective/src/GraphPerspective.cpp
Original file line number Diff line number Diff line change
@@ -309,6 +309,13 @@ bool GraphPerspective::terminated() {
}
}

#ifdef QT_HAS_WEBENGINE
// the perspective may hang if a QtWebEngineProcess
// is still running (launched by the GeographicView)
// so we call exit instead of return
exit(0);
#endif

return true;
}

3 comments on commit 00cf587

@anlambert
Copy link
Contributor

@anlambert anlambert commented on 00cf587 Mar 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not observe that from my side. I assume because I never compile Tulip in Debug mode.
Did you try to debug the issue with gdb to get more details on the hang ?

@p-mary
Copy link
Contributor Author

@p-mary p-mary commented on 00cf587 Mar 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the simple stack I observed using gdb

#0 0x00007ffff430774d in poll () at ../sysdeps/unix/syscall-template.S:84
#1 0x00007fffef72e38c in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007fffef72e49c in g_main_context_iteration ()
from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007ffff4e381ef in QEventDispatcherGlib::processEvents(QFlagsQEventLoop::ProcessEventsFlag) () from /code/Qt_5.12.1/gcc_64/lib/libQt5Core.so.5
#4 0x00007ffff4ddf78a in QEventLoop::exec(QFlagsQEventLoop::ProcessEventsFlag) () from /code/Qt_5.12.1/gcc_64/lib/libQt5Core.so.5
#5 0x00007ffff4de8190 in QCoreApplication::exec() ()
from /code/Qt_5.12.1/gcc_64/lib/libQt5Core.so.5
#6 0x000000000042449c in main (argc=1, argv=0x7fffffffde48)
at /code/tulipdev/tulip_dev/software/tulip_perspective/src/main.cpp:350

and 3 QtWebEngineProcess programs were still running.

@anlambert
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, you are using the Qt distribution from https://qt.io. If you are using the qt5 packages from your Linux distribution, I do not think the issue will occur. I need to check that, there must be a way to properly terminate the WebEngine processes.

Please sign in to comment.