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

Not all error messages should include a stack trace #153

Closed
p6rt opened this issue Jul 4, 2008 · 12 comments
Closed

Not all error messages should include a stack trace #153

p6rt opened this issue Jul 4, 2008 · 12 comments

Comments

@p6rt
Copy link

p6rt commented Jul 4, 2008

Migrated from rt.perl.org#56604 (status was 'resolved')

Searchable as RT56604$

@p6rt
Copy link
Author

p6rt commented Jul 4, 2008

From @moritz

Error messages caused by programmer's mistakes shouldn't include stack
traces.

Rakudo r29047​:
../../parrot perl6.pbc -e 'my Int $x; $x = "str"'
Type check failed
current instr.​: 'parrot;Perl6Object;infix​:=' pc 59 (src/gen_builtins.pir​:52)
called from Sub '_block11' pc 93 (EVAL_12​:42)
called from Sub 'parrot;PCT​::HLLCompiler;eval' pc 806
(src/PCT/HLLCompiler.pir​:481)
called from Sub 'parrot;PCT​::HLLCompiler;command_line' pc 1305
(src/PCT/HLLCompiler.pir​:708)
called from Sub 'parrot;Perl6​::Compiler;main' pc 13152 (perl6.pir​:174)

IMHO the stack trace is mostly unnecessary line noise, and shouldn't be
visible to the programmer, since it obscures the real error message
(which could be improved ;-)

Typical examples of error messages are "Type check failed", parse
errors, 'Could not find non-existent sub' and 'Method 'foo' not found
for invocant of class 'Int''.

It might be a bit too early for this change because atm most users are
compiler writers at the same time, but when others start to use it on a
regular basis we should do our best not to confuse them.

Cheers,
Moritz

--
Moritz Lenz
http://moritz.faui2k3.org/ | http://perl-6.de/

@p6rt
Copy link
Author

p6rt commented Oct 20, 2008

From gp@zimt.uni-siegen.de

Hello!

There is a problem with the function "die" in Rakudo.

I tried the function "die" under Windows and Linux. Under both OS it
don't work.

Gerd Pokorra

[gz016@​pgerd parrot]$ ./parrot languages/perl6/perl6.pbc -e die
Died

current instr.​: 'die' pc 13123 (src/gen_builtins.pir​:8122)
called from Sub '_block11' pc 17 (EVAL_12​:11)
called from Sub 'parrot;PCT;HLLCompiler;eval' pc 851
(src/PCT/HLLCompiler.pir​:494)
called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1342
(src/PCT/HLLCompiler.pir​:721)
called from Sub 'parrot;Perl6;Compiler;main' pc 17106 (perl6.pir​:179)
[gz016@​pgerd parrot]$
[gz016@​pgerd parrot]$
[gz016@​pgerd parrot]$ svn info
Pfad​: .
URL​: http://svn.perl.org/parrot/trunk
Basis des Projektarchivs​: http://svn.perl.org/parrot
UUID des Projektarchivs​: d31e2699-5ff4-0310-a27c-f18f2fbe73fe
Revision​: 31923
Knotentyp​: Verzeichnis
Plan​: normal
Letzter Autor​: bernhard
Letzte geänderte Rev​: 31923
Letztes Änderungsdatum​: 2008-10-13 12​:45​:09 +0200 (Mo, 13 Okt 2008)

[gz016@​pgerd parrot]$

@p6rt
Copy link
Author

p6rt commented Oct 20, 2008

From @masak

pgerd (>)​:

There is a problem with the function "die" in Rakudo.

[...]

[gz016@​pgerd parrot]$ ./parrot languages/perl6/perl6.pbc -e die
Died

current instr.​: 'die' pc 13123 (src/gen_builtins.pir​:8122)
[...]

Looks perfectly normal to me. Are you concerned because you got a
stacktrace, and aren't used to getting one with Perl 5?

@p6rt
Copy link
Author

p6rt commented Oct 20, 2008

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

@p6rt
Copy link
Author

p6rt commented Oct 21, 2008

From gp@zimt.uni-siegen.de

Looks perfectly normal to me. Are you concerned because you got a
stacktrace, and aren't used to getting one with Perl 5?

Yes, that is the reason why I am concerned. To see a stacktrace is not
what I am expecting by using the "die" function.

Gerd Pokorra

@p6rt
Copy link
Author

p6rt commented May 15, 2009

From @jnthn

