From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23523 invoked by alias); 22 Feb 2012 22:31:10 -0000 Received: (qmail 23514 invoked by uid 22791); 22 Feb 2012 22:31:08 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Feb 2012 22:30:55 +0000 From: "patrick.marlier at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug boehm-gc/52179] boehm-gc incompatible with aslr on darwin11 Date: Wed, 22 Feb 2012 22:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: boehm-gc X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: patrick.marlier at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-02/txt/msg02267.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52179 Patrick Marlier changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |patrick.marlier at gmail | |dot com --- Comment #8 from Patrick Marlier 2012-02-22 22:30:52 UTC --- As discussed in https://github.com/ivmai/bdwgc/issues/13, this was fixed in boehm-gc but due to the stage 4, I don't expect to the boehm-gc version be upgraded. Does a workaround should be proposed? You can try that but 1) this is untested (and probably is not enough), 2) NO_PTHREAD_GET_STACKADDR_NP macro does not exists in current boehm-gc so probably it will create problems too. Index: os_dep.c =================================================================== --- os_dep.c (revision 184398) +++ os_dep.c (working copy) @@ -1011,6 +1011,14 @@ ptr_t GC_get_stack_base() #if !defined(BEOS) && !defined(AMIGA) && !defined(MSWIN32) \ && !defined(MSWINCE) && !defined(OS2) && !defined(NOSYS) && !defined(ECOS) +# if defined(DARWIN) + /* We could use pthread_get_stackaddr_np even in case of a */ + /* single-threaded gclib (there is no -lpthread on Darwin). */ +# include +# undef STACKBOTTOM +# define STACKBOTTOM (ptr_t)pthread_get_stackaddr_np(pthread_self()) +# endif /* defined(DARWIN) */ + ptr_t GC_get_stack_base() { # if defined(HEURISTIC1) || defined(HEURISTIC2) || \