From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.bugs Subject: bug#8395: ASLR Issue? Date: Wed, 06 Jul 2011 16:41:48 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <6CD2FB60-80D6-40C4-92A9-F5BAB9AA4173@dre.vanderbilt.edu> <14674727-2DB3-4CFE-80F1-24B2B3512DDB@play-bow.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: dough.gmane.org 1309938146 9675 80.91.229.12 (6 Jul 2011 07:42:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 6 Jul 2011 07:42:26 +0000 (UTC) Cc: 8395@debbugs.gnu.org, "William R. Otte" To: Bob Halley Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 06 09:42:22 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1QeMkX-0000tP-QM for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Jul 2011 09:42:21 +0200 Original-Received: from localhost ([::1]:48369 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeMkW-0007TM-UX for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Jul 2011 03:42:21 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:36102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeMkH-0007TA-A9 for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2011 03:42:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QeMkF-00012o-Re for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2011 03:42:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QeMkF-00012i-QA for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2011 03:42:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QeMkF-0004hJ-81; Wed, 06 Jul 2011 03:42:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: YAMAMOTO Mitsuharu Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Jul 2011 07:42:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8395 X-GNU-PR-Package: emacs,ns X-GNU-PR-Keywords: Original-Received: via spool by 8395-submit@debbugs.gnu.org id=B8395.130993812218054 (code B ref 8395); Wed, 06 Jul 2011 07:42:03 +0000 Original-Received: (at 8395) by debbugs.gnu.org; 6 Jul 2011 07:42:02 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QeMkD-0004h7-Rr for submit@debbugs.gnu.org; Wed, 06 Jul 2011 03:42:02 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QeMk9-0004gn-V8 for 8395@debbugs.gnu.org; Wed, 06 Jul 2011 03:41:59 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id DFE94C0557; Wed, 6 Jul 2011 16:41:48 +0900 (JST) In-Reply-To: <14674727-2DB3-4CFE-80F1-24B2B3512DDB@play-bow.org> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?UTF-8?Q?Shij=C5=8D?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 06 Jul 2011 03:42:03 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:48066 Archived-At: >>>>> On Tue, 5 Jul 2011 15:45:49 +0100, Bob Halley said: > I too see this problem trying to build Aquamacs' emacs-24-based > branch on Lion GM with Xcode 4.1 preview 7. The problem is *not* an > unknown section name. I added some debugging printfs, and this is > what I see. Basically things seem to be going OK until we try to > write __data, where we get EFAULT when we try to write() it. I > don't know why sectp->addr is giving EFAULT; perhaps ASLR? If I > discover more, I will add to the ticket. Could you try the patch below? (I can't test it myself.) As far as I tested, gcc -fno-pie *.o does not give an error on older versions (though gcc -fno-pie *.c does in cc1). So we can go without additional configure-time checks if this modification works on Xcode 4.1 and/or Lion. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp For trunk: === modified file 'configure.in' *** configure.in 2011-07-05 08:21:38 +0000 --- configure.in 2011-07-06 06:13:33 +0000 *************** *** 3349,3355 **** libs_nsgui= headerpad_extra=690 fi ! LD_SWITCH_SYSTEM_TEMACS="-prebind $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra" ## This is here because src/Makefile.in did some extra fiddling around ## with LD_SWITCH_SYSTEM. The cpp logic was: --- 3349,3355 ---- libs_nsgui= headerpad_extra=690 fi ! LD_SWITCH_SYSTEM_TEMACS="-fno-pie -prebind $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra" ## This is here because src/Makefile.in did some extra fiddling around ## with LD_SWITCH_SYSTEM. The cpp logic was: For emacs-23 branch: === modified file 'src/s/darwin.h' *** src/s/darwin.h 2011-01-02 23:50:46 +0000 --- src/s/darwin.h 2011-07-06 06:07:50 +0000 *************** *** 181,187 **** end of the header for adding load commands. Needed for dumping. 0x690 is the total size of 30 segment load commands (at 56 each); under Cocoa 31 commands are required. */ ! #define LD_SWITCH_SYSTEM_TEMACS -prebind LIBS_NSGUI -Xlinker -headerpad -Xlinker HEADERPAD_EXTRA #define C_SWITCH_SYSTEM_TEMACS -Dtemacs --- 181,187 ---- end of the header for adding load commands. Needed for dumping. 0x690 is the total size of 30 segment load commands (at 56 each); under Cocoa 31 commands are required. */ ! #define LD_SWITCH_SYSTEM_TEMACS -fno-pie -prebind LIBS_NSGUI -Xlinker -headerpad -Xlinker HEADERPAD_EXTRA #define C_SWITCH_SYSTEM_TEMACS -Dtemacs