JoseExposito / touchegg

Linux multi-touch gesture recognizer
GNU General Public License v3.0
3.68k stars 172 forks source link

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

Open yurivict opened 1 year ago

yurivict commented 1 year ago

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

JoseExposito commented 1 year ago

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 commented 1 year ago
  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 commented 1 year ago

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: https://github.com/JoseExposito/touchegg/pull/612

yurivict commented 1 year ago

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 commented 1 year ago

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.