Skip Menu |

This queue is for tickets about the SOAP-Lite CPAN distribution.

Report information
The Basics
Id: 58538
Status: resolved
Priority: 0/
Queue: SOAP-Lite

People
Owner: Nobody in particular
Requestors: michaelgang [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.712
Fixed in: (no value)



Subject: regression from 0.710.08 soap:Client,Application failed during request deserialization
Hi all, I have a problem when sending an xml on solaris SunOS 5.9 Generic_122300-29 sun4u sparc SUNW,Sun-Fire-V240 and perl v5.10.1 The xml begins with <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:apachens="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><find_services xmlns="SFXMenu/SOAP"> and ends with </find_services></soap:Body></soap:Envelope> In tracing we have SOAP::Transport::new: () SOAP::Serializer::new: () SOAP::Deserializer::new: () SOAP::Parser::new: () SOAP::Server::new: () SOAP::Transport::HTTP::Server::new: () SOAP::Transport::HTTP::CGI::new: () SOAP::Transport::HTTP::Server::handle: SOAP::Server::handle: () SOAP::Deserializer::deserialize: () SOAP::Parser::decode: () SOAP::Serializer::envelope: () SOAP::Serializer::envelope: Client Application failed during request deserialization: no element found at line 1, column 0, byte -1 at XML/Parser.pm line 187 SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Data::new: () SOAP::Transport::HTTP::CGI::DESTROY: () SOAP::Serializer::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Data::DESTROY: () SOAP::Transport::DESTROY: () SOAP::Deserializer::DESTROY: () SOAP::Parser::DESTROY: () With version 7.10.08 we have the lines SOAP::SOM::new: () SOAP::Data::new: () SOAP::Data::DESTROY: () (eval): ARRAY(0xaa8b9f8) 0 sfxtst4 SOAP::Server::handle: ARRAY(0xa9de3e0) which are missing from the new version
From: michaelgang [...] gmail.com
I think I found the problem. In the function SOAP::Transport::HTTP::CGI::handle when changing sysread( STDIN, $buffer, $length ) to read( STDIN, $buffer, $length ) everything works perfect. Interesting why On Sun Jun 20 07:32:03 2010, michaelg wrote: Show quoted text
> Hi all, > > I have a problem when sending an xml on solaris SunOS 5.9 > Generic_122300-29 sun4u sparc SUNW,Sun-Fire-V240 > and perl v5.10.1 > The xml begins with > <?xml version="1.0" encoding="UTF-8"?><soap:Envelope > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" > xmlns:apachens="http://xml.apache.org/xml-soap" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" > soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><find_services Show quoted text
> xmlns="SFXMenu/SOAP"> > and ends with > </find_services></soap:Body></soap:Envelope> > In tracing we have > > SOAP::Transport::new: () > SOAP::Serializer::new: () > SOAP::Deserializer::new: () > SOAP::Parser::new: () > SOAP::Server::new: () > SOAP::Transport::HTTP::Server::new: () > SOAP::Transport::HTTP::CGI::new: () > SOAP::Transport::HTTP::Server::handle: > SOAP::Server::handle: () > SOAP::Deserializer::deserialize: () > SOAP::Parser::decode: () > SOAP::Serializer::envelope: () > SOAP::Serializer::envelope: Client Application failed during request > deserialization: > no element found at line 1, column 0, byte -1 at XML/Parser.pm line > 187 > > SOAP::Data::new: () > SOAP::Data::new: () > SOAP::Data::new: () > SOAP::Data::new: () > SOAP::Data::new: () > SOAP::Data::new: () > SOAP::Data::new: () > SOAP::Transport::HTTP::CGI::DESTROY: () > SOAP::Serializer::DESTROY: () > SOAP::Data::DESTROY: () > SOAP::Data::DESTROY: () > SOAP::Data::DESTROY: () > SOAP::Data::DESTROY: () > SOAP::Data::DESTROY: () > SOAP::Data::DESTROY: () > SOAP::Data::DESTROY: () > SOAP::Transport::DESTROY: () > SOAP::Deserializer::DESTROY: () > SOAP::Parser::DESTROY: () > > With version 7.10.08 we have the lines > SOAP::SOM::new: () > > SOAP::Data::new: () > > SOAP::Data::DESTROY: () > > (eval): ARRAY(0xaa8b9f8) 0 sfxtst4 > > SOAP::Server::handle: ARRAY(0xa9de3e0) > > which are missing from the new version
From: nneul [...] mst.edu
The reason it's a problem is that under mod_perl, STDIN is not a real filehandle - it's mapped to the request object. CORE:: file operations (read/print/etc.) work fine, but sysread specifically tries to treat as a file handle. Please fix this... It makes SOAP::Lite unusable as a server under mod_perl using cgi style code. On Thu Jun 24 07:22:18 2010, michaelg wrote: Show quoted text
> I think I found the problem. > In the function SOAP::Transport::HTTP::CGI::handle when changing > sysread( STDIN, $buffer, $length ) > to read( STDIN, $buffer, $length ) everything works perfect. > Interesting why
This bug breaks Bugzilla's XML-RPC interface, and has been doing so for several months at this point. The fix is to delete three characters from one file. Any chance of getting this fix into the next release of SOAP::Lite?
Subject: Re: [rt.cpan.org #58538] regression from 0.710.08 soap:Client,Application failed during request deserialization
Date: Sun, 05 Sep 2010 17:59:27 +0200
To: bug-SOAP-Lite [...] rt.cpan.org
From: Martin Kutter <martin.kutter [...] fen-net.de>
Hi, it's not just three characters: The change from read() to sysread() was introduced due to another bug report (have to look up the number), which reported read() to be broken under windows (never returns 0 to indicate the request was read completely). So a correct fix would have to determine whether the current program is running under mod_perl (and which version of it) and use the appropriate method for reading input. Best regards, Martin Am Freitag, den 20.08.2010, 17:48 -0400 schrieb Max Kanat-Alexander via RT: Show quoted text
> Queue: SOAP-Lite > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=58538 > > > This bug breaks Bugzilla's XML-RPC interface, and has been doing so for > several months at this point. The fix is to delete three characters from > one file. Any chance of getting this fix into the next release of > SOAP::Lite? >
On Sun Sep 05 11:59:39 2010, martin.kutter@fen-net.de wrote: Show quoted text
> So a correct fix would have to determine whether the current program is > running under mod_perl (and which version of it) and use the
appropriate Show quoted text
> method for reading input.
Okay. So that's perhaps five lines, then. Any hope that somebody will do it?
From: vittal.id [...] aithal.org
Show quoted text
> Okay. So that's perhaps five lines, then. Any hope that somebody will > do it?
Attached is a patch that simply checks for MOD_PERL and if set, uses read, otherwise uses sysread. Works for me. Regards Vittal
Subject: soap-transport-http-mod-perl-patch.txt
--- lib/SOAP/Transport/HTTP.pm.orig 2010-10-05 16:06:05.563710856 +0100 +++ lib/SOAP/Transport/HTTP.pm 2010-10-05 16:09:20.142813758 +0100 @@ -566,9 +566,16 @@ if ( !$chunked ) { my $buffer; binmode(STDIN); - while ( sysread( STDIN, $buffer, $length ) ) { - $content .= $buffer; - last if ( length($content) >= $length ); + if ( defined $ENV{'MOD_PERL'} ) { + while ( read( STDIN, $buffer, $length ) ) { + $content .= $buffer; + last if ( length($content) >= $length ); + } + } else { + while ( sysread( STDIN, $buffer, $length ) ) { + $content .= $buffer; + last if ( length($content) >= $length ); + } } }
Subject: Re: [rt.cpan.org #58538] regression from 0.710.08 soap:Client,Application failed during request deserialization
Date: Wed, 20 Oct 2010 21:02:55 +0200
To: bug-SOAP-Lite [...] rt.cpan.org
From: Martin Kutter <martin.kutter [...] fen-net.de>
Hi, thanks for the patch - which mod_perl versions have you tested with? Unfortunately, there's mod_perl 1.x, mod_perl 2, and due to a infavourable redhat release, mod_perl 1.99. It's not magic though - there's other parts in the code which check for mod_perl (and which mod_perl version there is). Best regards, Martin Am Dienstag, den 05.10.2010, 11:13 -0400 schrieb Vittal Aithal via RT: Show quoted text
> Queue: SOAP-Lite > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=58538 > >
> > Okay. So that's perhaps five lines, then. Any hope that somebody will > > do it?
> > Attached is a patch that simply checks for MOD_PERL and if set, uses > read, otherwise uses sysread. Works for me. > > Regards > Vittal > Einfaches Textdokument-Anlage (soap-transport-http-mod-perl-patch.txt) > --- lib/SOAP/Transport/HTTP.pm.orig 2010-10-05 16:06:05.563710856 +0100 > +++ lib/SOAP/Transport/HTTP.pm 2010-10-05 16:09:20.142813758 +0100 > @@ -566,9 +566,16 @@ > if ( !$chunked ) { > my $buffer; > binmode(STDIN); > - while ( sysread( STDIN, $buffer, $length ) ) { > - $content .= $buffer; > - last if ( length($content) >= $length ); > + if ( defined $ENV{'MOD_PERL'} ) { > + while ( read( STDIN, $buffer, $length ) ) { > + $content .= $buffer; > + last if ( length($content) >= $length ); > + } > + } else { > + while ( sysread( STDIN, $buffer, $length ) ) { > + $content .= $buffer; > + last if ( length($content) >= $length ); > + } > } > } >
The mod_perl version shouldn't make a difference there, they both bind STDIN and STDOUT. Also, there are only two mod_perl APIs, 1 and 2. Early versions of 1.99 have API 1 and later versions have API 2. So just checking for MOD_PERL should be all that's needed.
From: idl0r [...] qasl.de
Is there any progress on this issue?
Applied in SVN in #378. Thanks for reporting, and for the patch. Best regards, MArtin
fixed in >= 0.713