develooper Front page | perl.perl5.porters | Postings from August 2018

[perl #133228] Storable fails tests with Log::Agent installed

From:
Sawyer X via RT
Date:
August 25, 2018 08:56
Subject:
[perl #133228] Storable fails tests with Log::Agent installed
Message ID:
rt-4.0.24-619-1535187371-1148.133228-15-0@perl.org
On Wed, 30 May 2018 17:25:10 -0700, tonyc wrote:
> On Mon, 28 May 2018 06:27:54 -0700, haarg wrote:
> > Storable rethrows errors from its hooks, STORABLE_freeze,
> > STORABLE_thaw,
> > and STORABLE_attach.  If those errors are refs, they should be
> > preserved
> > in their original form.  Tests were added to ensure this in 06f586d.
> > However, when Log::Agent is installed, Storable uses it rather than
> > just
> > calling Carp::croak.  Log::Agent's logcroak function always
> > stringifies
> > the errors it gets when it throws them.  This causes test failures in
> > many cases when the dual life dist is installed from CPAN.
> >
> > A few CPAN Testers reports from this issue:
> > https://www.cpantesters.org/cpan/report/00761375-6c0c-1014-946e-
> > 8eaf8038f308
> > https://www.cpantesters.org/cpan/report/8e51c42a-4cf5-11e8-b010-
> > a35ca3102b3d
> > https://www.cpantesters.org/cpan/report/c77a5184-4d6f-11e8-9bc9-
> > 021ad4cd031b
> > https://www.cpantesters.org/cpan/report/84c75978-5e44-11e8-bbaf-
> > bdf0d2eb68fb
> >
> > This is a bug in Log::Agent, but since it is long standing behavior
> > in a
> > non-core module, I think it's reasonable to work around it in
> > Storable.
> > The optional use of Log::Agent seems pretty questionable to me in
> > general,
> > but since it has been there for as long as Storable has existed in
> > core
> > it seemed reasonable to leave it in place.
> 
> Removing (or disabling by default) the Log::Agent integration appeals
> to me.
> 
> Perhaps it could be enabled with something like:
> 
> use Storable '-logagent';
> 
> or something similar.
> 
> > The simplest workaround I could think of was to trap the error thrown
> > by
> > Log::Agent, then throw the original arguments given to our logcroak.
> 
> The patch isn't pretty, but I think it's the only fix for this.
> 
> Tony

Patched applied. Resolving.


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=133228



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About