Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

touchegg fails to catch and report the exception and aborts #611

Open
yurivict opened this issue Jan 15, 2023 · 5 comments · Fixed by #612
Open

touchegg fails to catch and report the exception and aborts #611

yurivict opened this issue Jan 15, 2023 · 5 comments · Fixed by #612

Comments

@yurivict
Copy link

touchegg aborts on exception:

$ touchegg --daemon
Touchégg v2.0.15.
Starting Touchégg in daemon mode
Starting daemon server...
Generating D-Bus introspection data
Creating D-Bus server
Abort trap

Exception is thrown from here and never caught:

 54│   if (server == nullptr) {
 55│     std::string errorMessage{"Error creating D-Bus server: "};
 56│     errorMessage += error->message;
 57├───> throw std::runtime_error{errorMessage};
 58│   }

(gdb) p error->message
$1 = (gchar *) 0x80282b300 "Abstract namespace not supported"

Your environment

  • Version of Touchégg: Run touchegg --version in the terminal to check the version
  • Operating System: FreeBSD 13.1
  • Desktop Environment: Xfce4
  • Are you using Wayland? No
@JoseExposito
Copy link
Owner

Hi!

Touchégg is executed in 2 different processes that communicate using D-Bus over Unix socket.

I have never try to run it on *BSD, but it looks like D-Bus abstract namespace is not supported... You probably have more luck trying a pre-compiled package.

I have no idea about how package management works on FreeBSD, but it looks like this port is quite updated:
https://www.freshports.org/sysutils/touchegg/

I'm not sure if you can ask questions on freshports to other BSD users, they will probably know how to fix this error.

@yurivict
Copy link
Author

  1. You need for fix exception handling. You can try to throw the exception from the line 57 regardless of the DBus error and you will see that it isn't properly caught and reported.
  2. On FreeBSD abstract UNIX pipes aren't supported. You can apply the patched like in the port here to make it compatible with FreeBSD.

JoseExposito added a commit that referenced this issue Jan 16, 2023
FreeBSD does not support abstract Unix sockets, causing the app to
crash with error "Error creating D-Bus server: Abstract namespace not
supported".

As pointed out by @yurivict, the FreeBSD port of Touchégg patches
"src/daemon/dbus.h" to fix this issue:
https://cgit.freebsd.org/ports/tree/sysutils/touchegg/files/patch-src_daemon_dbus.h

Apply a similar patch upstream to fix #611.
@JoseExposito
Copy link
Owner

You need for fix exception handling. You can try to throw the exception from the line 57 regardless of the DBus error and you will see that it isn't properly caught and reported.

That exception should not be handled, the program can not work without D-Bus connection, so printing the error and aborting is a valid option.

On FreeBSD abstract UNIX pipes aren't supported. You can apply the patched like in the port here to make it compatible with FreeBSD.

That's the proper fix, thanks for the link! I just applied a similar fix, but including OpenBSD and NetBSD here: #612

@yurivict
Copy link
Author

That exception should not be handled, the program can not work without D-Bus connection, so printing the error and aborting is a valid option.

Unhandled exceptions generally don't print the message. Some Linuxes do have a hook that prints the message, but this is rather a hack. On BSDs unhandled exceptions just cause program termination with the error message Abort trap.

JoseExposito added a commit that referenced this issue Jan 17, 2023
FreeBSD does not support abstract Unix sockets, causing the app to
crash with error "Error creating D-Bus server: Abstract namespace not
supported".

As pointed out by @yurivict, the FreeBSD port of Touchégg patches
"src/daemon/dbus.h" to fix this issue:
https://cgit.freebsd.org/ports/tree/sysutils/touchegg/files/patch-src_daemon_dbus.h

Apply a similar patch upstream to fix #611.
@JoseExposito
Copy link
Owner

Ah, I see, on Linux those errors are displayed in the journal, i.e., journalctl -u touchegg -b. I'll try to have a look and at least lot to stderr.

@JoseExposito JoseExposito reopened this Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants