emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building Emacs on WSL


From: Angelo Graziosi
Subject: Re: Building Emacs on WSL
Date: Tue, 20 Dec 2016 21:57:03 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1



Il 20/12/2016 20:35, Paul Eggert ha scritto:
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.

I did this:

$ gcc -std=gnu11 -g3 -O2 personality.c -o personality

(the command line set when Emacs is configured with "./configure --prefix=/opt/emacs --without-x")

$ ./personality
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

I rarely have used GDB (last time about ten years ago) and so I did:

$ gdb ./personality
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
[...]
(gdb) run
Starting program: /home/angelog/work/ports-packages/emacs/personality
warning: Error disabling address space randomization: Successo
warning: linux_ptrace_test_ret_to_nx: PTRACE_KILL waitpid returned -1: Chiamata di sistema interrotta
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[Inferior 1 (process 458) exited normally]
(gdb) q


which looks a bit different from yours..

Maybe you have a better way to use GDB...

Ciao,
 Angelo.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]