From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22082 invoked by alias); 11 Dec 2014 12:25:30 -0000 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 Received: (qmail 22067 invoked by uid 89); 11 Dec 2014 12:25:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp10.uk.ibm.com Received: from e06smtp10.uk.ibm.com (HELO e06smtp10.uk.ibm.com) (195.75.94.106) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 11 Dec 2014 12:25:28 +0000 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 Dec 2014 12:25:25 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 11 Dec 2014 12:25:22 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id B70CE1B08049 for ; Thu, 11 Dec 2014 12:25:43 +0000 (GMT) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sBBCPMkx57737332 for ; Thu, 11 Dec 2014 12:25:22 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sBBCPKax006798 for ; Thu, 11 Dec 2014 05:25:21 -0700 Received: from bl3ahm9f.de.ibm.com (dyn-9-152-212-213.boeblingen.de.ibm.com [9.152.212.213]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sBBCPKSp006781 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Thu, 11 Dec 2014 05:25:20 -0700 Received: from dvogt by bl3ahm9f.de.ibm.com with local (Exim 4.76) (envelope-from ) id 1Xz2o3-0007Kk-Ij; Thu, 11 Dec 2014 13:25:19 +0100 Date: Thu, 11 Dec 2014 12:25:00 -0000 From: Dominik Vogt To: libffi-discuss@sourceware.org, gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Cc: Andreas Krebbel Subject: Re: [gofrontend-dev] Re: [PATCH 00/13] Go closures, libffi, and the static chain Message-ID: <20141211122519.GA26215@linux.vnet.ibm.com> Reply-To: libffi-discuss@sourceware.org Mail-Followup-To: libffi-discuss@sourceware.org, gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com, Andreas Krebbel References: <1412973773-3942-1-git-send-email-rth@redhat.com> <20141211090623.GA30484@linux.vnet.ibm.com> <20141211092144.GE4283@bubble.grove.modra.org> <20141211103106.GA9789@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141211103106.GA9789@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14121112-0041-0000-0000-000002717E67 X-IsSubscribed: yes X-SW-Source: 2014/txt/msg00255.txt.bz2 On Thu, Dec 11, 2014 at 11:31:06AM +0100, Dominik Vogt wrote: > Just to make this clear: It's not something that *might* happen. > It *does* happen on s390[x] which does not use libffi but the hand > written code in makefunc_s390.S and makefuncgo_s390[x].go. > > The same may not happen when calling functions through libffi > (which may be dynamically linked) because ffi_call_go() is passed > the closure pointer as an argument and not in the static chain > register. Update: If I disable the custom s390x code and switch to the implementation just using libffi for reflection calls, the same crash occurs with the testing/quick libgo test case. The called function sees a bogus value written by the synamic linker as the closure pointer, for example with this line in the test code: CheckEqual(fComplex64, fComplex64, nil) Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany