This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: [gofrontend-dev] Re: [PATCH 00/13] Go closures, libffi, and the static chain
- From: Dominik Vogt <vogt at linux dot vnet dot ibm dot com>
- To: libffi-discuss at sourceware dot org, gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Cc: Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>
- Date: Thu, 11 Dec 2014 13:25:19 +0100
- Subject: Re: [gofrontend-dev] Re: [PATCH 00/13] Go closures, libffi, and the static chain
- Authentication-results: sourceware.org; auth=none
- References: <1412973773-3942-1-git-send-email-rth at redhat dot com> <20141211090623 dot GA30484 at linux dot vnet dot ibm dot com> <20141211092144 dot GE4283 at bubble dot grove dot modra dot org> <20141211103106 dot GA9789 at linux dot vnet dot ibm dot com>
- Reply-to: libffi-discuss at sourceware dot org
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