|
From: | Fabrice Popineau |
Subject: | Re: Building Emacs on WSL |
Date: | Tue, 20 Dec 2016 21:03:35 +0100 |
On 12/20/2016 04:40 AM, Fabrice Popineau wrote:
(gdb) run --batch --load loadup bootstrap
Starting program: /mnt/d/Source/emacs/build-emacs-ubuntu/src/temacs --batch --load loadup bootstrap
warning: Error disabling address space randomization: Succès
This is a warning from GDB, not from Emacs. GDB normally attempts to disable ASLR, to make debugging easier. Looking at the sequence of system calls in GDB 7.12, GDB calls 'personality' in some funky and undocumented ways, e.g., GDB assumes that errno is not changed when 'personality' succeeds.
Please compile and run the attached program under WSL, using the same flags you use to compile Emacs, and let me know what it does. On Fedora 24 x86-64, this program outputs:
personality (0xffffffff) returns 0x0, errno=0 (Success)
ADDR_NO_RANDOMIZE was clear
personality (pers | ADDR_NO_RANDOMIZE) returns 0x0, errno=0 (Success)
ADDR_NO_RANDOMIZE set successfully
When run under GDB, the same program outputs:
personality (0xffffffff) returns 0x40000, errno=0 (Success)
ADDR_NO_RANDOMIZE was set
because GDB already disabled ASLR. You can look at GDB's file gdb/nat/linux-personality.c to see how GDB differs from Emacs in this area; perhaps there's something there that Emacs can use to figure out that it is running with a buggy kernel.
there is a simple fix:
That fix cannot be installed as-is since ASLR needs to be disabled on ordinary GNU/Linux platforms. It appears that WSL pretends to support the Linux 'personality' system call and its ADDR_NO_RANDOMIZE flag, and that this support does not actually work and makes Emacs crash.
[Prev in Thread] | Current Thread | [Next in Thread] |