Popax21 / synaTudor

GNU Lesser General Public License v2.1
92 stars 10 forks source link

Compile error: 'SYS_futex_waitv' undeclared #5

Closed p-try closed 2 years ago

p-try commented 2 years ago

First of all, thank you very much for your effort to make this fingerprint reader work. I may have a rather simple problem: ninja throws the following error:

[61/83] Compiling C object tudor-host/tudor_host.p/src_sandbox.c.o
FAILED: tudor-host/tudor_host.p/src_sandbox.c.o 
cc -Itudor-host/tudor_host.p -Itudor-host -I../tudor-host -I../tudor-host/src -I../tudor-host/inc -I../libtudor/inc -I/usr/include/libusb-1.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -g -pthread -D_GNU_SOURCE -DUNMOUNTFS -MD -MQ tudor-host/tudor_host.p/src_sandbox.c.o -MF tudor-host/tudor_host.p/src_sandbox.c.o.d -o tudor-host/tudor_host.p/src_sandbox.c.o -c ../tudor-host/src/sandbox.c
In file included from ../tudor-host/src/sandbox.c:20:
../tudor-host/src/sandbox.c: In function ‘setup_seccomp’:
../tudor-host/src/sandbox.c:153:58: error: ‘SYS_futex_waitv’ undeclared (first use in this function)
  153 |     cant_fail(seccomp_rule_add(scmp_ctx, SCMP_ACT_ALLOW, SYS_futex_waitv, 0));
      |                                                          ^~~~~~~~~~~~~~~

I am running Ubuntu 22.04 with Kernel 5.15. Googling "SYS_futex_waitv", I have found out this syscall seems to have been introduced with kernel 5.16, so I installed that (and also 5.18) from the mainline repository, to no avail. Is there something I might be missing?

Popax21 commented 2 years ago

Thanks for reporting! I'll probably just rewrite that section of code to simply ignore missing syscalls from newer kernel versions tomorrow.

Popax21 commented 2 years ago

Just pushed a potential fix, can you try again?

IchMogle commented 2 years ago

I'm having the exact same issue. This is the error message I get now after the fix:

[59/83] Compiling C object tudor-host/tudor_host.p/src_sandbox.c.o
FAILED: tudor-host/tudor_host.p/src_sandbox.c.o 
cc -Itudor-host/tudor_host.p -Itudor-host -I../tudor-host -I../tudor-host/src -I../tudor-host/inc -I../libtudor/inc -I/usr/include/libusb-1.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g -pthread -D_GNU_SOURCE -DUNMOUNTFS -MD -MQ tudor-host/tudor_host.p/src_sandbox.c.o -MF tudor-host/tudor_host.p/src_sandbox.c.o.d -o tudor-host/tudor_host.p/src_sandbox.c.o -c ../tudor-host/src/sandbox.c
In file included from ../tudor-host/src/sandbox.c:20:
../tudor-host/src/sandbox.c: In function ‘setup_seccomp’:
../tudor-host/src/sandbox.c:153:58: error: ‘__SNR_futex_waitv’ undeclared (first use in this function)
  153 |     cant_fail(seccomp_rule_add(scmp_ctx, SCMP_ACT_ALLOW, SCMP_SYS(futex_waitv), 0));
      |                                                          ^~~~~~~~
Popax21 commented 2 years ago

I simply removed that line of code (it wasn't needed anyway .-.), can you try again?

IchMogle commented 2 years ago

ninja now goes through without errors. But when I try sudo ninja install I get another error message:

[0/1] Installing files.

ERROR: Build directory has been generated with Meson version 0.62.2, which is incompatible with the current version 0.61.2.
FAILED: meson-install 

I am not sure what this error message means, but maybe it has something to do with the warnings I get when running meson build:

tudor-host-launcher/meson.build:29: WARNING: Project targeting '>= 0.57.0' but tried to use feature deprecated since '0.56.0': dependency.get_pkgconfig_variable. use dependency.get_variable(pkgconfig : ...) instead
WARNING: Deprecated features used:
 * 0.56.0: {'dependency.get_pkgconfig_variable'}

I am using have meson version 0.62.2 and ninja version 1.10.1.

Popax21 commented 2 years ago

ninja now goes through without errors. But when I try sudo ninja install I get another error message:

[0/1] Installing files.

ERROR: Build directory has been generated with Meson version 0.62.2, which is incompatible with the current version 0.61.2.
FAILED: meson-install 

I am not sure what this error message means, but maybe it has something to do with the warnings I get when running meson build:

tudor-host-launcher/meson.build:29: WARNING: Project targeting '>= 0.57.0' but tried to use feature deprecated since '0.56.0': dependency.get_pkgconfig_variable. use dependency.get_variable(pkgconfig : ...) instead
WARNING: Deprecated features used:
 * 0.56.0: {'dependency.get_pkgconfig_variable'}

I am using have meson version 0.62.2 and ninja version 1.10.1.

Can you try doing a clean build from a freshly cloned repo?

IchMogle commented 2 years ago

Still the same error and warnings.

p-try commented 2 years ago

For me, it compiles fine now. I have meson 0.61.2 and ninja 1.10.1.

Popax21 commented 2 years ago

Still the same error and warnings.

Just pushed a fix for the deprecated feature, you might also want to create a completely new build directory.

IchMogle commented 2 years ago

The sudo ninja install worked for me now, too. But when trying to add a fingerprint using fprintd-enroll, instead of getting of getting an error message, nothing happens.

IchMogle commented 2 years ago

The sudo ninja install worked for me now, too. But when trying to add a fingerprint using fprintd-enroll, instead of getting of getting an error message, nothing happens.

Adding cant_fail(seccomp_rule_add(scmp_ctx, SCMP_ACT_ALLOW, SCMP_SYS(clone3), 0)); in sandbox.c also worked. Thank you, finally being able to use my fingerprint sensor is amazing :)

Popax21 commented 2 years ago

The sudo ninja install worked for me now, too. But when trying to add a fingerprint using fprintd-enroll, instead of getting of getting an error message, nothing happens.

Adding cant_fail(seccomp_rule_add(scmp_ctx, SCMP_ACT_ALLOW, SCMP_SYS(clone3), 0)); in sandbox.c also worked. Thank you, finally being able to use my fingerprint sensor is amazing :)

Pushed a proper fix for that now.

IchMogle commented 2 years ago

The fix doesn't work for me. I still get a timeout:

Failed to get Fprintd manager: Error calling StartServiceByName for net.reactivated.Fprint: Failed to activate service 'net.reactivated.Fprint': timed out (service_start_timeout=25000ms)
Popax21 commented 2 years ago

The fix doesn't work for me. I still get a timeout:

Failed to get Fprintd manager: Error calling StartServiceByName for net.reactivated.Fprint: Failed to activate service 'net.reactivated.Fprint': timed out (service_start_timeout=25000ms)

That looks like a different issue. Can you open a new one, and attach the fprintd and tudor-host-launcher logs?

IchMogle commented 2 years ago

Sorry, I'm fairly new to Linux. Where / how would I get these logs? I have searched in /var/log, but couldn't find anything.

idoybh commented 2 years ago

Sorry, I'm fairly new to Linux. Where / how would I get these logs? I have searched in /var/log, but couldn't find anything.

journalctl -u fprintf > fprintd.log journalctl -u tudor_host_launcher > tudor.log

Popax21 commented 2 years ago

Assuming the error's fixed now, I would close the issue now, if that's OK.