For clarification: Do parse_file() and parse_string() work?
Christian
On 18 Jul 2012, at 15:06, wosch@freebsd.org via RT wrote:
Show quoted text> Wed Jul 18 09:06:13 2012: Request 78448 was acted upon.
> Transaction: Ticket created by wosch@freebsd.org
> Queue: XML-LibXML
> Subject: chinese character force a SIGABRT in XS_XML__LibXML__parse_fh and kill perl
> Broken in: (no value)
> Severity: (no value)
> Owner: Nobody
> Requestors: wosch@freebsd.org
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=78448 >
>
>
> Hi,
>
> one of my CGI scripts crashed when the user submitted chinese
> characters. It turns out that a single chinese character crashes
> the parse_fh() function.
>
> The error happens on all perl version up to 5.16, any OS and any
> XML::LibXML version up to 2.0002.
>
> gdb perl
> GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Thu Nov 3 21:59:02 UTC 2011)
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
> shared libraries .... done
>
> (gdb) run test.pl test-macos.xml
> Starting program: /opt/local/bin/perl test.pl test-macos.xml
> Reading symbols for shared libraries +++.......................... done
> Reading symbols for shared libraries . done
> Reading symbols for shared libraries . done
> Reading symbols for shared libraries . done
> Reading symbols for shared libraries . done
> Reading symbols for shared libraries .... done
> Running with XML::LibXML version: 1.84
>
> Program received signal SIGABRT, Aborted.
> 0x00007fff8857682a in __kill ()
> (gdb) bt
> #0 0x00007fff8857682a in __kill ()
> #1 0x00007fff90b3fb6c in __abort ()
> #2 0x00007fff90b3c070 in __stack_chk_fail ()
> #3 0x00000001004078bb in XS_XML__LibXML__parse_fh ()
> #4 0x0000000100082abf in Perl_pp_entersub ()
> #5 0x000000010007af06 in Perl_runops_standard ()
> #6 0x000000010001c5b4 in perl_run ()
> #7 0x0000000100000d7d in main ()
> (gdb)
>
>
> attached is a simple perl script and 2 xml files for testing. On
> MacOS, it crashes with a single chinese character, on Linux it needs
> some more padding characters to get the same effect.
>
> -Wolfram
>
> --
> Wolfram Schneider <wosch@FreeBSD.org>
http://wolfram.schneider.org
>
> <test.pl><chinese>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
>
> <characters>主題</characters>
>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
>
> <characters>關鍵詞</characters>
>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> <blob>foooooooooooooooooooooooooooooooooooooooooooooooooooo</blob>
> </chinese>
> <chinese>
> <characters>題</characters>
> <blob>blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob blob</blob>
> </chinese>