New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with Carp::longmess() in 5.17.10 and before #12914
Comments
From @schwernCreated by @schwernCarp::longmess() has a new problem in 5.17.10. If called outside Also longmess() behaves differently from any other Carp function. It's $ cat ~/tmp/test.plx use v5.10; use Carp qw(longmess cluck shortmess carp); say "Outside a subroutine"; sub foo { $ perl5.16.2 ~/tmp/test.plx Inside a subroutine $ perl5.17.10 ~/tmp/test.plx Inside a subroutine Perl Info
|
From @schwernI did a little debugging and discovered the difference between 5.17.10 |
From @iabynOn Mon, Apr 15, 2013 at 01:34:14AM +0100, Michael G. Schwern wrote:
The "uninit var" warnings bisect to: 5bbc4d5 is the first bad commit fix Carp stacktraces after deleting a stash -- |
The RT System itself - Status changed from 'new' to 'open' |
From @schwernOn 4/15/13 1:31 PM, Dave Mitchell via RT wrote:
Thanks, I also found this in the comments... sub longmess { So I guess we're stuck with this behavior. I propose three things. 1) Fix the uninit warning. If we're going to support it, let's support it. |
From @rurbanOn Wed, Apr 17, 2013 at 1:50 PM, Michael G. Schwern <schwern@pobox.com> wrote:
4) longmess should be converted to an op. It's on my todo list since a few years, but got not enough encouragement so far. |
From @rjbsOn Wed Apr 17 11:51:24 2013, schwern wrote:
Does this mean that you believe this is not blocking 5.18.0? I agree that it's icky and it would be Thanks. -- |
From @schwernOn 4/22/13 8:09 PM, Ricardo SIGNES via RT wrote:
I would like to see the warning and top level mistake fixed. That is a $ perl -wle 'use Carp; print Carp::longmess("Foo")' $ perlbrew use perl-5.17.10 $ perl -wle 'use Carp; print Carp::longmess("Foo")' Let me poke at it again now. |
From @rjbs* "Michael G. Schwern" <schwern@pobox.com> [2013-04-23T11:00:07]
Any luck? :) I did some poking and talking, too. You mention the "icky compatibility local $CarpLevel = $CarpLevel + 1; ...for non-Internal callers. Frustratingly, there are no tests for this commit d735c2e Re: Why aren't %Carp::Internal and %Carp::CarpInternal documented? That message is: http://www.nntp.perl.org/group/perl.perl5.porters/2006/10/msg117394.html The actual CarpLevel+1 seems to come from: commit c01c1f0 RE: More verbose POD for Carp p4raw-id: //depot/perl@13426 That message is: http://www.nntp.perl.org/group/perl.perl5.porters/2001/12/msg48132.html There, the intent is clear: a goto is being replaced by a subroutine call, so That said... here is the code as it stands: 1 sub longmess { Removing line 14 seems to solve our woes, possibly breaking things Fine. Anyway, the bare minimum of what we need is: 1) a test for the problem Schwern has reported, suitable for adding to the dist -- |
From @perhunterOn 04/30/2013 11:31 PM, Ricardo Signes wrote:
he is on boston.pm's list and posted recently. do you want me to notify uri |
From @rjbsOn Wed May 01 00:00:45 2013, uri@stemsystems.com wrote:
It certainly couldn't hurt! -- |
From @rjbs* Ricardo Signes <perl.p5p@rjbs.manxome.org> [2013-04-30T23:31:32]
I didn't do either of these, but I did fix the problem without breaking the http://perl5.git.perl.org/perl.git/commitdiff/6b2121fe25c3eebc9ce986961f45c85792a98723?hp=ee901278692902248f7ad3bf72820233b3f9269a -- |
From @rjbsI wrote a test. I feel good about this change, and I think it makes sense, as much as anything in |
From @schwernThanks, I did look at it but couldn't make heads or tails of the code. Does this mean longmess will now produce the same stack trace as FWIW longmess isn't used very often, on a relative scale. Just 250 hits I don't see anything which looks like it's taking advantage of, or even |
From @rjbs* "Michael G. Schwern" <schwern@pobox.com> [2013-05-02T09:25:22]
I *specifically* and *only* addressed the case where it ascended up past the I don't mind looking at fixing the "intentionally off by one" thing, but I'd -- |
From @jkeenanOn Mon May 06 15:18:02 2013, perl.p5p@rjbs.manxome.org wrote:
rjbs: Any further thoughts on this ticket? Thank you very much. |
From @rjbs* James E Keenan via RT <perlbug-followup@perl.org> [2014-08-08T20:31:03]
It seems to me that longmess should do what it is documented to do, and give I am supporting of a well-done mechanism for getting a fast core-provided stack This is a place where we could be breaking a lot of tests. Even though they'd So: the plan sounds like: 1. fix longmess in a branch -- |
From @jkeenanOn Mon Sep 15 15:34:55 2014, perl.p5p@rjbs.manxome.org wrote:
Same message as Carp::<what?> ? In blead, the documentation of 'longmess' comes down to this: ##### Along similar lines, shortmess() is currently documented to return the error message from carp() or croak(). Here's what I get from re-running Schwern's original script against blead (f1126a9): ##### Inside a subroutine rjbs: Can you restate how longmess() should be documented and what it ought to do in the above example? Thank you very much. -- |
From @schwernlongmess() should produce the exact same message as cluck() and confess(), as stated in the documentation here in the SYNOPSIS... $long_message = longmess( "message from cluck() or confess()" ); And here in the first paragraph of the DESCRIPTION... The Carp routines are useful in your own modules because they act like And according to what makes sense for the utility of that function. The attached test should pass. If we decide to leave longmess() as is for historical compatibility reasons, I suggest the new, corrected version be called cluck_message() and shortmess() be called croak_message() to link them directly with their associated functions. I would also recommend aliases for confess_message() and carp_message() to remove one step from the gap of evaluation, when a user wants the message which goes with confess() they do not additionally need to realize that confess() goes with cluck(). |
From @schwernuse Carp qw(longmess cluck confess); my $longmess; sub test_longmess { local $Test::Builder::Level = $Test::Builder::Level + 1; is $longmess, $cluck, "longmess() & cluck()"; note "longmess variations inside a subroutine"; { eval { longmess_variations(); }; test_longmess($longmess, $cluck, $confess); note "longmess variations outside a subroutine"; { eval { test_longmess($longmess, $cluck, $confess); done_testing; |
From @rjbsshortmess/longmess were widely used before their current stint of being documented, which was done for [perl #114280]. FC suggested that we were forgetting something: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=114280#txn-1155408 Presumably this is that thing nobody could remember at the time. longmess and shortmess have always (in my digging) been documented as returning the same things as cluck and carp, either in those terms or by virtue of the same language being used to document each pair. I would rather that we fix longmess and shortmess. Almost certainly, anything that is "broken" by this change is actually being fixed, except for bad test expectations. The question is: how much is that? Where do we stand on doing comparison CPAN smokes? I think our current (or most recent) champion for that is Matthew Horsfall, who is, I believe, on vacation. -- |
From [Unknown Contact. See original ticket]shortmess/longmess were widely used before their current stint of being documented, which was done for [perl #114280]. FC suggested that we were forgetting something: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=114280#txn-1155408 Presumably this is that thing nobody could remember at the time. longmess and shortmess have always (in my digging) been documented as returning the same things as cluck and carp, either in those terms or by virtue of the same language being used to document each pair. I would rather that we fix longmess and shortmess. Almost certainly, anything that is "broken" by this change is actually being fixed, except for bad test expectations. The question is: how much is that? Where do we stand on doing comparison CPAN smokes? I think our current (or most recent) champion for that is Matthew Horsfall, who is, I believe, on vacation. -- |
Migrated from rt.perl.org#117613 (status was 'open')
Searchable as RT117613$
The text was updated successfully, but these errors were encountered: