GNU bug report logs - #20567
guile 2.0.11 - test failures on mips64 big-endian with n32 ABI

Previous Next

Package: guile;

Reported by: "Schaefer, Frank" <frank.schaefer <at> tekcomms.com>

Date: Wed, 13 May 2015 19:06:02 UTC

Severity: normal

To reply to this bug, email your comments to 20567 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#20567; Package guile. (Wed, 13 May 2015 19:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Schaefer, Frank" <frank.schaefer <at> tekcomms.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Wed, 13 May 2015 19:06:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Schaefer, Frank" <frank.schaefer <at> tekcomms.com>
To: "bug-guile <at> gnu.org" <bug-guile <at> gnu.org>
Subject: guile 2.0.11 - test failures on mips64 big-endian with n32 ABI
Date: Wed, 13 May 2015 18:31:12 +0000
[Message part 1 (text/plain, inline)]
I've encountered two test failures with guile 2.0.11 on mips64 big-endian, whenever I build with -mabi=n32 (these test failures do not occur with -mabi=64).  At least one of them I have resolved with the attached patch.

First testcase failure: test-ffi (fixed by my patch).  The guile code apparently assumes that sizeof(ffi_arg)<=sizeof(void **).  This is a faulty assumption; it holds on *most* platforms, but with the mips64 n32 ABI, sizeof(void **)==4, and sizeof(ffi_arg)==8.  So every foreign function that returns a pointer is liable to corrupt data, and anyone retrieving the return value as a simple void * is only going to get sign-extension garbage on big-endian (usually NULL).

Second testcase failure: check-guile fails due to 'ERROR: foreign.test: procedure->pointer: qsort - arguments: ((null-pointer-error "pointer->bytevector" "null pointer dereference" () ()))'.  I strongly suspect it's related to the ffi_arg issue mentioned above, but I'm still peeling away macro ugliness to track it down.  If anyone wants to pitch in with additional guidance or patchwork, I'd be happy to listen and test.

(The patch applies against 2.0.11 release or against current HEAD, where it also fixes the new testcases for test-foreign-object-scm and test-foreign-object-c.  HEAD also fails the test-out-of-memory case, though, which precludes further unit tests.)
[0001-use-ffi_arg-instead-of-void-to-hold-FFI-call-return-.patch (application/octet-stream, attachment)]

Information forwarded to bug-guile <at> gnu.org:
bug#20567; Package guile. (Fri, 24 Jun 2016 05:18:01 GMT) Full text and rfc822 format available.

Message #8 received at 20567 <at> debbugs.gnu.org (full text, mbox):

From: Andy Wingo <wingo <at> pobox.com>
To: mhw <at> netris.org
Cc: 20567 <at> debbugs.gnu.org, "Schaefer, Frank" <frank.schaefer <at> tekcomms.com>
Subject: Re: bug#20567: guile 2.0.11 - test failures on mips64 big-endian with
 n32 ABI
Date: Fri, 24 Jun 2016 07:17:50 +0200
Mark does this ring a bell to you?  I know you have a mip64 n32 machine
that you use sometimes.

Andy

On Wed 13 May 2015 20:31, "Schaefer, Frank" <frank.schaefer <at> tekcomms.com> writes:

> I've encountered two test failures with guile 2.0.11 on mips64
> big-endian, whenever I build with -mabi=n32 (these test failures do
> not occur with -mabi=64).  At least one of them I have resolved with
> the attached patch.
>
> First testcase failure: test-ffi (fixed by my patch).  The guile code
> apparently assumes that sizeof(ffi_arg)<=sizeof(void **).  This is a
> faulty assumption; it holds on *most* platforms, but with the mips64
> n32 ABI, sizeof(void **)==4, and sizeof(ffi_arg)==8.  So every foreign
> function that returns a pointer is liable to corrupt data, and anyone
> retrieving the return value as a simple void * is only going to get
> sign-extension garbage on big-endian (usually NULL).
>
> Second testcase failure: check-guile fails due to 'ERROR:
> foreign.test: procedure->pointer: qsort - arguments:
> ((null-pointer-error "pointer->bytevector" "null pointer dereference"
> () ()))'.  I strongly suspect it's related to the ffi_arg issue
> mentioned above, but I'm still peeling away macro ugliness to track it
> down.  If anyone wants to pitch in with additional guidance or
> patchwork, I'd be happy to listen and test.
>
> (The patch applies against 2.0.11 release or against current HEAD,
> where it also fixes the new testcases for test-foreign-object-scm and
> test-foreign-object-c.  HEAD also fails the test-out-of-memory case,
> though, which precludes further unit tests.)




This bug report was last modified 9 years and 76 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.