On Fri Jul 04 01​:39​:12 2008, moritz@​casella.verplant.org wrote​:

Error messages caused by programmer's mistakes shouldn't include stack
traces.

Rakudo r29047​:
../../parrot perl6.pbc -e 'my Int $x; $x = "str"'
Type check failed
current instr.​: 'parrot;Perl6Object;infix​:=' pc 59
(src/gen_builtins.pir​:52)
called from Sub '_block11' pc 93 (EVAL_12​:42)
called from Sub 'parrot;PCT​::HLLCompiler;eval' pc 806
(src/PCT/HLLCompiler.pir​:481)
called from Sub 'parrot;PCT​::HLLCompiler;command_line' pc 1305
(src/PCT/HLLCompiler.pir​:708)
called from Sub 'parrot;Perl6​::Compiler;main' pc 13152 (perl6.pir​:174)

IMHO the stack trace is mostly unnecessary line noise, and shouldn't be
visible to the programmer, since it obscures the real error message
(which could be improved ;-)

All stack trace into the compiler guts is now not shown at all now, and
that which is shown is at the sub/method level rather than exposing the
lexical scopes, and only has HLL line and file numbers in. In this
example the output is now just​:

Type mismatch in assignment; expected something matching type Int but
got something of type Str()
in Main (<unknown>​:1)

Thanks,

Jonathan

@p6rt
Copy link
Author

p6rt commented May 15, 2009

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

@p6rt
Copy link
Author

p6rt commented May 15, 2009

@jnthn - Status changed from 'open' to 'resolved'

@p6rt
Copy link
Author

p6rt commented Mar 29, 2010

From @masak

<masak> I'd just like to report that the stacktraces in Rakudo are back
to being insanely long.
<masak> I think they're even longer than when people were
complaining about them being far too long last time, and someone fixed
it.
<moritz_> and are also back to be totally useless
<masak> yes.
* masak submits rakudobug

Here's an example​:

