Bug#673590: libxml-libxml-perl: FTBFS on s390x: Failed 1/51 test programs. 0/2419 subtests failed.
Philipp Kern
pkern at debian.org
Sun May 20 20:22:58 UTC 2012
Niko,
am Sun, May 20, 2012 at 10:59:28PM +0300 hast du folgendes geschrieben:
> It's a pointer cast in XML::LibXML::Document::toStringHTML, in LibXML.xs
> around line 2939.
>
> STRLEN len = 0;
> [...]
> htmlDocDumpMemory(self, &result, (int*)&len);
> [...]
> RETVAL = newSVpvn((char *)result, (STRLEN)len);
>
> (STRLEN is defined as a size_t via /usr/lib/perl/5.14/CORE/perl.h)
>
> See the attached patch, which just makes 'len' an int and removes the
> problematic pointer cast. I wonder if the STRLEN cast on becomes an
> issue, though. Is it possible that an int doesn't fit into a size_t
> variable somewhere?
you cannot reinterpret a size_t as an int. size_t might be unsigned, might
have another length, etc. On 64bit big endian you fill the top bits and
leave the lower ones untouched, because size_t is 64bit. So yeah, that code
was broken. (nbd had something similar, glib too. I don't know why it only
turns up with 64bit big endian.)
Kind regards
Philipp Kern
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20120520/666a5bb8/attachment.pgp>
More information about the pkg-perl-maintainers
mailing list