[xml] Loop of "SAX.error: Char 0x1B8DBC out of allowed range"



Running 2.4.5 my simple test case is hanging with this line repeating:

  SAX.error: Char 0x1B8DBC out of allowed range

Here's a back trace, my test program, and the source file can be found at
http://hank.org/modules/test.html.

Linux mardy 2.2.13 #1 Mon Nov 8 15:51:29 CET 1999 i686 unknown

(gdb) bt
#0  0x40162504 in __libc_write () from /lib/libc.so.6
#1  0x401adff8 in __DTOR_END__ () from /lib/libc.so.6
#2  0x401101af in new_do_write (fp=0x401ac7c0, 
    data=0x40015000 "SAX.error: Char 0x1B8DBC out of allowed range\n
encoding !\n", to_do=46) at fileops.c:328
#3  0x401100f6 in _IO_new_do_write (fp=0x401ac7c0, 
    data=0x40015000 "SAX.error: Char 0x1B8DBC out of allowed range\n
encoding !\n", to_do=46) at fileops.c:301
#4  0x401103ce in _IO_new_file_overflow (f=0x401ac7c0, ch=-1) at fileops.c:441
#5  0x40111198 in __overflow (f=0x401ac7c0, ch=-1) at genops.c:197
#6  0x40110c51 in _IO_new_file_xsputn (f=0x401ac7c0, data=0x4009ad49, n=22)
at fileops.c:803
#7  0x4010092f in _IO_vfprintf (s=0x401ac7c0, format=0x4009ad40 "Char 0x%X
out of allowed range\n", ap=0xbfffc9dc)
    at vfprintf.c:1281
#8  0x8048768 in errorDebug ()
#9  0x40066cc7 in htmlCurrentChar (ctxt=0x8049ac0, len=0xbfffca44) at
HTMLparser.c:256
#10 0x40068ecc in htmlParseCharData (ctxt=0x8049ac0) at HTMLparser.c:2359
#11 0x4006ab8f in htmlParseContent (ctxt=0x8049ac0) at HTMLparser.c:3360
#12 0x4006aeb6 in htmlParseElement (ctxt=0x8049ac0) at HTMLparser.c:3519
#13 0x4006ab57 in htmlParseContent (ctxt=0x8049ac0) at HTMLparser.c:3337
#14 0x4006aeb6 in htmlParseElement (ctxt=0x8049ac0) at HTMLparser.c:3519
#15 0x4006ab57 in htmlParseContent (ctxt=0x8049ac0) at HTMLparser.c:3337
#16 0x4006aeb6 in htmlParseElement (ctxt=0x8049ac0) at HTMLparser.c:3519
#17 0x4006ab57 in htmlParseContent (ctxt=0x8049ac0) at HTMLparser.c:3337
#18 0x4006b0f3 in htmlParseDocument (ctxt=0x8049ac0) at HTMLparser.c:3615
#19 0x4006c95b in htmlSAXParseDoc (
    cur=0xbfffd108 "<!-- MHonArc v2.4.3 -->\n<!--X-Subject: ¸¶ÇÏcd
À̸ÞÀϺ¯°æÀ» ¾Ë·Áµå¸³´Ï´Ù ²À!ºÁÁÖ¼¼¿ä -->\n<!--X-From-R13:
znun_pqNlnubb.pb.xe -->\n<!--X-Date: Sat, 2 Oct 1999 08:07:31 &#45;0400
(EDT) -->\n<!--X-Message-I"..., encoding=0x0, 
    sax=0xbffff81c, userData=0x0) at HTMLparser.c:4754
#20 0x804882f in main ()
#21 0x400d0313 in __libc_start_main (main=0x8048770 <main>, argc=1,
argv=0xbffff8d4, init=0x8048568 <_init>, 
    fini=0x80488a4 <_fini>, rtld_fini=0x4000ac70 <_dl_fini>,
stack_end=0xbffff8cc) at ../sysdeps/generic/libc-start.c:90

cat xmlt.c
#include <stdio.h>
#include <stdarg.h>  // for va_list
#include <libxml/HTMLparser.h>
#include <sys/stat.h>
#include <unistd.h>

static void
errorDebug(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...)
{
    va_list args;

    va_start(args, msg);
    fprintf(stdout, "SAX.error: ");
    vfprintf(stdout, msg, args);
    va_end(args);
}


int main(int argc, char **argv) 
{
    htmlSAXHandler      SAXHandlerStruct;
    htmlSAXHandlerPtr   SAXHandler = &SAXHandlerStruct;
    char                buffer[10000];
    FILE               *f;
    int                 size; 
    struct stat         stbuf;
    
    memset( SAXHandler, 0, sizeof( htmlSAXHandler ) );
    SAXHandlerStruct.error = (errorSAXFunc)&errorDebug;

    if (stat("test.html", &stbuf))
        return -1;
    

    f = fopen("test.html", "r");
    if (f != NULL) {
        size = fread( buffer, 1, stbuf.st_size, f );
        buffer[size] = '\0';
        htmlSAXParseDoc( buffer, NULL, SAXHandler, NULL );
    }

    return 0;
}


 

Bill Moseley
mailto:moseley hank org




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