Ubuntu 24.04 libc 6 bug?

Hi,

Using Ubuntu 24.04 with libc 6.
Trying to use blocking fwrite on a file, that is fully accessible by other programs, and after the first write any subsequent attempt fails with (11). Resource temporarily unavailable. Stream is always open. Relevant code:

fd = open("new.dmp", O_CREAT | O_TRUNC | O_WRONLY);
res = fcntl(fd, F_GETFL);
printf("res= %d, nonblock: %d\n", res, res&O_NONBLOCK);

Output:

res= 32769, nonblock: 0
if ((cnt = fwrite(awrite, 8, left, dumpfp)) != left)
{
      int res = fcntl(fd, F_GETFL);
      error(log, "Short save of samples to \"new.dmp\". Asked for %d, got %d (%d). %s."
       "(%d, %d)\n", 0, FL, LN, FN, left, cnt, errno, strerror(errno), res, res&O_NONBLOCK);
        return(FAIL);
}

Output:

Short save of data to "new.dmp".Asked for 1024, got 0 (11). Resource temporarily unavailable.(32769, 0)
-> ls -la *.dmp
-rw-rw-r-- 1 user user 8235 May  5 23:17 new.dmp

Any ideas?
TIA
Nikos

Name of program was scanner. Alias was scan. I have no other scan or scanner in my system.
Yet changing program name to anything else fixed the issue. Seems name “scanner” has some special significance for libc 6:(

Did you check in /etc/apparmor.d whether there are some rules restricting programs named “scanner”?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.