From: Andreas V. <li...@br...> - 2009-09-13 18:35:21
|
Am Thu, 10 Sep 2009 12:46:38 +0500 schrieb Zoltan Bencik: Hello Zoltan, If you progress with wx main loop integration please come back. I'm interested to get this into the dbus-c++ source. regards Andreas > Hello Andreas, > > Yes, dbus-c++ main loop was causing this problem. > I solved this issue by firing all dbus-c++ calls in separate thread > and now everything works as it should. > This is temporary solution, which I'll be later rewriting to wx event > loops. > > Thanks for your help. > > > On Wed, Sep 9, 2009 at 11:32 PM, Andreas Volz <li...@br...> > wrote: > > Am Wed, 9 Sep 2009 11:14:57 +0500 schrieb Zoltan Bencik: > > > > Hello Zoltan, > > > > I think that I know the problem. You use the DBus::BusDispatcher > > dispatcher Dbus-C++ own main loop. This is not very good tested and > > many people have reported problems. > > > > I use the glib and ecore (Gitorious branch) main loop integration > > with success. You need a main loop integration that fits to > > wxWidgets. I'm sure nobody has tested this yet. Maybe it will work > > because the wxGTK toolkit works together with the glib main loop > > integration. > > > > But pay attention that then it works only with wxGtk, but not other > > wxWidget backends. > > > > Look in the glib example hot to use it. > > > > regards > > Andreas > > > >> Hello Andreas, > >> > >> Thanks for your kind response. > >> > >> It seems like the GUI library(wxWidgets on Linux, wxGTK build) I'm > >> using is causing some problems(not sure). > >> Could you please tell me if my dbus-c++ usage is correct from the > >> code listed below? > >> Maybe I missed to register some callbacks, which I have to handle, > >> or passing method parameters incorrectly, > >> or anything else. > >> GUI library throws me an assert, which has to deal with even > >> notifiers. I tried to use dbus-c++ in console application, and > >> UnMount worked just fine. > >> > >> Here is the stack trace from Eclipse IDE, when I try to call > >> invoke_method. I don't think it will be any helpful, since it's > >> trace when GUI is about to die. > >> > >> Thread [1] (Suspended) > >> 22 pthread_mutex_unlock() 0x00ab51a0 > >> 21 _dl_open() 0x008f69eb > >> 20 do_dlopen() 0x00a22952 > >> 19 _dl_catch_error() 0x008f2806 > >> 18 __libc_dlopen_mode() 0x00a22b15 > >> 17 init() 0x009fb858 > >> 16 pthread_once() 0x00ab73f0 > >> 15 backtrace() 0x009fba45 > >> 14 wxStackWalker::SaveStack() > >> /home/zoltan/Development/wx/src/unix/stackwalk.cpp:169 0x083edb79 > >> 13 wxGUIAppTraits::ShowAssertDialog() > >> /home/zoltan/Development/wx/src/gtk/utilsgtk.cpp:379 0x08216dd8 > >> 12 ShowAssertDialog() > >> /home/zoltan/Development/wx/src/common/appbase.cpp:836 0x08363cd0 > >> 11 wxAppConsole::OnAssertFailure() > >> /home/zoltan/Development/wx/src/common/appbase.cpp:445 0x08364042 > >> 10 wxApp::OnAssertFailure() > >> /home/zoltan/Development/wx/src/gtk/app.cpp:556 0x0820556f > >> 9 > >> wxOnAssert() /home/zoltan/Development/wx/src/common/appbase.cpp:711 > >> 0x08363df7 8 wxEventLoop::~wxEventLoop() > >> /home/zoltan/Development/wx/src/gtk/evtloop.cpp:64 0x0830fedf > >> 7 wxEventLoopPtr::~wxEventLoopPtr() > >> /home/zoltan/Development/wx/src/common/appcmn.cpp:74 0x0826f6d5 > >> 6 wxEventLoopTiedPtr::~wxEventLoopTiedPtr() > >> /home/zoltan/Development/wx/src/common/appcmn.cpp:74 0x082705f1 > >> 5 wxAppBase::MainLoop() > >> /home/zoltan/Development/wx/src/common/appcmn.cpp:312 0x0826fe7a > >> 4 wxAppBase::OnRun() > >> /home/zoltan/Development/wx/src/common/appcmn.cpp:367 0x0826f8b3 > >> 3 > >> wxEntry() /home/zoltan/Development/wx/src/common/init.cpp:460 > >> 0x08395273 2 > >> wxEntry() /home/zoltan/Development/wx/src/common/init.cpp:472 > >> 0x08395479 1 > >> main() /home/zoltan/Development/DBusCPPTest/src/main_app.cpp:42 > >> 0x0808438b > >> > >> > >> Thanks. > >> br, > >> -zoltan. > >> > >> On Wed, Sep 9, 2009 at 1:35 AM, Andreas Volz<li...@br...> > >> wrote: > >> > Am Tue, 8 Sep 2009 18:34:11 +0500 schrieb Zoltan Bencik: > >> > > >> > Hello Zoltan, > >> > > >> > I suggest you should compile dbus-c++ with debug option > >> > (--configure --enable-debug), your application with -O0 -ggdb > >> > and run it in gdb. > >> > > >> > This would tell us all a lot of useful information. > >> > > >> > regards > >> > Andreas > >> > > >> >> Hello All, > >> >> > >> >> I'm trying to mount and unmount devices through dbus-c++ > >> >> binding, using DeviceKit.Disks.Device interface methods. > >> >> While trying to unmount device, I get a 'SIGTRAP' signal. > >> >> Can anybody show me what I'm doing wrong in this code? > >> >> > >> >> Thanks, any help is very appreciated. > >> >> > >> >> > >> >> // Proxy implementation > >> >> DisksDeviceProxy::DisksDeviceProxy(DBus::Connection &connection, > >> >> const char *object_path) > >> >> : DBus::InterfaceProxy("org.freedesktop.DeviceKit.Disks"), > >> >> DBus::ObjectProxy(connection, object_path, > >> >> "org.freedesktop.DeviceKit.Disks.Device") > >> >> { > >> >> } > >> >> > >> >> // Mount device > >> >> void DisksDeviceProxy::MountDevice(const char *fstype, > >> >> std::vector<std::string> &options) > >> >> { > >> >> ::DBus::CallMessage call; > >> >> ::DBus::MessageIter wi = call.writer(); > >> >> > >> >> wi << fstype; > >> >> wi << options; > >> >> call.member("FilesystemMount"); > >> >> ::DBus::Message ret = invoke_method (call); > >> >> ::DBus::MessageIter ri = ret.reader(); > >> >> } > >> >> > >> >> // Unmount device > >> >> void DisksDeviceProxy::UnMountDevice(std::vector<std::string> > >> >> &options) { > >> >> ::DBus::CallMessage call; > >> >> ::DBus::MessageIter wi = call.writer(); > >> >> > >> >> wi << options; > >> >> call.member("FilesystemUnmount"); > >> >> ::DBus::Message ret = invoke_method (call); // Signaled > >> >> SIGTRAP right here ::DBus::MessageIter ri = ret.reader(); > >> >> } > >> >> > >> >> And here is the code, how I'm trying to unmount device: > >> >> //-- START > >> >> DBus::BusDispatcher dispatcher; > >> >> DBus::default_dispatcher = &dispatcher; > >> >> > >> >> DBus::Connection conn = DBus::Connection::SystemBus(); > >> >> > >> >> DisksDeviceProxy devkit(conn, > >> >> "/org/freedesktop/DeviceKit/Disks/devices/sdb1"); // for now, > >> >> just hard coded value of my USB device > >> >> std::vector<std::string>options; > >> >> devkit.UnMountDevice(options); > >> >> //-- END > >> >> > >> >> ------------------------------------------------------------------------------ > >> >> Let Crystal Reports handle the reporting - Free Crystal Reports > >> >> 2008 30-Day trial. Simplify your report design, integration and > >> >> deployment > >> >> - and focus on what you do best, core application coding. > >> >> Discover what's new with Crystal Reports now. > >> >> http://p.sf.net/sfu/bobj-july > >> >> _______________________________________________ > >> >> dbus-cplusplus-devel mailing list > >> >> dbu...@li... > >> >> https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel > >> >> > >> > > >> > ------------------------------------------------------------------------------ > >> > Let Crystal Reports handle the reporting - Free Crystal Reports > >> > 2008 30-Day trial. Simplify your report design, integration and > >> > deployment - and focus on what you do best, core application > >> > coding. Discover what's new with Crystal Reports now. > >> > http://p.sf.net/sfu/bobj-july > >> > _______________________________________________ > >> > dbus-cplusplus-devel mailing list > >> > dbu...@li... > >> > https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel > >> > > >> > > > > ------------------------------------------------------------------------------ > > Let Crystal Reports handle the reporting - Free Crystal Reports > > 2008 30-Day trial. Simplify your report design, integration and > > deployment - and focus on what you do best, core application > > coding. Discover what's new with Crystal Reports now. > > http://p.sf.net/sfu/bobj-july > > _______________________________________________ > > dbus-cplusplus-devel mailing list > > dbu...@li... > > https://lists.sourceforge.net/lists/listinfo/dbus-cplusplus-devel > > > > > > -- > Best regards, > -zoltan. > |