Package: fakeroot
Version: 1.23

On systems where the nofile limit is large, fakeroot hangs
For example on an Arch Linux system, where DefaultLimitNOFILE=infinity
in /etc/systemd/system.conf:

$ ulimit -Hn
1073741816
$ ulimit -Sn
1073741816
$ cat /proc/sys/fs/file-max 
18446744073709551615
$ cat /proc/sys/fs/nr_open 
1073741816

$ fakeroot /bin/bash
...
Several minutes pass
...
fakeroot shell is presented:
[root@lab1 ~]#


End users do not expect this long delay and kill the process before
then.

The long delay appears to be in this section of faked.c, where
getdtablesize returns 1073741816

========================================================
>From line 1486:

  if(!foreground){
    /* literally copied from the linux klogd code, go
to background */
    if ((pid=fork()) == 0){
      int fl;
      int
num_fds = getdtablesize();

      fflush(stdout);

      /* This is the child closing its file descriptors. */
      for (fl= 0; fl <= num_fds; ++fl)
#ifdef FAKEROOT_FAKENET
        if (fl != sd)
#endif /* FAKEROOT_FAKENET */
          close(fl);
=========================================================

Reply via email to