Re: [xml] xmlParseFile gets interrupted

On Tue, Jan 08, 2008 at 08:58:33PM +0100, Florian Hanisch wrote:
Hello again.

On Sun, 30 Dec 2007 13:57:30 +0100
Florian Hanisch <florianhanisch gmx de> wrote:


I've got a problem with the xmlParseFile function. Currently I'm
working on a XMMS plugin and within this plugin I need to parse a XML
The plugin consists mainly of a pthread called worker_function:

static void *worker_function(void *arg)
    xmlDocPtr doc;
    char *docname[MAX_LENGHT_URL + 1];
    doc = xmlParseFile(docname);

When I call xmlParseFile I get the following error message:

error : Interrupted function call
I/O warning : failed to load external entity

Replacing docname with a local URI (e.g. file:///path/to/file) gives
the desired result (= the parsed XML file).
The loading of the above URL works in a seperate test program.

So the question is: how do I figure out what interrupts xmlParseFile?

I did a strace -f and the only signal I could find which was sent to
thread is SIGRT_1.

I have now fixed the issue by using libcurl to get the file out of the
web and then I parse it via xmlParseDoc(). 

  Works for me from a standalone xmllint command. The signal is probably
issued as part of xmms , and libxml2 don't retry the I/O when it
interrupts the system call. Using libcurl in this context is
probably a good idea.

laptop:~ -> xmllint 
<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns=""; 
xmlns:ext="";><track-list count="1" offset="0"><track 
id="bc604384-5f17-4ac1-a613-c7112bdcadcf" ext:score="100"><title>Automatic 
Husband</title><duration>128840</duration><artist id="2c916f95-f6ba-46fa-b9d8-dc0d9379f603"><name>The Fiery 
Furnaces</name></artist><release-list><release id="cfa71fc5-a0d5-489e-878c-9909480adbdd"><title>Widow 
City</title><track-list offset="2" count="16"/></release></release-list></track></track-list></metadata>
laptop:~ -> 


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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