[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#673590: libxml-libxml-perl: FTBFS on s390x: Failed 1/51 test programs. 0/2419 subtests failed.


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

Attachment: signature.asc
Description: Digital signature

Reply to: