c++ - what is causing this seq fault in Qt QGuiApplicationPrivate::processNativeEvent() -


i have simple qt program reading shared memory in separate thread. call routine waits until there data in shared memory segment, unblocks , returns , emits signal main gui thread. main gui thread slot received , in routine print std::cout received returns--no further data processing. program runs find 30 seconds seq faults.

running program under gdb catches seq fault , trace shows fault deep in event processing of qt. none of own code involved in seq fault. totally lost problem is.

here gdb output. in following gdb output, readsm() routine 1 blocks until there data available read shared memory, , readdatabuffer() slot main gui thread returns without further processing. there tons of std::cout lines signal , slot before seg fault.

         ...many of following 2 lines before fault...     datareader::readsm(): calling m_psharedmemory->readwait()      readdatabuffer(): entered, returning      datareader::readsm(): calling m_psharedmemory->readwait()      readdatabuffer(): entered, returning 

program received signal sigsegv, segmentation fault. 0xb72f5c54 in qguiapplicationprivate::processnativeevent(qwindow*, qbytearray const&, void*, long*) () /opt/qt/5.2.1/gcc/lib/libqt5gui.so.5 (gdb) (gdb) bt #0 0xb72f5c54 in qguiapplicationprivate::processnativeevent(qwindow*, qbytearray const&, void*, long*) () /opt/qt/5.2.1/gcc/lib/libqt5gui.so.5 #1 0xb72e3ff3 in qwindowsysteminterface::handlenativeevent(qwindow*, qbytearray const&, void*, long*) () /opt/qt/5.2.1/gcc/lib/libqt5gui.so.5 #2 0xb3f40e2d in ?? () /opt/qt/5.2.1/gcc/plugins/platforms/libqxcb.so #3 0xb3f33170 in ?? () /opt/qt/5.2.1/gcc/plugins/platforms/libqxcb.so #4 0xb3f33dce in ?? () /opt/qt/5.2.1/gcc/plugins/platforms/libqxcb.so #5 0xb3f74e8b in ?? () /opt/qt/5.2.1/gcc/plugins/platforms/libqxcb.so #6 0xb701e943 in qmetacallevent::placemetacall(qobject*) () /opt/qt/5.2.1/gcc/lib/libqt5core.so.5 #7 0xb7021d92 in qobject::event(qevent*) () /opt/qt/5.2.1/gcc/lib/libqt5core.so.5 #8 0xb7913eb4 in qapplicationprivate::notify_helper(qobject*, qevent*) () /opt/qt/5.2.1/gcc/lib/libqt5widgets.so.5 #9 0xb7917d00 in qapplication::notify(qobject*, qevent*) () /opt/qt/5.2.1/gcc/lib/libqt5widgets.so.5 #10 0xb6ff3c2e in qcoreapplication::notifyinternal(qobject*, qevent*) () /opt/qt/5.2.1/gcc/lib/libqt5core.so.5 #11 0xb6ff68ec in qcoreapplicationprivate::sendpostedevents(qobject*, int, qthreaddata*) () /opt/qt/5.2.1/gcc/lib/libqt5core.so.5 #12 0xb6ff6e2c in qcoreapplication::sendpostedevents(qobject*, int) () /opt/qt/5.2.1/gcc/lib/libqt5core.so.5 #13 0xb704ad14 in ?? () /opt/qt/5.2.1/gcc/lib/libqt5core.so.5 #14 0xb68a06d3 in g_main_context_dispatch () /lib/i386-linux-gnu/libglib-2.0.so.0 #15 0xb68a0a70 in ?? () /lib/i386-linux-gnu/libglib-2.0.so.0 #16 0xb68a0b51 in g_main_context_iteration () /lib/i386-linux-gnu/libglib-2.0.so.0 #17 0xb704b128 in qeventdispatcherglib::processevents(qflags<qeventloop::processeventsflag>) () /opt/qt/5.2.1/gcc/lib/libqt5core.so.5 #18 0xb3f97836 in ?? () /opt/qt/5.2.1/gcc/plugins/platforms/libqxcb.so #19 0xb6ff22e6 in qeventloop::processevents(qflags<qeventloop::processeventsflag>) () /opt/qt/5.2.1/gcc/lib/libqt5core.so.5 #20 0xb6ff272c in qeventloop::exec(qflags<qeventloop::processeventsflag>) () /opt/qt/5.2.1/gcc/lib/libqt5core.so.5 #21 0xb6ff6ed2 in qcoreapplication::exec() () /opt/qt/5.2.1/gcc/lib/libqt5core.so.5 #22 0xb72f5b04 in qguiapplication::exec() () /opt/qt/5.2.1/gcc/lib/libqt5gui.so.5 #23 0xb790e914 in qapplication::exec() () /opt/qt/5.2.1/gcc/lib/libqt5widgets.so.5 #24 0x0805034b in main () (gdb)

since not processing of data in gui slot, , since program works fine 30 seconds usual signal/slots being called, @ loss @ causing seq fault in qt event processing.

any appreciated.

thanks,

-andres

update: thank andrew medico suggestion use valgrind. never thought of using debugging tool makes perfect sense. after using it, became obvious correct else causing problem , found cause elsewhere in code. on writing buffer. again andrew assistance.

-andres


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -