[tlbuild] dvi test?
Richard Koch
koch at uoregon.edu
Mon Jan 31 02:54:28 CET 2022
Folks,
I want to report a failed experiment regarding xdvi. I tried this experiment
based on the following two items in our conversation, which seem particularly
significant:
Paul Vojta wrote:
------------
I see what's happening (or at least part of it).
"When it tries to reread the first page of the dvi file after hitting 'R',
it reads a zero byte (SETCHAR0) instead of the BOP byte. Since a SETCHAR
byte occurs before a FNTNUM command, it doesn't know what font the character
is in, hence the error message.
------------
Then Bruno did a trace showing
----------
../../../texk/xdvik/dvi-init.c:1234: FILES: file_exists_p for |/Users/brunovoisin/Desktop/Temp/TeX/test-dick.dvi|
kdebug:fopen(/Users/brunovoisin/Desktop/Temp/TeX/test-dick.dvi, r) => 0x2125a1150
../../../texk/xdvik/dvi-init.c:1241: FILES: m_dvi_fp for |/Users/brunovoisin/Desktop/Temp/TeX/test-dick.dvi| = 0x2125a1150
../../../texk/xdvik/dvi-init.c:1286: FILES: internal_init_dvi, globals.dvi_file.bak_fp = 0x2125a1280
../../../texk/xdvik/dvi-init.c:779: FILES: process_preamble: fp = 0x2125a1280, errflag = 14
../../../texk/xdvik/dvi-init.c:783: FILES: process_preamble: fp = 0x2125a1280, errflag = 3, returning False
----------
These discoveries suggest that we look at the code in dvi-init.c. Starting at line 1232, we find
a routine "file_exists_p" which produces the first trace entry, and then opens the dvi file, and then
performs some tests. After this routine returns, the routine "process_preamble" is called, and
it reads the incorrect value.
Let us look at the "file_exists_p" code. It writes the first two trace items. Then there is a comment
labeled /* shouldn't happen */ and it does a few tests. If they fail, it closes the file and returns FALSE.
Otherwise it returns TRUE.
So I modified the code so it never performs those tests that shouldn't happen. I did that
by simply adding "return True;" after line 1243.
I don't know how to rebuild just xdvi-xaw, so I rebuilt the entire 2022 tree. Then I moved xdvi-xaw to my
texlive-2021 binaries and tried experiments. You can see that I really don't know what I'm doing, but:
1) My 180 page document with lots of illustrations still worked, and R still worked with it.
2) The very short test from this morning, fixed by ending with "e" rather than "el", still worked, and R worked
and didn't crash anything.
3) HOWEVER: if I changed "e" to "el", then the document IMMEDIATELY CRASHES without even waiting
to type R as soon as xdvi loads it.
Conclusion: One of those /* shouldn't happen */ events is happening
with our test file. I don't know why it doesn't crash the file when it is first loaded.
Someone smarter will have to take over.
Dick Koch
More information about the tlbuild
mailing list.