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

Casper: Segmentation fault #2810

Closed
sgpearse opened this issue Jul 15, 2021 · 8 comments
Closed

Casper: Segmentation fault #2810

sgpearse opened this issue Jul 15, 2021 · 8 comments
Assignees
Milestone

Comments

@sgpearse
Copy link
Collaborator

To reproduce:

  1. On Casper, build a debug version of Vapor on main
  2. Run vapor, and close it

Most of the time the application will seg fault. Sometimes it gets lucky. I haven't seen this after loading data.

@sgpearse sgpearse added the Bug label Jul 15, 2021
@sgpearse sgpearse added this to To do in Release 3.5.0 via automation Jul 19, 2021
@sgpearse sgpearse added the High label Jul 19, 2021
@clyne clyne added this to the 3_5_0 release milestone Jul 19, 2021
@shaomeng
Copy link
Collaborator

Might be a usage of QT windows/widgets that went wrong, but cannot identify what:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2aaadb6c4700 (LWP 203138)]
0x00002aaab0856ce8 in QAbstractEventDispatcherPrivate::allocateTimerId() () from /lib64/libQt5Core.so.5
(gdb) bt
#0  0x00002aaab0856ce8 in QAbstractEventDispatcherPrivate::allocateTimerId() () at /lib64/libQt5Core.so.5
#1  0x00002aaab0857179 in QAbstractEventDispatcher::registerTimer(int, Qt::TimerType, QObject*) ()
    at /lib64/libQt5Core.so.5
#2  0x00002aaab0883e9e in QObject::startTimer(int, Qt::TimerType) () at /lib64/libQt5Core.so.5
#3  0x00002aaaaababec4 in qDBusAddTimeout () at /lib64/libQt5DBus.so.5
#4  0x00002aaab2e65ddb in _dbus_timeout_list_add_timeout () at /lib64/libdbus-1.so.3
#5  0x00002aaab2e508ba in dbus_connection_send_with_reply () at /lib64/libdbus-1.so.3
#6  0x00002aaaaabaf6d3 in QDBusConnectionPrivate::sendInternal(QDBusPendingCallPrivate*, void*, int) ()
    at /lib64/libQt5DBus.so.5
#7  0x00002aaab08831de in QObject::event(QEvent*) () at /lib64/libQt5Core.so.5
#8  0x00002aaab0859b05 in doNotify(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#9  0x00002aaab0859c1b in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#10 0x00002aaab085c503 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
    at /lib64/libQt5Core.so.5
#11 0x00002aaab08a8ab3 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () at /lib64/libQt5Core.so.5
#12 0x00002aaab7470099 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#13 0x00002aaab74703f8 in g_main_context_iterate.isra.19 () at /lib64/libglib-2.0.so.0
#14 0x00002aaab74704ac in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#15 0x00002aaab08a845c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
    at /lib64/libQt5Core.so.5
#16 0x00002aaab08586db in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#17 0x00002aaab06ab7f8 in QThread::exec() () at /lib64/libQt5Core.so.5
#18 0x00002aaaaaba03b5 in QDBusConnectionManager::run() () at /lib64/libQt5DBus.so.5
#19 0x00002aaab06afe71 in QThreadPrivate::start(void*) () at /lib64/libQt5Core.so.5
#20 0x00002aaaae293ea5 in start_thread () at /lib64/libpthread.so.0
#21 0x00002aaab144c8dd in clone () at /lib64/libc.so.6

@clyne
Copy link
Collaborator

clyne commented Jul 20, 2021

@shaomeng have you tried valgrind?

@shaomeng
Copy link
Collaborator

shaomeng commented Jul 20, 2021

@shaomeng have you tried valgrind?

Valgrind finds hundreds of problematic blocks during a simple open vapor close vapor operation. (almost half a million if you look at the still reachable block count, though I don't know what that means.) Don't know how helpful it is to this particular issue. (But definitely tells something about vapor and qt and other dependencies as a whole.)

==1320406== HEAP SUMMARY:
==1320406==     in use at exit: 41,442,031 bytes in 481,113 blocks
==1320406==   total heap usage: 2,894,124 allocs, 2,413,011 frees, 5,798,714,793 bytes allocated
==1320406== 
==1320406== LEAK SUMMARY:
==1320406==    definitely lost: 13,752 bytes in 180 blocks
==1320406==    indirectly lost: 60,136 bytes in 597 blocks
==1320406==      possibly lost: 4,320 bytes in 34 blocks
==1320406==    still reachable: 41,281,191 bytes in 479,628 blocks
==1320406==                       of which reachable via heuristic:
==1320406==                         stdstring          : 33 bytes in 1 blocks
==1320406==                         length64           : 4,960 bytes in 82 blocks
==1320406==                         newarray           : 2,096 bytes in 51 blocks
==1320406==                         multipleinheritance: 53,744 bytes in 38 blocks
==1320406==         suppressed: 0 bytes in 0 blocks
==1320406== Rerun with --leak-check=full to see details of leaked memory

Resources:
This discussion concludes that "still reachable" blocks don't pose threats most of the times.

@shaomeng
Copy link
Collaborator

Regarding reproducing on other linux platforms:
I cannot reproduce it on cisl-vapor after 2 dozens of tries.

@clyne
Copy link
Collaborator

clyne commented Jul 20, 2021

At one time @StasJ had a filter set up that would remove the Qt and OpenGL errors and leave you with useful information.

@sgpearse
Copy link
Collaborator Author

Need to test on test platforms with installer build.

@sgpearse
Copy link
Collaborator Author

@shaomeng Will test this with an installer on Casper.

@clyne
Copy link
Collaborator

clyne commented Jul 28, 2021

@shaomeng just a reminder that we still need to test after casper comes back up

cc: @sgpearse

@StasJ StasJ closed this as completed Aug 4, 2021
Release 3.5.0 automation moved this from To do to Done Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

4 participants