Ticket #1652 (reopened bug)

Opened 5 years ago

Last modified 3 years ago

Line numbers in a particular IMCC stack trace are all wrong

Reported by: moritz Owned by: plobsing
Priority: normal Milestone:
Component: imcc Version: 2.4.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

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

Change History

Changed 5 years ago by moritz

  • summary changed from Line numbers in a particular stack trace are all wrong to Line numbers in a particular IMCC stack trace are all wrong

Changed 5 years ago by plobsing

  • owner set to plobsing

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.

Changed 5 years ago by plobsing

  • status changed from new to closed
  • resolution set to fixed

fixed in r46906.

Changed 5 years ago by plobsing

  • status changed from closed to reopened
  • resolution fixed deleted

closed wrong ticket. plobsing-- plobsing--

Changed 3 years ago by jkeenan

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.

kid51

Note: See TracTickets for help on using tickets.