From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12539 invoked by alias); 15 Aug 2012 05:23:48 -0000 Received: (qmail 12526 invoked by uid 22791); 15 Aug 2012 05:23:46 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_BF X-Spam-Check-By: sourceware.org Received: from mail-qc0-f169.google.com (HELO mail-qc0-f169.google.com) (209.85.216.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Aug 2012 05:23:33 +0000 Received: by qcsd16 with SMTP id d16so1069556qcs.0 for ; Tue, 14 Aug 2012 22:23:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:x-gm-message-state; bh=IpP4EyKSE0oZdpUd0wUC2782T8VDff6VfWE0YCtB4o8=; b=bb2SUsyw4gOyFrOQaHFfFyYINy3PZds9H5VZjmJRcHWjbDCnq2WmP6RE4HjJVPmImZ wLDFr7LRI++geOUSLHngKyZPli5LFNd7doVXactNsbilNtdViO1lL79822UsFYOBnSko bZUMH1zmJjidPdQvR0uBYwPZkywcVjd7bwjcNiJD+lwHAICDat372JudvKW4hNXjOBPm L2dtYuzdkgbnhSjS6o3gCSKkIbMrCAX3TkWHoTRNHtiA9HgLonD4znUX8d1C767B9mtu ur7EagcgI1IJdF4ike0m/7tgvF+pTRp06GuWDM43TwnKuvmD+7ZAmBxvexIBE4N/+euG 8xuQ== Received: by 10.224.213.198 with SMTP id gx6mr29381423qab.9.1345008212670; Tue, 14 Aug 2012 22:23:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.49.109.5 with HTTP; Tue, 14 Aug 2012 22:23:12 -0700 (PDT) In-Reply-To: References: <502A634B.8070307@redhat.com> From: Nathan Rajlich Date: Wed, 15 Aug 2012 05:23:00 -0000 Message-ID: Subject: Re: "closures" not working on OS X 10.8 (Mountain Lion)? To: libffi-discuss Cc: Andrew Haley , Reini Urban Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlmEytXY8MziyuHG5aC+yvDkXgxWk9rrurpcnxxO/HA5wEBkqGQi4Vu2sLPpNgD2/Palwyb X-IsSubscribed: yes Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org X-SW-Source: 2012/txt/msg00234.txt.bz2 Bobby, I believe that that patch has indeed been merged upstream in https://github.com/atgreen/libffi/commit/236c9391321f83ad40daf03f40c35c9ebc1da6b3. So I guess it's not that. Reini, that sounded like a good idea to me but it doesn't seem to change anything for me. This is what I did: $ cd libffi # still the v3.0.11 tag $ CFLAGS="-Xlinker -no_pie" CXXFLAGS="-Xlinker -no_pie" LDFLAGS="-no_pie" ./configure --enable-static --disable-shared --disable-builddir --with-pic $ CFLAGS="-Xlinker -no_pie" CXXFLAGS="-Xlinker -no_pie" LDFLAGS="-no_pie" make $ gcc -o closure-test closure.c .libs/libffi.a -Iinclude -Xlinker -no_pie $ ./closure-test Bus error: 10 Andrew, well shucks :) Anybody else have any ideas? On Tue, Aug 14, 2012 at 8:18 AM, Reini Urban wrote: > On Tue, Aug 14, 2012 at 9:40 AM, Andrew Haley wrote: >> On 08/13/2012 07:28 PM, Nathan Rajlich wrote: >>> It seems to me that closures are no longer working on OS X v10.8 >>> (a.k.a. Mountain Lion). I first noticed this when the node-ffi test >>> suite started failing with a "Bus Error", so just now I ran a simple >>> closure example from the internet and encounter the same error when I >>> try to run that. Note that this is using the libffi v3.0.11 tag. My >>> test case and shell session are outlined in this gist here: >>> https://gist.github.com/3342783. >>> >>> I don't personally know what's going on here, but am hoping somebody >>> on this list will. I can provide any more additional information >>> necessary. Cheers and thanks in advance! >> >> This is probably because of heap execute protection. Unfortunately I >> don't know how it works on OS X: you need an Apple export. > > --no_pie is needed. > > See also http://code.google.com/p/address-sanitizer/issues/detail?id=29 > how to disable ASLR with various MacOSX versions: > e.g. export DYLD_NO_PIE=1 on 10.6 > link with --no_pie since 10.7 > -- > Reini Urban > http://cpanel.net/ http://www.perl-compiler.org/