New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault when dumping (building emacs) #1664

Closed
csant opened this Issue Feb 4, 2017 · 7 comments

Comments

Projects
None yet
3 participants
@csant

csant commented Feb 4, 2017

Trying to build emacs-25.1.

$ ./configure --prefix=/usr
$ make
[...] building, loading everything, then:
Dumping under the name emacs


Warning: Your system has a gap between BSS and the
heap (28591512 bytes). This usually means that exec-shield
or something similar is in effect. The dump may
fail because of this. See the section about
exec-shield in etc/PROBLEMS for more information.


make[1]: *** [bootstrap-emacs] Segmentation fault (core dumped)
make[1]: Leaving directory `/home/csant/src/emacs/emacs-25.1/src'
make: *** [src] Error 2

All build tools have been installed via apt-get install.

Microsoft Windows [Version 10.0.14393]

$ strace make
[...]
Dumping under the name emacs


Warning: Your system has a gap between BSS and the
heap (14849432 bytes). This usually means that exec-shield
or something similar is in effect. The dump may
fail because of this. See the section about
exec-shield in etc/PROBLEMS for more information.


make[1]: *** [bootstrap-emacs] Segmentation fault (core dumped)
make[1]: Leaving directory `/home/csant/src/emacs/emacs-25.1/src'
[{WIFEXITED(s) && WEXITSTATUS(s) == 2}], 0, NULL) = 16728
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=16728, si_status=2, si_utime=0, si_stime=0} ---
rt_sigreturn() = 16728
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fbc1c950000
read(3, "# Locale name alias data base.\n#"..., 512) = 512
read(3, "PURPOSE. See the\n# GNU General "..., 512) = 512
read(3, " entries are case independent.\n\n"..., 512) = 512
read(3, "859-1\nfinnish fi_FI.ISO-"..., 512) = 512
read(3, "R\nko_KR\t\tko_KR.eucKR\nlithuanian "..., 512) = 512
read(3, "SO-8859-9\n", 512) = 10
read(3, "", 512) = 0
close(3) = 0
munmap(0x7fbc1c950000, 4096) = 0
open("/usr/share/locale/en_US.UTF8/LC_MESSAGES/make.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/make.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/make.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF8/LC_MESSAGES/make.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/make.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/make.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US.UTF8/LC_MESSAGES/make.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/make.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US/LC_MESSAGES/make.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en.UTF8/LC_MESSAGES/make.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en.utf8/LC_MESSAGES/make.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/make.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "make: ", 6make: ) = 6
write(2, "*** [src] Error 2", 17*** [src] Error 2) = 17
write(2, "\n", 1
) = 1
rt_sigprocmask(SIG_BLOCK, [HUP INT QUIT TERM XCPU XFSZ], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
chdir("/home/csant/src/emacs/emacs-25.1") = 0
close(1) = 0
munmap(0x7fbc1c960000, 4096) = 0
exit_group(2) = ?
+++ exited with 2 +++

@csant

This comment has been minimized.

Show comment
Hide comment
@csant

csant Feb 4, 2017

A solution is referred to in etc/PROBLEMS of the emacs project:
echo 0 > /proc/sys/kernel/randomize_va_space

But WSL doesn't allow you to do this, not even with sudo.

Solution is to
lxrun /setdefaultuser root
in a Powershell, then start WSL again, 'make' to finish compilation, in Powershell switch back to your usual user, 'chown' the binaries to match your user, and 'make install'...

csant commented Feb 4, 2017

A solution is referred to in etc/PROBLEMS of the emacs project:
echo 0 > /proc/sys/kernel/randomize_va_space

But WSL doesn't allow you to do this, not even with sudo.

Solution is to
lxrun /setdefaultuser root
in a Powershell, then start WSL again, 'make' to finish compilation, in Powershell switch back to your usual user, 'chown' the binaries to match your user, and 'make install'...

@therealkenc

This comment has been minimized.

Show comment
Hide comment
@therealkenc

therealkenc Feb 5, 2017

Collaborator

Appears to work on 15025. (I forgot the bash -c recently in another context too.)

$ sudo bash -c "echo 0 > /proc/sys/kernel/randomize_va_space"

Collaborator

therealkenc commented Feb 5, 2017

Appears to work on 15025. (I forgot the bash -c recently in another context too.)

$ sudo bash -c "echo 0 > /proc/sys/kernel/randomize_va_space"

@csant

This comment has been minimized.

Show comment
Hide comment
@csant

csant Feb 5, 2017

Ah, with 'sudo bash -c' it allows the operation, without, however, it doesn't. Still getting a hang of the system's glitches :) Thanks! Dumping shouldn't crash in a first case, however - and that's what the report is about.

csant commented Feb 5, 2017

Ah, with 'sudo bash -c' it allows the operation, without, however, it doesn't. Still getting a hang of the system's glitches :) Thanks! Dumping shouldn't crash in a first case, however - and that's what the report is about.

@therealkenc

This comment has been minimized.

Show comment
Hide comment
@therealkenc

therealkenc Feb 5, 2017

Collaborator

The sudo bash -c thing is a feature. Does the same on Real Linux™.

On a lark I just tried building 25.1 on native Ubuntu (happens to be 16.10). It segfaults the same there too.

Collaborator

therealkenc commented Feb 5, 2017

The sudo bash -c thing is a feature. Does the same on Real Linux™.

On a lark I just tried building 25.1 on native Ubuntu (happens to be 16.10). It segfaults the same there too.

@therealkenc

This comment has been minimized.

Show comment
Hide comment
Collaborator

therealkenc commented Feb 5, 2017

@therealkenc

This comment has been minimized.

Show comment
Hide comment
@therealkenc

therealkenc Dec 1, 2017

Collaborator

Me:

Appears to work on 15025. (I forgot the bash -c recently in another context too.)

This issue was just never closed out. This one, oddly enough, was linux-behavior.

Collaborator

therealkenc commented Dec 1, 2017

Me:

Appears to work on 15025. (I forgot the bash -c recently in another context too.)

This issue was just never closed out. This one, oddly enough, was linux-behavior.

@therealkenc therealkenc closed this Dec 1, 2017

@BelfordZ

This comment has been minimized.

Show comment
Hide comment
@BelfordZ

BelfordZ Apr 20, 2018

I had to sudo su before echo 0 > /proc/sys/kernel/randomize_va_space was allowed.

afterwards, make works. ty @csant

BelfordZ commented Apr 20, 2018

I had to sudo su before echo 0 > /proc/sys/kernel/randomize_va_space was allowed.

afterwards, make works. ty @csant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment