[Kde-bindings] [Qyoto] crash when using QList returned by QMimeData.Urls

Dimitar Dobrev dpldobrev at yahoo.com
Tue Feb 19 19:41:20 UTC 2013


    

    Hi,

    I can reproduce the error, too. Thanks for the report. About advice on fixing it, you need to look at marshall_ItemList in marshal_macros.h. This is the method used to marshal lists. Also, on 8.5.2012I made a great change in handlers.cpp (you can check the git log). The problem I was having was that calling QPrinterInfo.PrinterName on any printer contained in the list returned by QPrinterInfo.AvailablePrinters caused a crash. I resolved that by removing any marshalling of list elements by value and always using pointers instead - with the reasoning that in C# class instances are always pointers. It worked great and I haven't had any problems since. However, there is a chance that same change broke the marshalling of other lists (such as lists of QUrl). What you could try is remove those changes and see if the list is OK with the old code.
    I am working on other issues right now and will give a hand as soon as I'm done. Good luck.
    

    Best regards,
    Dimitar



________________________________
 From: David Lechner <david at lechnology.com>
To: kde-bindings at kde.org 
Sent: Tuesday, February 19, 2013 8:21 AM
Subject: [Kde-bindings] [Qyoto] crash when using QList returned by QMimeData.Urls
 

I am getting a crash when trying to access the QUrl objects returned by QMimeData.Urls.

Here is the stack trace of the crash

> Program received signal SIGSEGV, Segmentation fault.
> QMutex::lockInline (this=0x82) at ../../include/QtCore/../../src/corelib/thread/qmutex.h:187

> #0  QMutex::lockInline (this=0x82) at ../../include/QtCore/../../src/corelib/thread/qmutex.h:187
> #1  0x00007fffef6fcc38 in QMutexLocker (m=<optimized out>, this=0x7fffffffde40) at ../../include/QtCore/../../src/corelib/thread/qmutex.h:109
> #2  QUrl::isLocalFile (this=0xc2f050) at io/qurl.cpp:6332
> #3  0x00007fffefcf63f4 in __smokeqtcore::x_QUrl::x_73 (this=0xc2f050, x=0xc82c10) at /home/david/obj/smokeqt/qtcore/x_18.cpp:2318
> #4  0x00007fffefcee128 in __smokeqtcore::xcall_QUrl (xi=73, obj=0xc2f050, args=0xc82c10) at /home/david/obj/smokeqt/qtcore/x_18.cpp:2594
> #5  0x00007ffff47162db in Qyoto::MethodCall::callMethod (this=0x7fffffffe060) at /home/david/dev/assemblygen/assemblies/qyoto-qtcore/native/methodcall.cpp:93
> #6  0x00007ffff47165a6 in Qyoto::MethodCall::next (this=0x7fffffffe060) at /home/david/dev/assemblygen/assemblies/qyoto-qtcore/native/methodcall.cpp:123
> #7  0x00007ffff471f739 in CallSmokeMethod (smoke=0xa46120, methodId=5374, obj=0x2b, sp=0x7ffff7fd6160, items=0, typeIDs=0x7ffff7fd6138) at /home/david/dev/assemblygen/assemblies/qyoto-qtcore/native/qyoto.cpp:318
> #8  0x0000000040046429 in ?? ()


From using gdb, I have determined that the QUrl reference is getting messed up somewhere in the QList. In the stack trace below, a QUrl was created at the address of 0xc2f050, but when it is returned through the QList<QUrl> we are getting the address 0x7fffffffdce0. But if you look, QUrl->d is 0xc2f050, which should the the QUrl itself. So, I am guessing that something is getting a bit off in the casting somewhere.

> #0  0x00007fffef6f6ece in ref (this=0xc2f050) at ../../include/QtCore/../../src/corelib/arch/qatomic_x86_64.h:121
> #1  QUrl::QUrl (this=0x7fffffffdce0, other=...) at io/qurl.cpp:4263
> #2  0x00007fffef75445c in QMimeData::setUrls (this=<optimized out>, urls=...) at kernel/qmimedata.cpp:336
> #3  0x00007fffefcba25e in __smokeqtcore::x_QMimeData::x_10 (this=0xc28980, x=0xc45740) at /home/david/obj/smokeqt/qtcore/x_11.cpp:725
> #4  0x00007fffefcb7420 in __smokeqtcore::xcall_QMimeData (xi=10, obj=0xc28980, args=0xc45740) at /home/david/obj/smokeqt/qtcore/x_11.cpp:962
> #5  0x00007ffff47162db in Qyoto::MethodCall::callMethod (this=0x7fffffffe040) at /home/david/dev/assemblygen/assemblies/qyoto-qtcore/native/methodcall.cpp:93
> #6  0x00007ffff47165a6 in Qyoto::MethodCall::next (this=0x7fffffffe040) at /home/david/dev/assemblygen/assemblies/qyoto-qtcore/native/methodcall.cpp:123
> #7  0x00007ffff47086d5 in marshall_ItemList<QUrl, QList<QUrl*>, ((const char*)((char*)(& {anonymous}::QUrlListSTR)))>(Marshall *) (m=0x7fffffffe040) at /home/david/dev/assemblygen/assemblies/qyoto-qtcore/native/marshall_macros.h:52
> #8  0x00007ffff4716558 in Qyoto::MethodCall::next (this=0x7fffffffe040) at /home/david/dev/assemblygen/assemblies/qyoto-qtcore/native/methodcall.cpp:120
> #9  0x00007ffff471f739 in CallSmokeMethod (smoke=0xa46120, methodId=3722, obj=0x33, sp=0x7ffff7f6d770, items=1, typeIDs=0x7ffff7fd6390) at /home/david/dev/assemblygen/assemblies/qyoto-qtcore/native/qyoto.cpp:318
> #10 0x0000000040046429 in ?? ()

I am stuck on where to go from here to fix this. Any advice?

I have attached the program I am using to reproduce the bug.

_______________________________________________
Kde-bindings mailing list
Kde-bindings at kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20130219/b4c90a94/attachment.html>


More information about the Kde-bindings mailing list