Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Clicking ‘reconnect’ under Connection Settings causes Segmentation fault #5758

Closed
hart0 opened this issue Aug 2, 2019 · 3 comments · May be fixed by #5766
Closed

Clicking ‘reconnect’ under Connection Settings causes Segmentation fault #5758

hart0 opened this issue Aug 2, 2019 · 3 comments · May be fixed by #5766
Labels
C-crash The issue contains a crash report

Comments

@hart0
Copy link

hart0 commented Aug 2, 2019

Brief Description

Clicking 'reconnect' under Connection Settings in the Advanced settings tab causes qTox to crash with a segfault.

qTox version: You are using qTox version v1.16.3-570-g174d6ef8
Commit hash: 174d6ef
toxcore: v0.2.10
Qt: 5.12.4

Reproducible: Always
Steps to reproduce

Click 'reconnect' under the Connection Settings area.

Observed Behavior

I originally tried this on a profile with 2 friends, after setting the proxy settings to a Socks proxy and clicking 'reconnect' to attempt to apply the settings without having to restart qTox. However, it crashed.

The crash also happens when I tested it on a brand new profile with 0 friends, and simply clicking 'reconnect' with the default settings (so not changing any port/proxy/settings, just making a new account, going straight to that tab and clicking reconnect).

When testing on the new profile with default proxy/blank connection settings, my status appears to go blank (grey outlined circle), and a few seconds later it crashes. gdb shows:

Thread 1 "qtox" received signal SIGSEGV, Segmentation fault.
0x00007ffff5aa7b0f in tox_self_get_status () from /usr/local/lib64/libtoxcore.so.2

bt shows:

(gdb) bt
#0  0x00007ffff5aa7b0f in tox_self_get_status () at /usr/local/lib64/libtoxcore.so.2
#1  0x00000000006aa65f in Core::getStatus() const (this=0x1275520)
    at /build/qTox/src/core/core.cpp:923
#2  0x0000000000838386 in Widget::onConnected() (this=0xfbdc10)
    at /build/qTox/src/widget/widget.cpp:699
#3  0x00000000006f5a50 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (Widget::*)()>::call(void (Widget::*)(), Widget*, void**)
    (f=(void (Widget::*)(Widget * const)) 0x83833c <Widget::onConnected()>, o=0xfbdc10, arg=0x7fffa8005680) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:152
#4  0x00000000006f525a in QtPrivate::FunctionPointer<void (Widget::*)()>::call<QtPrivate::List<>, void>(void (Widget::*)(), Widget*, void**)
    (f=(void (Widget::*)(Widget * const)) 0x83833c <Widget::onConnected()>, o=0xfbdc10, arg=0x7fffa8005680) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:185
#5  0x00000000006f4cd2 in QtPrivate::QSlotObject<void (Widget::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
    (which=1, this_=0x12a74e0, r=0xfbdc10, a=0x7fffa8005680, ret=0x0)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:414
#6  0x00007ffff44b9bfa in QObject::event(QEvent*) () at /lib64/libQt5Core.so.5
#7  0x00007ffff7841118 in QWidget::event(QEvent*) () at /lib64/libQt5Widgets.so.5
#8  0x00007ffff79558f8 in QMainWindow::event(QEvent*) () at /lib64/libQt5Widgets.so.5
#9  0x0000000000841423 in Widget::event(QEvent*) (this=0xfbdc10, e=0x7fffa800fb50)
    at /build/qTox/src/widget/widget.cpp:2211
#10 0x00007ffff77feaf6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
    at /lib64/libQt5Widgets.so.5
#11 0x00007ffff7807e80 in QApplication::notify(QObject*, QEvent*) ()
    at /lib64/libQt5Widgets.so.5
#12 0x00007ffff448eae8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()

When testing on my normal account which has 2 friends added and a Socks proxy, clicking reconnect causes a slightly different segfault message:

[03:48:13.314 UTC] friendlist.cpp:36 : Warning: addFriend: friendPk already taken
[03:48:13.417 UTC] friendlist.cpp:36 : Warning: addFriend: friendPk already taken
 
