Skip Menu |

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 77340
Status: resolved
Priority: 0/
Queue: XML-LibXML

People
Owner: Nobody in particular
Requestors: gregoa [...] debian.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: [PATCH] Fix test failures on 64-bit big endian platforms
Date: Mon, 21 May 2012 23:14:00 +0200
To: bug-xml-libxml [...] rt.cpan.org
From: gregor herrmann <gregoa [...] debian.org>
In Debian we are currently applying the attached patch to XML-LibXML. We thought you might be interested in it, too. From 99f67c5d0e13912c824b7d93ff4303524bd9cb54 Mon Sep 17 00:00:00 2001 From: Niko Tyni <ntyni@debian.org> Date: Sun, 20 May 2012 22:32:31 +0300 Subject: [PATCH] Fix test failures on 64-bit big endian platforms As seen in <http://bugs.debian.org/673590>, t/12html.t is crashing on 64-bit big endian platforms with Show quoted text
> Out of memory! > # Looks like you planned 43 tests but ran 41. > # Looks like your test exited with 1 just after 41. > t/12html.t .......................... > Dubious, test returned 1 (wstat 256, 0x100) > Failed 2/43 subtests
STRLEN has 64 bits here and int has 32, so the (int*) cast in XML::LibXML::Document::toStringHTML() makes htmlDocDumpMemory() store the 32-bit length of the result into a 64-bit variable. Depending on the endianness, it either works OK (LE) or corrupts the variable (BE) Just use an 'int' instead, and cast it to an STRLEN later in the newSVpvn() call. --- LibXML.xs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LibXML.xs b/LibXML.xs index 8ac23bf..581cc48 100644 Thanks in advance, gregor herrmann, Debian Perl Group

Message body is not shown because sender requested not to inline it.

Hi Gregor, thanks for the patch. It seems fine, so I think I'll apply it soon. Regards, -- Shlomi Fish On Mon May 21 17:14:31 2012, gregoa@debian.org wrote: Show quoted text
> In Debian we are currently applying the attached patch to XML-LibXML. > We thought you might be interested in it, too. > > > From 99f67c5d0e13912c824b7d93ff4303524bd9cb54 Mon Sep 17 00:00:00 2001 > From: Niko Tyni <ntyni@debian.org> > Date: Sun, 20 May 2012 22:32:31 +0300 > Subject: [PATCH] Fix test failures on 64-bit big endian platforms > > As seen in <http://bugs.debian.org/673590>, t/12html.t is crashing > on 64-bit big endian platforms with >
> > Out of memory! > > # Looks like you planned 43 tests but ran 41. > > # Looks like your test exited with 1 just after 41. > > t/12html.t .......................... > > Dubious, test returned 1 (wstat 256, 0x100) > > Failed 2/43 subtests
> > STRLEN has 64 bits here and int has 32, so the (int*) cast in > XML::LibXML::Document::toStringHTML() makes htmlDocDumpMemory() store > the 32-bit length of the result into a 64-bit variable. Depending on > the endianness, it either works OK (LE) or corrupts the variable (BE) > > Just use an 'int' instead, and cast it to an STRLEN later in the > newSVpvn() call. > --- > LibXML.xs | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/LibXML.xs b/LibXML.xs > index 8ac23bf..581cc48 100644 > > > > Thanks in advance, > gregor herrmann, Debian Perl Group
This was fixed in the Mercurial repository. I'm planning to publish a new version (1.99) later today, after I look into fixing some of the other bugs in the RT. Regards, -- Shlomi Fish