Bug#501825: libjson-xs-perl_2.23-1(sparc/unstable): FTBFS on sparc, fails in tests

Niko Tyni ntyni at debian.org
Wed Nov 12 07:39:40 UTC 2008

clone 501825 -1
reassign -1 perl 5.10.0-16
retitle -1 sv_chop() alignment problems on sparc
severity -1 important

On Wed, Oct 15, 2008 at 11:39:52PM +0300, Niko Tyni wrote:
> On Fri, Oct 10, 2008 at 09:00:21PM +0200, Martin Zobel-Helas wrote:
> > Package: libjson-xs-perl
> > Version: 2.23-1
> > Severity: serious
> > 
> > There was an error while trying to autobuild your package:
> > 
> > > Automatic build of libjson-xs-perl_2.23-1 on schroeder by sbuild/sparc 99.99
> > > Build started at 20081010-1421
> > > t/19_incr...............dubious
> > > 	Test returned status 0 (wstat 10, 0xa)
> > > DIED. FAILED test 697
> > > 	Failed 1/697 tests, 99.86% okay

Here's a status update on this; real life is currently leaving me little
hack time, so it's proceeding quite slowly. It doesn't apply to Lenny,
though, so it's not very urgent.

As I wrote earlier, this is an alignment problem on sparc where gcc -O2 is
using double word instructions on a struct that should be 64-bit aligned
but isn't. The alignment is lost in libperl's sv_chop() function. As far
as I understand, this happens because of the 'OOK hack', which upgrades
the SV into an SvPVIV, moving the value into a non-aligned location.

I think it's clear that this is a bug in the Perl core rather than JSON-XS
itself, so cloning and reassigning. The build failure can be worked around
by lowering the optimization level on sparc to -O1 or -O0, disabling the
use of double-word instructions.

I've reproduced the bug with a 'pristine' non-Debian Perl 5.10.0. It's
gone in bleadperl; bisecting shows it was fixed with change 32836,
which reimplements the OOK hack in a different way that doesn't upgrade
the SV anymore. It's still present in the current maint-5.10 branch,
as of change 34715.

I'm currently working on a minimal testcase for a proper Perl bug report.
Ideally, this would be a simple C program using libperl and cutting JSON-XS
from the loop.

I've discussed this a bit with Marc Lehmann (Cc'd), the JSON-XS
author. Unfortunately bugs.debian.org is silently discarding his messages
because their envelope-sender is root at ..., matching FROM_DAEMON, so the
correspondence is not visible in the bug log.
Niko Tyni   ntyni at debian.org

More information about the pkg-perl-maintainers mailing list