Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 49630
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: mkanat [...] cpan.org
yuri [...] rawbw.com
Cc:
AdminCc:

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



Subject: Chagnes to CGI::Carp in 3.47 break TT and exception handling
CGI::Carp now does this before ever calling realdie, even if we're in an eval: # if $arg is a reference, give it a chance to # be stringified $arg = "$arg" if ref $arg; $arg = join '' => $arg, @rest ; That turns all object exceptions into strings, and re-throws them as strings. This breaks everything that depends on object-based exceptions, including Template Toolkit. (We noticed this because it causes Bugzilla to entirely not function correctly.)
Subject: Re: [rt.cpan.org #49630] Chagnes to CGI::Carp in 3.47 break TT and exception handling
Date: Fri, 11 Sep 2009 12:52:49 -0400
To: bug-CGI.pm [...] rt.cpan.org
From: Mark Stosberg <mark [...] summersault.com>
Show quoted text
> CGI::Carp now does this before ever calling realdie, even if we're in an > eval: > > # if $arg is a reference, give it a chance to > # be stringified > $arg = "$arg" if ref $arg; > > $arg = join '' => $arg, @rest ; > > That turns all object exceptions into strings, and re-throws them as > strings. This breaks everything that depends on object-based exceptions, > including Template Toolkit. (We noticed this because it causes Bugzilla > to entirely not function correctly.)
Thanks for the report. We can see about backing out this change and looking at different approaches for solving the bug which introduced it. Mark
On Fri Sep 11 12:46:11 2009, MKANAT wrote: Show quoted text
> CGI::Carp now does this before ever calling realdie, even if we're in an > eval: > > # if $arg is a reference, give it a chance to > # be stringified > $arg = "$arg" if ref $arg; > > $arg = join '' => $arg, @rest ; > > That turns all object exceptions into strings, and re-throws them as > strings. This breaks everything that depends on object-based exceptions, > including Template Toolkit. (We noticed this because it causes Bugzilla > to entirely not function correctly.)
This is now patched in my github repo now. Thanks for the report. Mark
Subject: Certain latest versions of CGI (CGI-3.47) break Bugzilla-3.4.2
Date: Thu, 24 Sep 2009 19:22:31 -0700
To: bug-CGI.pm [...] rt.cpan.org
From: Yuri <yuri [...] rawbw.com>
Bugzilla's submit bug script produces a message: file error - undef error - undef error - file error - undef error - undef error - file error - undef error - return error - at lib/x86_64- linux-thread-multi/Template/Context.pm line 508. See this discussion for example: http://groups.google.com/group/mozilla.support.bugzilla/browse_thread/thread/9fbce9eecac6d8de/0c7d1dd8a7ec9341?lnk=raot Yuri
RT-Send-CC: lds [...] cpan.org
Lincoln, I recommend we make a new release to address this regression which affected Template Toolkit and Bugzilla. A patch for this is already in github, and linked from this ticket history. I think the general state of github is safe for a new release. The potential modifications relating to PSGI are intentionally on a different branch. Mark
Fix now released in 3.48.
Could you test an alternate fix to this for us in combination with Bugzilla? http://github.com/markstos/CGI.pm/raw/master/lib/CGI/Carp.pm We'd like to confirm the new approach works *before* the next release, rather than afterwards. The goal continue to handle the Bugzilla cases appropriately, as well as some addressing some related bugs. It was attempt to fix another problem which is what triggered the regression. The proposed fix should ideally cover both cases. Mark
On Sat Oct 03 20:17:17 2009, MARKSTOS wrote: Show quoted text
> Could you test an alternate fix to this for us in combination with > Bugzilla? > > http://github.com/markstos/CGI.pm/raw/master/lib/CGI/Carp.pm > [snip]
Hey Mark! Thanks for thinking of us! :-) Yes, it definitely works. Just as a question, though--why not put the ineval() bit right after the DIE_HANDLER and just pass it ($arg, @rest)? Seems like that would be the most reliable way to make sure that you don't break apps that rely on any eval-related behavior of standard die().
RT-Send-CC: yanick
Yanick, Could you address this feedback? Mark On Sat Oct 03 20:33:01 2009, MKANAT wrote: Show quoted text
> On Sat Oct 03 20:17:17 2009, MARKSTOS wrote:
> > Could you test an alternate fix to this for us in combination with > > Bugzilla? > > > > http://github.com/markstos/CGI.pm/raw/master/lib/CGI/Carp.pm > > [snip]
> > Hey Mark! Thanks for thinking of us! :-) > > Yes, it definitely works. > > Just as a question, though--why not put the ineval() bit right after > the DIE_HANDLER and just pass it ($arg, @rest)? Seems like that would be > the most reliable way to make sure that you don't break apps that rely > on any eval-related behavior of standard die().
Subject: Re: [rt.cpan.org #49630] Changes to CGI::Carp in 3.47 break TT and exception handling (Breaks BugZilla)
Date: Sun, 04 Oct 2009 12:10:44 -0400
To: bug-CGI.pm [...] rt.cpan.org
From: Yanick Champoux <yanick [...] babyl.dyndns.org>
MARKSTOS via RT wrote: Show quoted text
> Yanick, > > Could you address this feedback?
With great pleasure. :-) Show quoted text
>> Just as a question, though--why not put the ineval() bit right after >> the DIE_HANDLER and just pass it ($arg, @rest)? Seems like that would be >> the most reliable way to make sure that you don't break apps that rely >> on any eval-related behavior of standard die().
If I understand your suggestion correctly, you're proposing to do something akin to sub die { my ($arg,@rest) = @_; &$DIE_HANDLER($arg,@rest) if $DIE_HANDLER; realdie $arg, @rest if ineval(); # and then the other stuff... The problem with that is that if you do eval { CGI::Carp::die( "I died" ) } You'll get I died at CGI/Carp.pm line 354. instead of I died at your/program.cgi line 123. All the gymnastic before the call to 'realdie' is to ensure that the call to CGI::Carp::die will be transparent and magically yield the same useful information than the real 'die'. Makes sense? :-) Joy, `/anick
On Sun Oct 04 12:08:04 2009, yanick@babyl.dyndns.org wrote: Show quoted text
> [snip] > Makes sense? :-)
Ah yeah, makes total sense. :-) Thanks for the explanation!
Subject: Re: [rt.cpan.org #49630] Changes to CGI::Carp in 3.47 break TT and exception handling (Breaks BugZilla)
Date: Sun, 04 Oct 2009 17:03:17 -0400
To: bug-CGI.pm [...] rt.cpan.org
From: Yanick Champoux <yanick [...] babyl.dyndns.org>
Max Kanat-Alexander via RT wrote: Show quoted text
> On Sun Oct 04 12:08:04 2009, yanick@babyl.dyndns.org wrote:
>> [snip] >> Makes sense? :-)
> > Ah yeah, makes total sense. :-) Thanks for the explanation!
My pleasure. And thanks for the feedback and the suggestion! Joy, `/anick
This was resolved some time ago. It just needed to be closed.