From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5627 invoked by alias); 13 Sep 2012 00:51:39 -0000 Received: (qmail 5613 invoked by uid 22791); 13 Sep 2012 00:51:37 -0000 X-SWARE-Spam-Status: No, hits=-4.2 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-ie0-f169.google.com (HELO mail-ie0-f169.google.com) (209.85.223.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 13 Sep 2012 00:51:09 +0000 Received: by iec9 with SMTP id 9so4489090iec.0 for ; Wed, 12 Sep 2012 17:51:08 -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:content-type:x-gm-message-state; bh=50KFGQzKtjzRQe71NRh2ieUD/VKrPIlli8sMm5AQ2ks=; b=MJ9GYG/86We8ox3WO7lThZWMAN22h0gB2o2zwSnXu7kn7rGlCStNKyUqDQu8U0yxc1 rJVEhDgIBfUM2g4Na9BhU6cg7tpX780RZHt7S6EmGcfQ3IYVVkKQXoWBcZYDi9YpIyiS t2JZMmsVyKyuYhCHRgNARIgRBCndk4IuSPN1AHr1XasgMcdqs9NuJHFsqCzjm9zhtGhN 3DhhpO4zITx7xhEO4HXbzGnnOATxSnX3dUYNEh2a9IvIIS3XsDJEaLy3kNAwMn5vhZfw plIYwLhfEgVwzfZvh5aW9DBquxyob5A83gxOAKt6LlJYSQIX2e+GwrPifkD0i+cqrqtM 4m/g== Received: by 10.50.5.196 with SMTP id u4mr250569igu.41.1347497468774; Wed, 12 Sep 2012 17:51:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.63.132 with HTTP; Wed, 12 Sep 2012 17:50:48 -0700 (PDT) In-Reply-To: References: <502A634B.8070307@redhat.com> From: Nathan Rajlich Date: Thu, 13 Sep 2012 00:51:00 -0000 Message-ID: Subject: Re: "closures" not working on OS X 10.8 (Mountain Lion)? To: libffi-discuss Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQngE/vj5/9FgJvYIWxfpy2jI3i+b2mGN1kY6tK0rI8/NPtyqQqz8icc9Ho0WbTxFZSJ2p0f 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/msg00240.txt.bz2 So does anybody else have any suggestions for diagnosing this? Things work fine on Leopard, Snow Leopard, and Lion, just not Mountain Lion. I'm stumped as for a way to make any progress here. On Tue, Aug 14, 2012 at 10:23 PM, Nathan Rajlich wrote: > 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/