Congratulations, you have found the bug in TeX.
Edit I did deeper inspection about this issue when I returned from my vacation and I found: the bug is in the C implementation of TeX, not in the TeX itself (coded by D. Knuth). So, the following paragraph (given by me a few days ago) is not explicitly true:
The last revision of TeX (version 3.14159265) was done by D. Knuth in 2014, next revision will be in the end of 2020. If you send this bug-report you can get a check for a small piece in dollars by D. Knuth. Of course, this is true only if your bug report will be processed as real bug of TeX. How to do the bug report is described at here in section Errata.
Description of the bug: If we invoke an error (undefined \
in your example), then the I
option is possible. If we use I
option with a line with next error (undefined \&
in your example) and the I
line is not closed at this place (the V
follows in your example) then this second error offers all options including E
option. But using E
option causes that TeX crashes, because the file name is zero in this case.
In detail: I
option in § 84 of TeX web runs the code from § 87 where the procedure begin_file_reading is processed. This procedure is in § 328 and here is: name := 0
. The name
is macro defined in § 302: name = cur_input.name_field
. Now, we can return to § 84 where the E
option is solved. It creates the file name (which may be sent to an editor) from input_stack[base_ptr].name_field
but this is the same as cur_input.name_field
and it was set to zero. We have no file name here but zero. TeX implementation based on C crashes with segmentation fault because we want to open the file with buggy file name.
Edit: When I did experiments with tex.web
code and I deactivated the system dependent code given after E
option then the correct answer is here: You want to edit file <correct name> at line <correct number>
. The bug is in the lib/texmfmp.c
at line 2579 where the opened files are closed and the maximal index of opened files are read from inopen
global variable. This variable is incremented when I
option is used but no new file is opened in such case. So, we cannot close non-existent file in lib/texmf.c
. Knuth says in §304: "The global variable in_open
is equal to the value of the highest non-token-list level." It means that it is not always the number of currently opened files. Knuth's code and his comments in the code are correct here, bug is in the system dependent implementation.
tex
(not-ini
) you can write\?
instead of\
and\&
. More generally, the segfault happens if you are running TeX on a file, and pressE
in the menu while TeX is scanning the input ofI
. Interesting find!