#1029603 emacsen-common fails to install due to attempted chmod of /proc/self/fd/4

Package:
emacsen-common
Source:
emacsen-common
Submitter:
Ralph Ronnquist
Date:
2023-01-25 21:42:03 UTC
Severity:
normal
Tags:
#1029603#5
Date:
2023-01-25 10:28:09 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?
this problem came up when I tried installing emacs-nox, with
# apt-get install --no-install-recommends emacs-nox

* What was the outcome of this action?
Install emacsen-common for emacs
emacsen-common: Handling install of emacsen flavor emacs
ERROR: install script from emacsen-common package failed
dpkg: error processing package emacs-nox (--configure):
 installed emacs-nox package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.36-8) ...
Processing triggers for man-db (2.11.2-1) ...
Processing triggers for install-info (6.8-6+b1) ...
Errors were encountered while processing:
 emacs-nox
E: Sub-process /usr/bin/dpkg returned an error code (1)

   * What outcome did you expect instead?
Install emacsen-common for emacs
emacsen-common: Handling install of emacsen flavor emacs
Processing triggers for install-info (6.8-6+b1) ...
Processing triggers for man-db (2.11.2-1) ...

Note, when I ran it under "strace -f", it shows that the ultimate
failure cause is an attempt to "chmod /proc/self/fd/4".

#1029603#14
Date:
2023-01-25 10:56:32 UTC
From:
To:
Ralph Ronnquist <ralph.ronnquist@gmail.com> writes:

I could not duplicate this in a clean sid chroot with e.g.

$ sudo schroot -c sid --directory / -- apt-get install --no-install-recommends emacs-nox

Are you in the middle of an upgrade? The reported kernel version is long
gone from bookworm and sid.

d

#1029603#19
Date:
2023-01-25 11:32:57 UTC
From:
To:
This is a debootstrap filesystem; I just repeated it with a new
debootstrapped sid filesystem.

Since you think this might be a kernel related issue I'll check it out
with a qemu as well.

Ralph.

#1029603#24
Date:
2023-01-25 13:24:33 UTC
From:
To:
I have now tried this on qemu using kernel 6.1.0-1-amd64.
Same result.

Test sequence is:
# debootstrap --variant=minbase sid FS http://deb.debian.org/debian
# chroot FS apt-get install emacs-nox

Results in:
emacsen-common: Handling install of emacsen flavor emacs
etc.

Ralph.

#1029603#29
Date:
2023-01-25 17:46:15 UTC
From:
To:
This has nothing to do with the kernel, you need to mount the /proc
filesystem in the chroot.  I have not checked the details, but commit
9d626dffc6ba[1] seems to be the cause.

Yes, mounting /proc was not necessary in Emacs 27 and earlier, but
various programs will not work correctly if you do not mount it.

Cheers,
       Sven


1. https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=9d626dffc6ba62c0d7a1a5c712f576ed8684fd66

#1029603#34
Date:
2023-01-25 21:38:19 UTC
From:
To:
Thanks. As it turns out, I only need to have the pathname
/proc/self/fd/5 exist to be chmod-able, and then emacs-nox installs
without isse. Thus, the commands:
  # mkdir -p /proc/self/fd
  # touch /proc/self/fd/5
are enough to set the scene for the successful installation of
emacs-nox.

It does seem a little bit odd that that installation calls "chmod 644"
on "/proc/self/fd/5", though maybe that is less odd than me making
this pathname a normal file rather than a "proc" mount :)

regards,

Ralph.