Thread 1 "qtox" received signal SIGSEGV, Segmentation fault.
0x00007ffff44b8712 in QMetaObject::activate(QObject*, int, int, void**) ()
   from /lib64/libQt5Core.so.5

And the bt for that profile:

(gdb) bt
#0  0x00007ffff44b8712 in QMetaObject::activate(QObject*, int, int, void**) ()
    at /lib64/libQt5Core.so.5
#1  0x000000000064372d in Core::statusSet(Status::Status)
    (this=0xf17c80, _t1=Status::Status::Offline)
    at /build/qTox/qtox_static_autogen/PRMOGMWJPH/moc_core.cpp:801
#2  0x00000000008383fd in Widget::onDisconnected() (this=0xfb4f30)
    at /build/qTox/src/widget/widget.cpp:705
#3  0x00000000006f5a50 in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (Widget::*)()>::call(void (Widget::*)(), Widget*, void**)
    (f=(void (Widget::*)(Widget * const)) 0x8383ae <Widget::onDisconnected()>, o=0xfb4f30, arg=0x7fffa8012bc0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:152
#4  0x00000000006f525a in QtPrivate::FunctionPointer<void (Widget::*)()>::call<QtPrivate::List<>, void>(void (Widget::*)(), Widget*, void**)
    (f=(void (Widget::*)(Widget * const)) 0x8383ae <Widget::onDisconnected()>, o=0xfb4f30, arg=0x7fffa8012bc0) at /usr/include/qt5/QtCore/qobjectdefs_impl.h:185
#5  0x00000000006f4cd2 in QtPrivate::QSlotObject<void (Widget::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
    (which=1, this_=0x12be080, r=0xfb4f30, a=0x7fffa8012bc0, ret=0x0)
    at /usr/include/qt5/QtCore/qobjectdefs_impl.h:414
#6  0x00007ffff44b9bfa in QObject::event(QEvent*) () at /lib64/libQt5Core.so.5
#7  0x00007ffff7841118 in QWidget::event(QEvent*) () at /lib64/libQt5Widgets.so.5
#8  0x00007ffff79558f8 in QMainWindow::event(QEvent*) () at /lib64/libQt5Widgets.so.5
#9  0x0000000000841423 in Widget::event(QEvent*) (this=0xfb4f30, e=0x7fffa8006390)
    at /build/qTox/src/widget/widget.cpp:2211
#10 0x00007ffff77feaf6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
    at /lib64/libQt5Widgets.so.5
#11 0x00007ffff7807e80 in QApplication::notify(QObject*, QEvent*) ()

I tested again with that account and that time gdb blamed QMutex::lock() from /lib64/libQt5Core.so.5, so the reasons it’s giving for the crashes seem to vary.

I also ran this nightly appimage to see if it was caused by my Qt version (appimage uses older 5.7.1) but that crashed too.

@anthonybilinski anthonybilinski added C-bug The issue contains a bug report C-crash The issue contains a crash report labels Aug 2, 2019
@sudden6
Copy link
Member

sudden6 commented Aug 9, 2019

I'm tempted to remove this whole "reconnect" functionality, it's only causing problems and I don't see a great benefit over completely restarting qTox. It's also not clear to the user why there is a reconnect button and when they should use it.

@hart0 since you are actively using that functionality, do you see any problems with that?

I think adding a message to that page, that changing a setting there needs a restart of qTox might be sufficient.

@hart0
Copy link
Author

hart0 commented Aug 9, 2019

@sudden6

I only tried using it originally as I wasn’t sure if I needed to or not after setting my proxy settings on a new account, so I don’t see it causing issues removing it if there is a warning that you need to restart qtox to apply the changes made

@sudden6 sudden6 removed the C-bug The issue contains a bug report label Aug 10, 2019
@anthonybilinski
Copy link
Member

Fixed by #5778, present in nightlies. Closing issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C-crash The issue contains a crash report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants