Line numbers in a particular IMCC stack trace are all wrong #473

moritz opened this Issue May 21, 2010 · 4 comments


None yet

4 participants


To reproduce:

please check out commit 93b60203b806a0303f8f7981469102ea90ce5b54 of Rakudo, configure rakudo with r46819 of parrot, and then run 'make'

$ make
/home/moritz/rakudo/parrot_install/bin/parrot  -o src/gen/perl6.pbc src/Perl6/Compiler.pir
error:imcc:syntax error, unexpected DOT, expecting $end ('.')
        in file 'src/builtins/EnumMap.pir' line 92
        included from 'src/gen/builtins.pir' line 92
        included from 'src/Perl6/Compiler.pir' line 1
error:imcc:syntax error ... somewhere
        in file 'src/builtins/EnumMap.pir' line 92
        included from 'src/gen/builtins.pir' line 92
        included from 'src/Perl6/Compiler.pir' line 1
make: *** [src/gen/perl6.pbc] Error 1

Files EnumMap.pir and bulitins.pir are 36 and 59 lines long, respectively, and line 1 in src/Perl6/Compiler.pir is a comment. So all these line numbers in the backtrace have no obvious connection to reality



There are (at least) 2 things going wrong here:

  • line numbers are not being updated properly
  • the frame stack is getting confused somewhere

The line number updating is wonky in general because it expects to update on "{WS}" (and a couple other places as a kludge). Lex attempts to match the *longest token at the current location. When there is non-whitespace at the beginning of the line, the beginning of line rule will be zero-width and won't get executed. The correct handling of this would be to update the line numbers at EOL, which is guarranteed non-zero width. A workaround for the time being is to indent all code (except heredocs).

When I indent sections near the include points, I get:

error:imcc:syntax error, unexpected DOT, expecting $end ('.')
in file 'src/builtins/EnumMap.pir' line 30
included from 'src/gen/builtins.pir' line 98
included from 'src/Perl6/Compiler.pir' line 1

The line numbers are correct, but associated with the wrong files. I am still investigating this frame stack corruption.


fixed in r46906.


closed wrong ticket. plobsing-- plobsing--


I note from widespread cursing on #parrot that line numbers in IMCC are still borked.

Do we have any more insight into the particular issues raised in this ticket?

Thank you very much.


@Whiteknight Whiteknight was assigned May 9, 2012
@Whiteknight Whiteknight removed their assignment Mar 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment