Skip to content
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

Long error message, which writes a full content of variable supposed to be package name. #16826

Open
p5pRT opened this issue Jan 24, 2019 · 8 comments

Comments

@p5pRT
Copy link

p5pRT commented Jan 24, 2019

Migrated from rt.perl.org#133796 (status was 'open')

Searchable as RT133796$

@p5pRT
Copy link
Author

p5pRT commented Jan 24, 2019

From dunedimensia@gmail.com

Created by dunedimensia@gmail.com

Error message can become very long, depending on variable.

perl -le '$_ = "a" x 1e2; print 1; print 2, poa $_'

OUTPUTS​:
1
Can't locate object method "poa" via package "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" (perhaps you forgot to load "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"?) at -e line 1.

Originally I got >1e5 length message, because of mistyping 'pos'. Maybe ellipsis would fit here.

Perl Info

Flags:
    category=core
    severity=none

Site configuration information for perl 5.18.2:

Configured by Debian Project at Tue Mar  1 17:14:30 UTC 2016.

Summary of my perl5 (revision 5 version 18 subversion 2) configuration:
   
  Platform:
    osname=linux, osvers=3.13.0-79-generic, archname=i686-linux-gnu-thread-multi-64int
    uname='linux lgw01-34 3.13.0-79-generic #123-ubuntu smp fri feb 19 14:27:58 utc 2016 i686 i686 i686 gnulinux '


@p5pRT
Copy link
Author

p5pRT commented Jan 25, 2019

From @jkeenan

On 1/24/19 8​:15 AM, Robertas StankeviÄ� (via RT) wrote​:

# New Ticket Created by Robertas Stankevi�
# Please include the string​: [perl #133796]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=133796 >

Error message can become very long, depending on variable.

perl -le '$_ = "a" x 1e2; print 1; print 2, poa $_'

OUTPUTS​:
1
Can't locate object method "poa" via package
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
(perhaps you forgot to load
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"?)
at -e line 1.

Originally I got >1e5 length message, because of mistyping 'pos'. Maybe
ellipsis would fit here.

My 2 cents​: I believe it would be next to impossible to develop a rule
which says one particular error message is too long while another one is
the right length. So I don't believe any change in this area is warranted.

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Jan 25, 2019

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Jan 25, 2019

From @Grinnz

On Fri, 25 Jan 2019 05​:53​:52 -0800, jkeenan@​pobox.com wrote​:

On 1/24/19 8​:15 AM, Robertas StankeviÄ� (via RT) wrote​:

# New Ticket Created by Robertas Stankevi�
# Please include the string​: [perl #133796]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=133796 >

Error message can become very long, depending on variable.

perl -le '$_ = "a" x 1e2; print 1; print 2, poa $_'

OUTPUTS​:
1
Can't locate object method "poa" via package
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
(perhaps you forgot to load
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"?)
at -e line 1.

Originally I got >1e5 length message, because of mistyping 'pos'.
Maybe
ellipsis would fit here.

My 2 cents​: I believe it would be next to impossible to develop a
rule
which says one particular error message is too long while another one
is
the right length. So I don't believe any change in this area is
warranted.

Thank you very much.
Jim Keenan

I believe there is a maximum package name size; since this is trying to interpret it as a package name via indirect syntax, perhaps that would be a sensible limit for the error message?

@p5pRT
Copy link
Author

p5pRT commented Jan 26, 2019

From wagnerc@plebeian.com

Honestly, at this point I would be in favor of removing indirect objects unless you do something like use indirectobjects. After the appropriate warning cycle of course.

Thanks.

@p5pRT
Copy link
Author

p5pRT commented Jan 26, 2019

From @Grinnz

On Fri, 25 Jan 2019 17​:35​:28 -0800, wagnerc@​plebeian.com wrote​:

Honestly, at this point I would be in favor of removing indirect
objects unless you do something like use indirectobjects. After the
appropriate warning cycle of course.

Thanks.

While I agree with the sentiment, that's not relevant to this bug, since the same behavior would occur with direct method syntax.

@richardleach
Copy link
Contributor

Partial notes for implementing something here:

  • The limit for a single identifier seems to be about 256 chars, i.e. the size of PL_tokenbuf: https://github.com/Perl/perl5/blob/blead/parser.h#L111
  • perldiag suggests that might not always be the case. ("Future versions of Perl are likely to eliminate these arbitrary limitations.") Although the tokenbuf char array has been that size since (at least) Perl 5.0.

IDK what the limit - if there is one - on the size of compound names is.

Options seem to be:

  • If there is a limit on compound name sizes, truncate to that, or
  • Check if anything that looks like an identified is too big and truncate it to the size of PL_tokenbuf, or
  • Pick an arbitrary bigish number of chars and just truncate to that.

@richardleach
Copy link
Contributor

Hmm, actually, package A::A::......::A; does also seem to be limited to about 256 chars. Presumably you could build a package name up programatically though, with each piece being <256 chars?

@xenu xenu removed the Severity Low label Dec 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants