unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Angelo Graziosi <angelo.graziosi@alice.it>
To: Paul Eggert <eggert@cs.ucla.edu>,
	Fabrice Popineau <fabrice.popineau@centralesupelec.fr>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Building Emacs on WSL
Date: Tue, 20 Dec 2016 21:57:03 +0100	[thread overview]
Message-ID: <0cf6a70a-c5fa-56e8-e11e-168704666a7c@alice.it> (raw)
In-Reply-To: <ba5281b4-a3eb-dbbb-aa2f-e79bda64a1a8@cs.ucla.edu>



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.



  parent reply	other threads:[~2016-12-20 20:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-11 17:42 Building Emacs on WSL Angelo Graziosi
2016-12-16 15:05 ` Angelo Graziosi
2016-12-16 15:30   ` Eli Zaretskii
2016-12-16 17:48     ` Paul Eggert
2016-12-16 21:05       ` Eli Zaretskii
2016-12-17  1:00         ` Angelo Graziosi
2016-12-17  8:02           ` Eli Zaretskii
2016-12-17  8:33             ` Angelo Graziosi
2016-12-17 10:55               ` Eli Zaretskii
2016-12-17 14:25           ` Eli Zaretskii
2016-12-17 15:46             ` Angelo Graziosi
2016-12-20 12:20   ` Fabrice Popineau
2016-12-20 12:40     ` Fabrice Popineau
2016-12-20 19:35       ` Paul Eggert
2016-12-20 20:03         ` Fabrice Popineau
2016-12-20 23:59           ` Angelo Graziosi
2016-12-21  3:20           ` Paul Eggert
2016-12-21  8:54             ` Angelo Graziosi
2016-12-21 18:00               ` Paul Eggert
2016-12-21 20:50                 ` Angelo Graziosi
2016-12-20 20:57         ` Angelo Graziosi [this message]
2016-12-21  9:00       ` Angelo Graziosi
2016-12-21 10:29         ` Fabrice Popineau
2016-12-20 21:19     ` Angelo Graziosi
2016-12-20 22:01       ` Fabrice Popineau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0cf6a70a-c5fa-56e8-e11e-168704666a7c@alice.it \
    --to=angelo.graziosi@alice.it \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=fabrice.popineau@centralesupelec.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).