$ perl6 lib/November/CGI.pm
Unable to parse blockoid, couldn't find final '}' at line 8
current instr.​: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:907)
called from Sub 'perl6;Perl6;Grammar;blockoid' pc 53135
(src/gen/perl6-grammar.pir​:4334)
called from Sub 'perl6;Perl6;Grammar;pblock' pc 51952 (src/gen/perl6-
grammar.pir​:4002)
called from Sub 'perl6;Perl6;Grammar;circumfix​:sym<{ }>' pc 132791
(src/gen/perl6-grammar.pir​:24155)
called from Sub 'perl6;Regex;Cursor;!protoregex' pc 1752 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:971)
called from Sub 'perl6;HLL;Grammar;circumfix' pc 2899 (ext/nqp-
rx/src/stage0/HLL-s0.pir​:1190)
called from Sub 'perl6;HLL;Grammar;term​:sym<circumfix>' pc 2967
(ext/nqp-rx/src/stage0/HLL-s0.pir​:1219)
called from Sub 'perl6;Regex;Cursor;!protoregex' pc 1752 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:971)
called from Sub 'perl6;Perl6;Grammar;term' pc 114072 (src/gen/perl6-
grammar.pir​:19605)
called from Sub 'perl6;HLL;Grammar;termish' pc 2350 (ext/nqp-
rx/src/stage0/HLL-s0.pir​:1040)
called from Sub 'perl6;HLL;Grammar;EXPR' pc 1016 (ext/nqp-
rx/src/stage0/HLL-s0.pir​:552)
called from Sub 'perl6;Perl6;Grammar;EXPR' pc 133525 (src/gen/perl6-
grammar.pir​:24358)
called from Sub 'perl6;Perl6;Grammar;statement' pc 50235
(src/gen/perl6-grammar.pir​:3481)
called from Sub 'perl6;Perl6;Grammar;statementlist' pc 49266
(src/gen/perl6-grammar.pir​:3185)
called from Sub 'perl6;Perl6;Grammar;blockoid' pc 53135
(src/gen/perl6-grammar.pir​:4334)
called from Sub 'perl6;Perl6;Grammar;block' pc 52782 (src/gen/perl6-
grammar.pir​:4241)
called from Sub 'perl6;HLL;Grammar;LANG' pc 1761 (ext/nqp-
rx/src/stage0/HLL-s0.pir​:825)
called from Sub 'perl6;Perl6;Regex;codeblock' pc 180845
(src/gen/perl6-grammar.pir​:36478)
called from Sub 'perl6;Perl6;Regex;assertion​:sym<{ }>' pc 180597
(src/gen/perl6-grammar.pir​:36427)
called from Sub 'perl6;Regex;Cursor;!protoregex' pc 1752 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:971)
called from Sub 'perl6;Regex;P6Regex;Grammar;assertion' pc 18818
(ext/nqp-rx/src/stage0/P6Regex-s0.pir​:5090)
called from Sub 'perl6;Regex;P6Regex;Grammar;assertion​:sym<?>' pc
18852 (ext/nqp-rx/src/stage0/P6Regex-s0.pir​:5095)
called from Sub 'perl6;Regex;Cursor;!protoregex' pc 1752 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:971)
called from Sub 'perl6;Regex;P6Regex;Grammar;assertion' pc 18818
(ext/nqp-rx/src/stage0/P6Regex-s0.pir​:5090)
called from Sub 'perl6;Regex;P6Regex;Grammar;metachar​:sym<assert>'
pc 12629 (ext/nqp-rx/src/stage0/P6Regex-s0.pir​:3448)
called from Sub 'perl6;Regex;Cursor;!protoregex' pc 1752 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:971)
called from Sub 'perl6;Regex;P6Regex;Grammar;metachar' pc 6975
(ext/nqp-rx/src/stage0/P6Regex-s0.pir​:1914)
called from Sub 'perl6;Regex;P6Regex;Grammar;atom' pc 4066
(ext/nqp-rx/src/stage0/P6Regex-s0.pir​:1144)
called from Sub 'perl6;Regex;P6Regex;Grammar;quantified_atom' pc
3406 (ext/nqp-rx/src/stage0/P6Regex-s0.pir​:993)
called from Sub 'perl6;Regex;P6Regex;Grammar;termish' pc 3133
(ext/nqp-rx/src/stage0/P6Regex-s0.pir​:921)
called from Sub 'perl6;Regex;P6Regex;Grammar;nibbler' pc 2481
(ext/nqp-rx/src/stage0/P6Regex-s0.pir​:749)
called from Sub 'perl6;HLL;Grammar;LANG' pc 1761 (ext/nqp-
rx/src/stage0/HLL-s0.pir​:825)
called from Sub 'perl6;Perl6;Grammar;regex_def' pc 106800
(src/gen/perl6-grammar.pir​:17851)
called from Sub 'perl6;Perl6;Grammar;regex_declarator​:sym<token>' pc
106056 (src/gen/perl6-grammar.pir​:17644)
called from Sub 'perl6;Regex;Cursor;!protoregex' pc 1752 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:971)
called from Sub 'perl6;Perl6;Grammar;regex_declarator' pc 105650
(src/gen/perl6-grammar.pir​:0)
called from Sub 'perl6;Perl6;Grammar;term​:sym<regex_declarator>' pc
74051 (src/gen/perl6-grammar.pir​:9637)
called from Sub 'perl6;Regex;Cursor;!protoregex' pc 1752 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:971)
called from Sub 'perl6;Perl6;Grammar;term' pc 114072 (src/gen/perl6-
grammar.pir​:19605)
called from Sub 'perl6;HLL;Grammar;termish' pc 2350 (ext/nqp-
rx/src/stage0/HLL-s0.pir​:1040)
called from Sub 'perl6;HLL;Grammar;EXPR' pc 1016 (ext/nqp-
rx/src/stage0/HLL-s0.pir​:552)
called from Sub 'perl6;Perl6;Grammar;EXPR' pc 133525 (src/gen/perl6-
grammar.pir​:24358)
called from Sub 'perl6;Perl6;Grammar;statement' pc 50235
(src/gen/perl6-grammar.pir​:3481)
called from Sub 'perl6;Perl6;Grammar;statementlist' pc 49266
(src/gen/perl6-grammar.pir​:3185)
called from Sub 'perl6;Perl6;Grammar;blockoid' pc 53135
(src/gen/perl6-grammar.pir​:4334)
called from Sub 'perl6;Perl6;Grammar;block' pc 52782 (src/gen/perl6-
grammar.pir​:4241)
called from Sub 'perl6;Perl6;Grammar;package_def' pc 84827
(src/gen/perl6-grammar.pir​:12454)
called from Sub
'perl6;Perl6;Grammar;package_declarator​:sym<grammar>' pc 83748
(src/gen/perl6-grammar.pir​:12156)
called from Sub 'perl6;Regex;Cursor;!protoregex' pc 1752 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:971)
called from Sub 'perl6;Perl6;Grammar;package_declarator' pc 82655
(src/gen/perl6-grammar.pir​:11899)
called from Sub 'perl6;Perl6;Grammar;term​:sym<package_declarator>'
pc 72811 (src/gen/perl6-grammar.pir​:9311)
called from Sub 'perl6;Regex;Cursor;!protoregex' pc 1752 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:971)
called from Sub 'perl6;Perl6;Grammar;term' pc 114072 (src/gen/perl6-
grammar.pir​:19605)
called from Sub 'perl6;HLL;Grammar;termish' pc 2350 (ext/nqp-
rx/src/stage0/HLL-s0.pir​:1040)
called from Sub 'perl6;HLL;Grammar;EXPR' pc 1016 (ext/nqp-
rx/src/stage0/HLL-s0.pir​:552)
called from Sub 'perl6;Perl6;Grammar;EXPR' pc 133525 (src/gen/perl6-
grammar.pir​:24358)
called from Sub 'perl6;Perl6;Grammar;statement' pc 50235
(src/gen/perl6-grammar.pir​:3481)
called from Sub 'perl6;Perl6;Grammar;statementlist' pc 49266
(src/gen/perl6-grammar.pir​:3185)
called from Sub 'perl6;Perl6;Grammar;comp_unit' pc 48710
(src/gen/perl6-grammar.pir​:3014)
called from Sub 'perl6;Perl6;Grammar;TOP' pc 38552
(src/gen/loader_pm.pir​:473)
called from Sub 'perl6;Regex;Cursor;parse' pc 282 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:181)
called from Sub 'perl6;HLL;Compiler;parse' pc 5 (ext/nqp-
rx/src/stage0/HLL-s0.pir​:24)
called from Sub 'perl6;PCT;HLLCompiler;compile' pc 403
(compilers/pct/src/PCT/HLLCompiler.pir​:294)
called from Sub 'perl6;Perl6;Module;Loader;_block119' pc 35081
(src/gen/locator_pm.pir​:168)
called from Sub 'perl6;Perl6;Module;Loader;_block90' pc 34921
(src/gen/locator_pm.pir​:107)
called from Sub 'perl6;Perl6;Module;Loader;need' pc 34433
(src/gen/role_pm.pir​:845)
called from Sub 'perl6;Perl6;Actions;need' pc 184680 (src/gen/perl6-
grammar.pir​:37571)
called from Sub 'perl6;Perl6;Actions;statement_control​:sym<use>' pc
199422 (src/gen/perl6-actions.pir​:2058)
called from Sub 'perl6;Regex;Cursor;!reduce' pc 975 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:624)
called from Sub 'perl6;Regex;Cursor;!cursor_pass' pc 541 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:340)
called from Sub 'perl6;Perl6;Grammar;statement_control​:sym<use>' pc
64724 (src/gen/perl6-grammar.pir​:7401)
called from Sub 'perl6;Regex;Cursor;!protoregex' pc 1752 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:971)
called from Sub 'perl6;Perl6;Grammar;statement_control' pc 56753
(src/gen/perl6-grammar.pir​:5259)
called from Sub 'perl6;Perl6;Grammar;statement' pc 50235
(src/gen/perl6-grammar.pir​:3481)
called from Sub 'perl6;Perl6;Grammar;statementlist' pc 49266
(src/gen/perl6-grammar.pir​:3185)
called from Sub 'perl6;Perl6;Grammar;package_def' pc 84827
(src/gen/perl6-grammar.pir​:12454)
called from Sub 'perl6;Perl6;Grammar;package_declarator​:sym<class>'
pc 83395 (src/gen/perl6-grammar.pir​:12068)
called from Sub 'perl6;Regex;Cursor;!protoregex' pc 1752 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:971)
called from Sub 'perl6;Perl6;Grammar;package_declarator' pc 82655
(src/gen/perl6-grammar.pir​:11899)
called from Sub 'perl6;Perl6;Grammar;term​:sym<package_declarator>'
pc 72811 (src/gen/perl6-grammar.pir​:9311)
called from Sub 'perl6;Regex;Cursor;!protoregex' pc 1752 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:971)
called from Sub 'perl6;Perl6;Grammar;term' pc 114072 (src/gen/perl6-
grammar.pir​:19605)
called from Sub 'perl6;HLL;Grammar;termish' pc 2350 (ext/nqp-
rx/src/stage0/HLL-s0.pir​:1040)
called from Sub 'perl6;HLL;Grammar;EXPR' pc 1016 (ext/nqp-
rx/src/stage0/HLL-s0.pir​:552)
called from Sub 'perl6;Perl6;Grammar;EXPR' pc 133525 (src/gen/perl6-
grammar.pir​:24358)
called from Sub 'perl6;Perl6;Grammar;statement' pc 50235
(src/gen/perl6-grammar.pir​:3481)
called from Sub 'perl6;Perl6;Grammar;statementlist' pc 49266
(src/gen/perl6-grammar.pir​:3185)
called from Sub 'perl6;Perl6;Grammar;comp_unit' pc 48710
(src/gen/perl6-grammar.pir​:3014)
called from Sub 'perl6;Perl6;Grammar;TOP' pc 38552
(src/gen/loader_pm.pir​:473)
called from Sub 'perl6;Regex;Cursor;parse' pc 282 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:181)
called from Sub 'perl6;HLL;Compiler;parse' pc 5 (ext/nqp-
rx/src/stage0/HLL-s0.pir​:24)
called from Sub 'perl6;PCT;HLLCompiler;compile' pc 403
(compilers/pct/src/PCT/HLLCompiler.pir​:294)
called from Sub 'perl6;Perl6;Module;Loader;_block119' pc 35081
(src/gen/locator_pm.pir​:168)
called from Sub 'perl6;Perl6;Module;Loader;_block90' pc 34921
(src/gen/locator_pm.pir​:107)
called from Sub 'perl6;Perl6;Module;Loader;need' pc 34433
(src/gen/role_pm.pir​:845)
called from Sub 'perl6;Perl6;Actions;need' pc 184680 (src/gen/perl6-
grammar.pir​:37571)
called from Sub 'perl6;Perl6;Actions;statement_control​:sym<use>' pc
199422 (src/gen/perl6-actions.pir​:2058)
called from Sub 'perl6;Regex;Cursor;!reduce' pc 975 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:624)
called from Sub 'perl6;Regex;Cursor;!cursor_pass' pc 541 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:340)
called from Sub 'perl6;Perl6;Grammar;statement_control​:sym<use>' pc
64724 (src/gen/perl6-grammar.pir​:7401)
called from Sub 'perl6;Regex;Cursor;!protoregex' pc 1752 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:971)
called from Sub 'perl6;Perl6;Grammar;statement_control' pc 56753
(src/gen/perl6-grammar.pir​:5259)
called from Sub 'perl6;Perl6;Grammar;statement' pc 50235
(src/gen/perl6-grammar.pir​:3481)
called from Sub 'perl6;Perl6;Grammar;statementlist' pc 49266
(src/gen/perl6-grammar.pir​:3185)
called from Sub 'perl6;Perl6;Grammar;comp_unit' pc 48710
(src/gen/perl6-grammar.pir​:3014)
called from Sub 'perl6;Perl6;Grammar;TOP' pc 38552
(src/gen/loader_pm.pir​:473)
called from Sub 'perl6;Regex;Cursor;parse' pc 282 (ext/nqp-
rx/src/stage0/Regex-s0.pir​:181)
called from Sub 'perl6;HLL;Compiler;parse' pc -1 ((unknown file)​:-1)
called from Sub 'perl6;PCT;HLLCompiler;compile' pc 403
(compilers/pct/src/PCT/HLLCompiler.pir​:294)
called from Sub 'perl6;PCT;HLLCompiler;eval' pc 1007
(compilers/pct/src/PCT/HLLCompiler.pir​:563)
called from Sub 'perl6;PCT;HLLCompiler;evalfiles' pc 1318
(compilers/pct/src/PCT/HLLCompiler.pir​:714)
called from Sub 'perl6;PCT;HLLCompiler;command_line' pc 1504
(compilers/pct/src/PCT/HLLCompiler.pir​:801)
called from Sub 'perl6;Perl6;Compiler;main' pc -1 ((unknown file)​:-1)

That's a record in insanity. :(

@p6rt
Copy link
Author

p6rt commented Mar 29, 2010

@masak - Status changed from 'resolved' to 'open'

@p6rt
Copy link
Author

p6rt commented May 31, 2010

From @moritz

We now have nice, Perl 6-level-only backtraces in Rakudo, so I'm closing
this ticket again.

@p6rt
Copy link
Author

p6rt commented May 31, 2010

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed May 31, 2010
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

1 participant