[Qt-interest] QtScript segfault on C++ signal (dis)connection/firing

Kent Hansen khansen at trolltech.com
Wed Jan 7 11:03:07 CET 2009


Hi Sean,
Any chance you can share the application and/or reduce it to a test case
that reproduces the problem? That would be extremely helpful. Feel free
to reply to me in private.

Regards,
Kent


Sean M. Pappalardo wrote:
> Hello there.
>
> I'm developing a fairly large QtScript file (35K at the moment) which
> necessarily involves many C++ object signals being connected and
> disconnected at various points depending on user action.
>
> The problem is the application will randomly cause a segmentation fault
> when a signal fires (it could be any of them.) It seems to have gotten
> worse the more signals I add to the script.
>
> The signals are (dis)connected via a Q_INVOKABLE C++ function that calls
> qScriptConnect and qScriptDisconnect. This way, scripts need only one
> line of code to connect/disconnect a signal.
>
> This may be related to another strange problem I found where I have to
> connect all signals once at the beginning of the script or they won't
> have any effect if connected for the first time later on. (I've found
> one exception to this too.)
>
> (I also originally tried to do this as shown in the QtScript docs by
> exposing the object whose signals I wanted to connect, but the script
> slot functions weren't being called once connected.)
>
> If it's helpful, here's a link to a backtrace: http://pastebin.com/m5189a6f1
>
> I also ran valgrind to check for leaks and it reported:
>
> ==21380== Process terminating with default action of signal 11 (SIGSEGV)
> ==21380==  Access not within mapped region at address 0x4
> ==21380==    at 0x529203A: (within /usr/lib/libQtScript.so.4.4.3)
> ==21380==    by 0x5292E1A: (within /usr/lib/libQtScript.so.4.4.3)
> ==21380==    by 0x432DD6A: QMetaCallEvent::placeMetaCall(QObject*) (in
> /usr/lib/libQtCore.so.4.4.3)
> ==21380==    by 0x432F8E0: QObject::event(QEvent*) (in
> /usr/lib/libQtCore.so.4.4.3)
> ==21380==    by 0x454079B: QApplicationPrivate::notify_helper(QObject*,
> QEvent*) (in /usr/lib/libQtGui.so.4.4.3)
> ==21380==    by 0x454861D: QApplication::notify(QObject*, QEvent*) (in
> /usr/lib/libQtGui.so.4.4.3)
> ==21380==    by 0x43200D0: QCoreApplication::notifyInternal(QObject*,
> QEvent*) (in /usr/lib/libQtCore.so.4.4.3)
> ==21380==    by 0x4320D54:
> QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
> (in /usr/lib/libQtCore.so.4.4.3)
> ==21380==    by 0x4320F4C: QCoreApplication::sendPostedEvents(QObject*,
> int) (in /usr/lib/libQtCore.so.4.4.3)
> ==21380==    by 0x434A98E: (within /usr/lib/libQtCore.so.4.4.3)
> ==21380==    by 0x57001B7: g_main_context_dispatch (in
> /usr/lib/libglib-2.0.so.0.1600.6)
> ==21380==    by 0x5703852: (within /usr/lib/libglib-2.0.so.0.1600.6)
>
> Thank you very much for your time and attention. I would appreciate any
> help or direction you can give.
>
> Sincerely,
> Sean M. Pappalardo
>
> <<--------------------------------------------------------------------------------->>
> This E-Mail message has been scanned for viruses
> and cleared by >>SmartMail<< from Smarter Technology, Inc.
> <<--------------------------------------------------------------------------------->>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   




More information about the Qt-interest-old mailing list