rawtoaces main at 868a571, Ubuntu 24.04 inside Docker with the default seccomp profile, gcc 13.3, exiftool 12.76 in PATH.
Test_Exiftool and Test_ImageConverter (test_fetch_missing_metadata) fail although exiftool is installed and works from the shell:
FAILED: success == should_succeed
values were 'Failed to execute exiftool. Please make sure that its location is available in PATH. Alternatively you can provide the path to the exiftool binary via the RAWTOACES_EXIFTOOL_PATH environment variable.' and ''
execute() in src/rawtoaces_util/exiftool.cpp decides the call failed when errno is set after popen():
errno = 0;
FILE *file = popen( command.c_str(), "r" );
bool success = ( errno == 0 );
popen() only sets errno when it returns NULL; a successful call is free to leave it non-zero. Under Docker's default seccomp profile glibc's posix_spawn tries clone3 first, gets ENOSYS, falls back to clone and runs the command fine, but errno stays at 38:
errno = 0;
FILE *f = popen( "exiftool -ver", "r" );
/* output=12.76, errno after popen = 38 (Function not implemented) */
With --security-opt seccomp=unconfined errno is 0 and all 17 tests pass. GitHub's runners don't run under that profile, which is why CI never sees it. The comment above the check already says errno is unreliable, and the empty-output workaround was added because of it, but the errno check is still there and wins.
Two smaller things in the same function: if popen() does return NULL, pclose( NULL ) is called; and the exit status from pclose() is discarded, so a command that prints something and then fails (exiftool exiting with 1, or 127 from the shell) counts as success as long as stdout is not empty.
PR coming up that checks the NULL return and the pclose() status instead of errno.
rawtoaces main at 868a571, Ubuntu 24.04 inside Docker with the default seccomp profile, gcc 13.3, exiftool 12.76 in PATH.
Test_Exiftool and Test_ImageConverter (test_fetch_missing_metadata) fail although exiftool is installed and works from the shell:
execute()in src/rawtoaces_util/exiftool.cpp decides the call failed when errno is set after popen():popen() only sets errno when it returns NULL; a successful call is free to leave it non-zero. Under Docker's default seccomp profile glibc's posix_spawn tries clone3 first, gets ENOSYS, falls back to clone and runs the command fine, but errno stays at 38:
With
--security-opt seccomp=unconfinederrno is 0 and all 17 tests pass. GitHub's runners don't run under that profile, which is why CI never sees it. The comment above the check already says errno is unreliable, and the empty-output workaround was added because of it, but the errno check is still there and wins.Two smaller things in the same function: if popen() does return NULL,
pclose( NULL )is called; and the exit status from pclose() is discarded, so a command that prints something and then fails (exiftool exiting with 1, or 127 from the shell) counts as success as long as stdout is not empty.PR coming up that checks the NULL return and the pclose() status instead of errno.