From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: VIRT_ADDR_VARIES Date: Wed, 09 Nov 2011 21:40:10 -0800 Organization: UCLA Computer Science Department Message-ID: <4EBB63BA.9020306@cs.ucla.edu> References: <4EB73983.1060000@cs.ucla.edu> <4EB86864.5080709@cs.ucla.edu> <4EB96841.7020701@cs.ucla.edu> <4EB99C7D.8000407@cs.ucla.edu> <4EBABBF5.5030602@cs.ucla.edu> <87r51gmxlb.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1320903620 16641 80.91.229.12 (10 Nov 2011 05:40:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 10 Nov 2011 05:40:20 +0000 (UTC) Cc: Andreas Schwab , emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 10 06:40:16 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RONN1-0008T1-Lv for ged-emacs-devel@m.gmane.org; Thu, 10 Nov 2011 06:40:15 +0100 Original-Received: from localhost ([::1]:52233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RONN1-0005ae-9i for ged-emacs-devel@m.gmane.org; Thu, 10 Nov 2011 00:40:15 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:54729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RONMy-0005aZ-DM for emacs-devel@gnu.org; Thu, 10 Nov 2011 00:40:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RONMx-00006l-8c for emacs-devel@gnu.org; Thu, 10 Nov 2011 00:40:12 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:50239) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RONMw-00006e-UJ for emacs-devel@gnu.org; Thu, 10 Nov 2011 00:40:11 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id BCAAD39E8007; Wed, 9 Nov 2011 21:40:08 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bfm6DD3M5bfb; Wed, 9 Nov 2011 21:40:08 -0800 (PST) Original-Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 45F6639E8006; Wed, 9 Nov 2011 21:40:08 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: <87r51gmxlb.fsf@uwakimon.sk.tsukuba.ac.jp> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:145963 Archived-At: On 11/09/11 20:05, Stephen J. Turnbull wrote: > We don't live in a traditional world anymore. We have SELinux,... Yes, of course, but the question isn't whether we have non-traditional layouts -- of course we have them. The question is: on what type of platform is VIRT_ADDR_VARIES correctly unset (i.e., the traditional model is good enough for Emacs), but this approach breaks down when running under valgrind? Let me try to state the issue more concretely. I don't observe the problem on my host (Fedora 15 x86-64), even though it has address space randomization. If I run these two shell commands: ./temacs --batch --eval '(progn (insert-file "/proc/self/maps") (message "%s\n" (buffer-string)))' valgrind ./temacs --batch --eval '(progn (insert-file "/proc/self/maps") (message "%s\n" (buffer-string)))' I get quite different outputs, but the text, data, and bss segments are laid out identically in both cases, and they're always laid out before the heap. That is, the output looks like this both times: 00400000-00634000 r-xp 00000000 09:02 106972830 .../src/temacs 00834000-00adc000 rw-p 00234000 09:02 106972830 .../src/temacs 00adc000-00b63000 rw-p 00000000 00:00 0 [...everything else...] Here the first line is text, the second data, the third bss. Because the heap is after the data in both cases, Emacs works in both cases, and there's no need to define VIRT_ADDR_VARIES, regardless of whether valgrind is used. Can someone run those two commands on a GNU/Linux host where valgrind breaks things, and use the output to explain why the breakage occurs? That might help explain the issue better.