Ask / Submit
1

How to debug dbus errors for app development?

asked 2019-05-12 19:19:16 +0200

jsommer gravatar image

I use the approach of the harbour-batteryoverlay and harbour-screentapshot for an overly feature.

If I close the app or deactivate the overlay, I can see a dbus error in the log and the app crashes:

process 26992: arguments to dbus_message_new_method_call() were incorrect, assertion "_dbus_check_is_valid_path (path)" failed in file dbus-message.c line 1367.
This is normally a bug in some application using the D-Bus library.
D-Bus not built with -rdynamic so unable to print a backtrace

The view helper class executes the following code:

if (overlayView) {
    QDBusConnection::sessionBus().unregisterObject("MyApp/overlay");
    QDBusConnection::sessionBus().unregisterService("MyApp.overlay");
    overlayView->close();
    delete overlayView;
    overlayView = NULL;
}
else {
    QDBusInterface iface("MyApp.overlay", "MyApp/overlay", "MyApp");
    iface.call(QDBus::NoBlock, "exit");
}

Some ideas?

edit retag flag offensive close delete

Comments

try gdb to see what is exact problem of crash

coderus ( 2019-05-12 20:28:48 +0200 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2019-05-13 14:18:27 +0200

spiiroin gravatar image

You have _dbus_check_is_valid_path() reporting failure and "MyApp/overlay" is not a valid D-Bus object path...

ref: https://dbus.freedesktop.org/doc/dbus-specification.html

"Valid Object Paths ... The path must begin with an ASCII '/' (integer 47) character, and must consist of elements separated by slash characters."

Try "/MyApp/overlay".

edit flag offensive delete publish link more

Comments

Thanks for your answer. This was unortunately not sufficifient. It seems that I need another prefix like harbour.myapp.overlay and /harbour/myapp/overlay.

jsommer ( 2019-05-30 22:28:52 +0200 )edit

@jsommer What kind of errors you still have? Just being curious as there is difference between strict requirements imposed by dbus itself (those should have already been met by using valid path and two part names and interfaces), conventions that should be followed (a bit like what you describe above where service name dictates interface and object path), and perhaps something outside dbus itself enforcing such or similar conventions.

spiiroin ( 2019-05-31 08:35:11 +0200 )edit
0

answered 2019-06-02 12:18:04 +0200

jsommer gravatar image

Now I have no error messages any more. I'm not sure why. I've added the additional path and name component. If I close the overlay and restart the phone, the overlay is available again. So there is somerwhere still an error in my code.

edit flag offensive delete publish link more

Comments

can you push your code to github or similar? then we han help you bettrer :)

coderus ( 2019-06-02 13:57:32 +0200 )edit

We’ll definitely do that. I give you a note. Thank you so much for your support.

jsommer ( 2019-06-07 11:30:53 +0200 )edit
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2019-05-12 19:19:16 +0200

Seen: 124 times

Last updated: Jun 02