I have a class that I move to a background thread that constantly checks a server for updated settings. If the settings were updated then I emit a signal that forces the program to restart with the new settings. The problem I'm having is when I try to emit the signal it throws a segfault.
Where I connect this signal to the slot I want it to call.
connect(&settings_agent, SIGNAL(updatedSettingsNotification()), LCD,SLOT(restarting()));
connect(&settings_agent, SIGNAL(updatedSettingsNotification()), LCD,SLOT(restarting()));
To copy to clipboard, switch view to plain text mode
This signal that I am trying to emit:
void SettingsFileRetrievalAgent::handleDeletedRegistration()
{
emit updatedSettingsNotification(); //if delete registration, this can cause a crash (let it run maybe 15 seconds after startup).
}
void SettingsFileRetrievalAgent::handleDeletedRegistration()
{
emit updatedSettingsNotification(); //if delete registration, this can cause a crash (let it run maybe 15 seconds after startup).
}
To copy to clipboard, switch view to plain text mode
This is the result from GDB Debugger:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 30704.0x7c2c]
0x6a2b0e31 in QObjectPrivate::isSignalConnected (this=0x0, signal_index=3)
at ../../include/QtCore/private/../../../../../../../ndk_buildrepos/qt-desktop/src/corelib/kernel/qobject_p.h:219
219 ../../include/QtCore/private/../../../../../../../ndk_buildrepos/qt-desktop/src/corelib/kernel/qobject_p.h: No
uch file or directory.
in ../../include/QtCore/private/../../../../../../../ndk_buildrepos/qt-desktop/src/corelib/kernel/qobject_p.h
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 30704.0x7c2c]
0x6a2b0e31 in QObjectPrivate::isSignalConnected (this=0x0, signal_index=3)
at ../../include/QtCore/private/../../../../../../../ndk_buildrepos/qt-desktop/src/corelib/kernel/qobject_p.h:219
219 ../../include/QtCore/private/../../../../../../../ndk_buildrepos/qt-desktop/src/corelib/kernel/qobject_p.h: No
uch file or directory.
in ../../include/QtCore/private/../../../../../../../ndk_buildrepos/qt-desktop/src/corelib/kernel/qobject_p.h
To copy to clipboard, switch view to plain text mode
The result when I do a bt:
#0 0x6a2b0e31 in QObjectPrivate::isSignalConnected (this=0x0, signal_index=3)
at ../../include/QtCore/private/../../../../../../../ndk_buildrepos/qt-desktop/src/cor
#1 0x6a2164d8 in QMetaObject::activate (sender=0x28d2cc, m=0x4a80cc, local_signal_index=1
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qobject.cpp:3201
#2 0x0041dced in ?? ()
#3 0x0040fd66 in ?? ()
#4 0x0041dc73 in ?? ()
#5 0x6a205ff8 in QMetaObject::metacall (object=0x28d2cc, cl=QMetaObject::InvokeMetaMethod
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qmetaobject.cpp:237
#6 0x6a210c9d in QMetaCallEvent::placeMetaCall (this=0xe0a67b8, object=0x28d2cc)
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qobject.cpp:535
#7 0x6a212ba8 in QObject::event (this=0x28d2cc, e=0xe0a67b8)
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qobject.cpp:1217
#8 0x0111bd88 in QApplicationPrivate::notify_helper (this=0xa0d6bb8, receiver=0x28d2cc, e
at c:\ndk_buildrepos\qt-desktop\src\gui\kernel\qapplication.cpp:4462
#9 0x011196da in QApplication::notify (this=0x28fe4c, receiver=0x28d2cc, e=0xe0a67b8)
at c:\ndk_buildrepos\qt-desktop\src\gui\kernel\qapplication.cpp:3862
#10 0x6a201540 in QCoreApplication::notifyInternal (this=0x28fe4c, receiver=0x28d2cc, even
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qcoreapplication.cpp:731
#11 0x6a268258 in QCoreApplication::sendEvent (receiver=0x28d2cc, event=0xe0a67b8)
at c:/ndk_buildrepos/qt-desktop/src/corelib/kernel//qcoreapplication.h:215
#12 0x6a2025eb in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, d
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qcoreapplication.cpp:1372
#13 0x6a2248e7 in qt_internal_proc (hwnd=0x440ba8, message=1025, wp=0, lp=0)
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qeventdispatcher_win.cpp:497
#14 0x75ed62fa in USER32!OffsetRect () from C:\Windows\syswow64\user32.dll
#15 0x00440ba8 in ?? ()
#16 0x75ed6d3a in USER32!IsWindow () from C:\Windows\syswow64\user32.dll
#17 0x6a22467e in qt_fast_timer_proc (timerId=0, user=4459432)
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qeventdispatcher_win.cpp:429
#18 0x75ed77c4 in USER32!AnyPopup () from C:\Windows\syswow64\user32.dll
#19 0x00000000 in ?? ()
#0 0x6a2b0e31 in QObjectPrivate::isSignalConnected (this=0x0, signal_index=3)
at ../../include/QtCore/private/../../../../../../../ndk_buildrepos/qt-desktop/src/cor
#1 0x6a2164d8 in QMetaObject::activate (sender=0x28d2cc, m=0x4a80cc, local_signal_index=1
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qobject.cpp:3201
#2 0x0041dced in ?? ()
#3 0x0040fd66 in ?? ()
#4 0x0041dc73 in ?? ()
#5 0x6a205ff8 in QMetaObject::metacall (object=0x28d2cc, cl=QMetaObject::InvokeMetaMethod
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qmetaobject.cpp:237
#6 0x6a210c9d in QMetaCallEvent::placeMetaCall (this=0xe0a67b8, object=0x28d2cc)
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qobject.cpp:535
#7 0x6a212ba8 in QObject::event (this=0x28d2cc, e=0xe0a67b8)
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qobject.cpp:1217
#8 0x0111bd88 in QApplicationPrivate::notify_helper (this=0xa0d6bb8, receiver=0x28d2cc, e
at c:\ndk_buildrepos\qt-desktop\src\gui\kernel\qapplication.cpp:4462
#9 0x011196da in QApplication::notify (this=0x28fe4c, receiver=0x28d2cc, e=0xe0a67b8)
at c:\ndk_buildrepos\qt-desktop\src\gui\kernel\qapplication.cpp:3862
#10 0x6a201540 in QCoreApplication::notifyInternal (this=0x28fe4c, receiver=0x28d2cc, even
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qcoreapplication.cpp:731
#11 0x6a268258 in QCoreApplication::sendEvent (receiver=0x28d2cc, event=0xe0a67b8)
at c:/ndk_buildrepos/qt-desktop/src/corelib/kernel//qcoreapplication.h:215
#12 0x6a2025eb in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, d
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qcoreapplication.cpp:1372
#13 0x6a2248e7 in qt_internal_proc (hwnd=0x440ba8, message=1025, wp=0, lp=0)
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qeventdispatcher_win.cpp:497
#14 0x75ed62fa in USER32!OffsetRect () from C:\Windows\syswow64\user32.dll
#15 0x00440ba8 in ?? ()
#16 0x75ed6d3a in USER32!IsWindow () from C:\Windows\syswow64\user32.dll
#17 0x6a22467e in qt_fast_timer_proc (timerId=0, user=4459432)
at c:\ndk_buildrepos\qt-desktop\src\corelib\kernel\qeventdispatcher_win.cpp:429
#18 0x75ed77c4 in USER32!AnyPopup () from C:\Windows\syswow64\user32.dll
#19 0x00000000 in ?? ()
To copy to clipboard, switch view to plain text mode
this=0x0
this=0x0
To copy to clipboard, switch view to plain text mode
I'm assuming this is the problem. I don't know if it's related to how the QThreads and Signals work, I just can't seem to figure out what the problem is. Any hints or ideas as to why this is happening would be great.
Bookmarks