{"issue":{"title":"Desktop crashes when adding plugin","user":{"login":"vljubovic","id":1290105,"url":"https://api.github.com/users/vljubovic","avatar_url":"https://secure.gravatar.com/avatar/5f834c2c208d5e156983e6f47086b9d9?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"5f834c2c208d5e156983e6f47086b9d9"},"created_at":"2011-12-28T09:48:08Z","milestone":null,"labels":[],"state":"open","updated_at":"2011-12-28T09:48:08Z","id":2670090,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"closed_at":null,"html_url":"https://github.com/Razor-qt/razor-qt/issues/137","body":"Using Mandriva Linux 2010.1, Qt 4.6.2. Desktop loads normally but when trying to add any plugin it crashes (and restarts immediately). Backtrace:\r\n\r\n\r\n[New Thread 0xb6554b70 (LWP 4117)]\r\nQSS file cannot be found in any location: \"light/desktop.qss\" \r\nRazorDesktop: try to load  \"/usr/lib/razor-desktop/libdesktop-razor.so\" \r\nRazorWorkSpaceManager::RazorWorkSpaceManager \"razor\" \r\nworkspace for screen 0 \r\nRazorWorkSpace::RazorWorkSpace \r\nObject::connect: No such signal UPower::monitoring(const QString &) in /home/vedran/razorqt/razor/razorqt-0.4.0/libraries/razorqt/powermanager.cpp:77\r\nFile Name: \"/etc/xdg/menus/razor-applications.menu\" \r\n    * Plugin loaded. \r\n\"Fully featured desktop implementation with all Razor's bells and whistles\" \r\n[New Thread 0xb5a14b70 (LWP 4118)]\r\n[Thread 0xb5a14b70 (LWP 4118) exited]\r\naddPlugin \"helloworld\" \r\n    * Plugin loaded. \r\n\"Display simple text. A debugging/sample widget.\" \r\n\r\nProgram received signal SIGSEGV, Segmentation fault.\r\n0xb5d412b1 in RazorWorkSpace::addPlugin (this=0x80b0e00, pluginInfo=...)\r\n    at /home/vedran/razorqt/razor/razorqt-0.4.0/razorqt-desktop/desktop-razor/razorworkspace.cpp:407\r\nwarning: Source file is more recent than executable.\r\n407\t        plugin->setSizeAndPosition(QPointF(x, y), size);\r\n(gdb) print plugin\r\n$1 = (DesktopWidgetPlugin *) 0x0\r\n(gdb) print item\r\n$2 = (QGraphicsItem *) 0x0\r\n\r\nApparently plugin is loaded normally but dynamic_cast to QGraphicsItem fails and gives zero pointer. The only possible explanation is that Mandriva compiles Qt with -no-rtti option, as discussed here:\r\nhttp://developer.qt.nokia.com/doc/qt-4.8/qobject.html#qobject_cast\r\nhttp://developer.qt.nokia.com/forums/viewthread/2802\r\n\r\nOne solution is to have all plugins derived from QObject and then use qobject_cast, but that will screw with multiple inheritance which I see you're using. In my projects I solved this by having plugins not be the widget itself but a widget factory.\r\n\r\nDo what you want with this bug, but some distributors will likely compile Qt without rtti and Razor will crash and burn on such systems. At least add a check for zero pointer.","number":137,"url":"https://api.github.com/repos/Razor-qt/razor-qt/issues/137","comments":0,"assignee":null},"action":"opened"}