Skip Menu |

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 46946
Status: rejected
Priority: 0/
Queue: XML-LibXML

People
Owner: Nobody in particular
Requestors: REHSACK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.69
Fixed in: (no value)



Subject: Documentation of finish_push is different from behaviour
Hi, I run into a problem with XML::LibXML during trying to parse incoming packets until they're completed (multiplexed channels). There're some problems - but the one I've found comes from XML::LibXML: finish_push doesn't always throws an exception, if an incomplete packet was "parsed". The parser is always forced to break on incomplete packets ('$parser->recover(0)'), but sometimes (in attached log in line 31) under heavy load (one thread) it simply returns undef and throws no exception. Best regards, Jens PS: I can execute provided test-procs, but our code has been modified meanwhile to simply check for valid doc and ignores any exception - that works fine.
Subject: LibXML-demo-snap.log
Download LibXML-demo-snap.log
application/octet-stream 6.7k

Message body not shown because it is not plain text.

Subject: LibXML-demo-snap.pl
37 sub putLine 38 { 39 my $self = shift; 40 my @lines = @_; 41 42 StdOut( '>>>>>>>>>>>>>>>>>>>>>' ); 43 44 foreach my $line (@lines) 45 { 46 my $err = 0; 47 my $doc; 48 unless ( $self->{inpacket} ) 49 { 50 next if( 0 == length($line) ); 51 ++$self->{inpacket}; 52 $self->{curmsg} = []; 53 } 54 55 StdOutf( q{'%s'}, $line ); 56 57 try 58 { 59 push( @{ $self->{curmsg} }, $line ); 60 $self->{parser}->init_push(); 61 $self->{parser}->push( @{ $self->{curmsg} } ); 62 $doc = $self->{parser}->finish_push(); 63 if( defined( $doc ) ) 64 { 65 StdOutf( q{doc '%s' ok}, $doc->documentElement()->nodeName() ) ; 66 StdOut('-' x 60); 67 } 68 else 69 { 70 $err = 1; 71 } 72 } 73 catch 74 { 75 $err = 1; 76 }; 77 78 unless ($err) 79 { 80 --$self->{inpacket}; 81 $self->parseDoc($doc) if ( defined($doc) ); 82 } 83 } 84 85 StdOut( '<<<<<<<<<<<<<<<<<<<<' ); 86 87 return; 88 }
Dne po 15.čen.2009 05:33:53, REHSACK napsal(a): Show quoted text
> Hi, > > I run into a problem with XML::LibXML during trying to parse incoming > packets until they're completed (multiplexed channels). There're some > problems - but the one I've found comes from XML::LibXML: > > finish_push doesn't always throws an exception, if an incomplete packet > was "parsed". The parser is always forced to break on incomplete packets > ('$parser->recover(0)'), but sometimes (in attached log in line 31) > under heavy load (one thread) it simply returns undef and throws no > exception. > > Best regards, > Jens > > PS: I can execute provided test-procs, but our code has been modified > meanwhile to simply check for valid doc and ignores any exception - that > works fine.
Hi, thanks for the report. Unfortunatelly, I was not able to reproduce this bug based on the code you have provided. Can you try to create and post a complete self-contained test script that simulates the situation in which you encounter the error? Also, can you test with the XML::LibXML version now in SVN? And finally, in the code you sent you do not need to use push parser at all since you feed all data in a single push(). Please comment. Thanks, -- Petr
Subject: Re: [rt.cpan.org #46946] Documentation of finish_push is different from behaviour
Date: Fri, 25 Sep 2009 15:47:04 +0000
To: bug-XML-LibXML [...] rt.cpan.org
From: Jens Rehsack <rehsack [...] web.de>
Petr Pajas via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=46946 > > > Dne po 15.čen.2009 05:33:53, REHSACK napsal(a):
>> Hi, >> >> I run into a problem with XML::LibXML during trying to parse incoming >> packets until they're completed (multiplexed channels). There're some >> problems - but the one I've found comes from XML::LibXML: >> >> finish_push doesn't always throws an exception, if an incomplete packet >> was "parsed". The parser is always forced to break on incomplete packets >> ('$parser->recover(0)'), but sometimes (in attached log in line 31) >> under heavy load (one thread) it simply returns undef and throws no >> exception. >> >> Best regards, >> Jens >> >> PS: I can execute provided test-procs, but our code has been modified >> meanwhile to simply check for valid doc and ignores any exception - that >> works fine.
> > Hi, > > thanks for the report. Unfortunatelly, I was not able to reproduce this > bug based on the code you have provided. Can you try to create and post > a complete self-contained test script that simulates the situation in > which you encounter the error?
No - this is a problem. It's a closed source project (I already asked for it before I opened the report). This happens only under heavy stress (I opened a lot of clients to one server and let them all send xml messages). Maybe you can reproduce it or simply trust me ;-) Show quoted text
> Also, can you test with the XML::LibXML version now in SVN?
Maybe - but I cannot promise. The project ends Wednesday and with it my contract ends. After it I might find the time to create a new example to demonstrate the error (to get a feeling when, take a look between SQL::Statement 1.20 and the first development releases for 1.21 ^^) and provide this. Show quoted text
> And finally, in the code you sent you do not need to use push parser at > all since you feed all data in a single push().
The code is stripped down. The original code was more complex - but I'll take a look if it's now true. Best regards, Jens
Download signature.asc
application/pgp-signature 834b

Message body not shown because it is not plain text.

Dne pá 25.zář.2009 11:47:42, rehsack@web.de napsal(a): Show quoted text
> Petr Pajas via RT wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=46946 > > > > > Dne po 15.čen.2009 05:33:53, REHSACK napsal(a):
> >> Hi, > >> > >> I run into a problem with XML::LibXML during trying to parse incoming > >> packets until they're completed (multiplexed channels). There're some > >> problems - but the one I've found comes from XML::LibXML: > >> > >> finish_push doesn't always throws an exception, if an incomplete packet > >> was "parsed". The parser is always forced to break on incomplete
packets Show quoted text
> >> ('$parser->recover(0)'), but sometimes (in attached log in line 31) > >> under heavy load (one thread) it simply returns undef and throws no > >> exception. > >> > >> Best regards, > >> Jens > >> > >> PS: I can execute provided test-procs, but our code has been modified > >> meanwhile to simply check for valid doc and ignores any exception -
that Show quoted text
> >> works fine.
> > > > Hi, > > > > thanks for the report. Unfortunatelly, I was not able to reproduce this > > bug based on the code you have provided. Can you try to create and post > > a complete self-contained test script that simulates the situation in > > which you encounter the error?
> > No - this is a problem. It's a closed source project (I already asked
for it Show quoted text
> before I opened the report). This happens only under heavy stress (I
opened Show quoted text
> a lot of clients to one server and let them all send xml messages). Maybe > you can reproduce it or simply trust me ;-)
I do trust you, of course. The thing is that I looked in the finish_push but found nothing suspicious, so I wanted to be able to reproduce the bug in order to debug it. I was not asking for a real project code, I just thought you might create something that just simulates the real process (may be difficult, but it's even harder for me: I don't know the details of your architecture so I would probably waste hours in vain). Also, since the implementation of finish_push in LibXML.xs is very simple, maybe you could try stuffing some debug messages in there and see what happens if you attempt to reproduce the bug in your app (the debug prints should indicate whether libxml2 reported the document as well-formed/valid, whether XML::LibXML generate some errors, that got suppressed for some reason and why, etc.) Show quoted text
> > Also, can you test with the XML::LibXML version now in SVN?
> > Maybe - but I cannot promise. The project ends Wednesday and with it my > contract ends. After it I might find the time to create a new example to > demonstrate the error (to get a feeling when, take a look between > SQL::Statement 1.20 and the first development releases for 1.21 ^^) and > provide this.
I understand. Anyway, if you do find some time to write some code, it'll be very much appreciated. Show quoted text
> > And finally, in the code you sent you do not need to use push parser at > > all since you feed all data in a single push().
> > The code is stripped down. The original code was more complex - but I'll > take a look if it's now true.
I see. best, -- Petr
Subject: Re: [rt.cpan.org #46946] Documentation of finish_push is different from behaviour
Date: Wed, 30 Sep 2009 15:08:25 +0000
To: bug-XML-LibXML [...] rt.cpan.org
From: Jens Rehsack <rehsack [...] web.de>
Petr Pajas via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=46946 > > > Dne pá 25.zář.2009 11:47:42, rehsack@web.de napsal(a):
>> Petr Pajas via RT wrote:
>>> <URL: https://rt.cpan.org/Ticket/Display.html?id=46946 > >>> >>> Dne po 15.čen.2009 05:33:53, REHSACK napsal(a):
>>>> Hi, >>>> >>>> I run into a problem with XML::LibXML during trying to parse incoming >>>> packets until they're completed (multiplexed channels). There're some >>>> problems - but the one I've found comes from XML::LibXML: >>>> >>>> finish_push doesn't always throws an exception, if an incomplete packet >>>> was "parsed". The parser is always forced to break on incomplete
> packets
>>>> ('$parser->recover(0)'), but sometimes (in attached log in line 31) >>>> under heavy load (one thread) it simply returns undef and throws no >>>> exception. >>>> >>>> Best regards, >>>> Jens >>>> >>>> PS: I can execute provided test-procs, but our code has been modified >>>> meanwhile to simply check for valid doc and ignores any exception -
> that
>>>> works fine.
>>> Hi, >>> >>> thanks for the report. Unfortunatelly, I was not able to reproduce this >>> bug based on the code you have provided. Can you try to create and post >>> a complete self-contained test script that simulates the situation in >>> which you encounter the error?
>> No - this is a problem. It's a closed source project (I already asked
> for it
>> before I opened the report). This happens only under heavy stress (I
> opened
>> a lot of clients to one server and let them all send xml messages). Maybe >> you can reproduce it or simply trust me ;-)
> > I do trust you, of course. The thing is that I looked in the finish_push > but found nothing suspicious, so I wanted to be able to reproduce the > bug in order to debug it.
I looked into the code (I usually try to submit patches with error reports), but it looked good all the way. I try to create a code sniplet which reproduces the problem. Show quoted text
> I was not asking for a real project code, I > just thought you might create something that just simulates the real > process (may be difficult, but it's even harder for me: I don't know the > details of your architecture so I would probably waste hours in vain).
That's why I asked for changing the documentation. What I've seen is: eval { $doc = $xml->finish_push() }; if( defined( $doc ) ) { ... } worked for sure. Show quoted text
> Also, since the implementation of finish_push in LibXML.xs is very > simple, maybe you could try stuffing some debug messages in there and > see what happens if you attempt to reproduce the bug in your app (the > debug prints should indicate whether libxml2 reported the document as > well-formed/valid, whether XML::LibXML generate some errors, that got > suppressed for some reason and why, etc.)
The project finished today (I'm contract worker), so this isn't possible. Show quoted text
>>> Also, can you test with the XML::LibXML version now in SVN?
>> Maybe - but I cannot promise. The project ends Wednesday and with it my >> contract ends. After it I might find the time to create a new example to >> demonstrate the error (to get a feeling when, take a look between >> SQL::Statement 1.20 and the first development releases for 1.21 ^^) and >> provide this.
> > I understand. Anyway, if you do find some time to write some code, it'll > be very much appreciated.
For sure - and as soon as possible, but this could mean several week (my ToDo-list is long :/) Best regards, Jens
Download signature.asc
application/pgp-signature 834b

Message body not shown because it is not plain text.

Closed as REJECTED due to lack of activity and responsiveness on the part of the reporter.