Subject: | SOAP::Lite goes completely bananas when serialising an exception |
Date: | Fri, 21 Oct 2016 10:19:37 +0100 |
To: | "bug-SOAP-Lite [...] rt.cpan.org" <bug-SOAP-Lite [...] rt.cpan.org> |
From: | Daniel Beardsmore <daniel [...] trustnetworks.co.uk> |
I use my own exception class, which is nothing more than a bog standard blessed hash reference.
If such an exception is raised within make_handle's eval, the code at line 2943 in Lite.pm ultimately leads to some kind of infinite loop/recursion that reached nearly 4 GB in a couple of minutes.
I've amended the code thus, to resolve the crash. $@ is not actually altered, but the serialisation is now given a plain string to pass back, and it avoids the crash.
Modified line 2943 onwards:
# DGB 2016-10-21 Module experiences an excruciating death if it tries to serialise an exception object, so let's not do that
my $stringified = 'Exception: ' . $@;
# died with complex detail
return $self->make_fault($SOAP::Constants::FAULT_SERVER, 'Application error' => $stringified);
I don't know what's happening, but this method is called endlessly, with $_[1] being given alternately and randomly the stringified exception and some other text it's finding somewhere.
sub gen_id { sprintf "%U", $_[1] }