junest
junest copied to clipboard
Emacs fails with "Memory exhausted" error
I'm not able to run Emacs under junest. It starts, but then fails with !MEM FULL! (Memory exhausted) message as soon as I try to do anything.
Here's how to reproduce:
- install emacs-nox (or emacs).
# pacman -S emacs-nox
- start emacs
- open emacs manual page with
C-h r
Result: "memory exhausted" message. Note that emacs doesn't crash, but it's pretty useless in this state.
However, emacs doesn't consume any excessive memory amount as shown by ps
:
$ ps -e -o rss,size,cmd | grep emacs
17368 16748 emacs
Hi,
I reproduced the issue and I've got the same problem.
I suspect the issue is due to limitation with proot backend.
Does your JuNest work with proot as backend? Is the SECCOMP disabled?
I agree, it's likely caused by proot, because the issue doesn't reproduce with junest -u
(namespaces). I tried it with PROOT_NO_SECCOMP=1
as well, the issue still reproduces. Do you know what particular proot limitation may cause it?
Unfortunately proot
is having a lot of limitation on recent linux kernel in which is not possible to enable SECCOMP. Support for proot is really poor (the comparison with other backends https://github.com/fsquillace/junest#execution-modes-comparison-table)
Hopefully, proot
will be replaced by linux namespaces in the future which will make JuNest much more reliable.
Whenever the linux OS you are using has the user namespace configured, try to use junest -u
instead.
Hi, for proot, you can try compiling the version on this PR, which has a fix for seccomp. The binaries will arrive slighly later.
Hi @vincenthage,
Thanks a lot about the effort for fixing proot.
Hopefully during the next days I will test the PR and let you know if such solution works.
I have just run a small test by compiling the PR from @vincenthage suggestion.
Before:
[17:46:59 feel@myarch (hotfix/seccomp) src $]> JUNEST_HOME=/home/feel/.junest-test junest -f
proot info: pid 6158: terminated with signal 11
Warn: Proot is not working, disabling SECCOMP instead. Expect the application to run slowly in particular when it uses syscalls intensively.
After:
[17:11:49 feel@myarch (hotfix/seccomp) src $]> ./proot -0 -b /dev -b /proc -b /sys/ -b /tmp/ -b /home/feel/ -r ~/.junest-test/
[root@myarch src]#
It seems SECCOMP is enabled indeed, but when running emacs
command in both cases is stuck when loading the initial emacs config and I cannot use the manual by typing C-h r
.
Which kernel version do you have? We're currently investigating issues with seccomp on recent kernel versions (>= 4.8, and especially 4.11 and 4.12).
The kernel version is:
[22:50:03 feel@myarch ~ $]> uname -r
4.12.6-1-ARCH