[tex-live] Mktexpk / Windvi problems

Fabrice Popineau Fabrice.Popineau@supelec.fr
Mon, 27 May 2002 11:33:45 +0200

* Martin Schroeder <ms@artcom-gmbh.de> writes:

> On 2002-05-27 11:00:31 +0200, Fabrice Popineau wrote:
>> I seem to have fixed the problem. More details about this issue in
>> the forthcoming proceedings of TUG2002 ;-)

> I fear that we'll have the proceedings in time for TL8. Could you
> tell us before that? :-)

Ahemm, well, you might be right.

This was a side effect of putting kpathsea hash-tables in shared
memory. The fact is that kpathsea is far from being reentrant. But for
the main usage, all hash-tables (ls-R, cnf variables, aliases) can be
considered constant over a batch of runs : you won't change texmf.cnf
in the middle of tex->mpost->tex . However, sometimes, you need
kludges : if mktexpk is called, you need to call mktexupd, but also to
insert dynamically the new file in the global shared table (the point
of all this is to no reread ls-R files).

Now, when it comes to mktexpk, I wrote it at first as a single program
: if mktexpk need to call mktextfm or mktexmf, it should call the
function doing the job inside, and not issue a system() call. However,
it is also a fact that the interfaces are not clean enough to allow
this in every place. And there comes the real problem. Mktex.c is
using a bunch of variables equivalent to the ones in the mktex shell
scripts, and stores them in a ... hash-table. So if you issue a
system() call, you do not have any more a separate name space for the
'variables' of both mktex processes. So there is a clash. The net
result was a total mixup of the variables, cm files ending up in pl/
subdirectory and so on. 

The fix : differentiate name spaces for variables by suffixing them
with a unique suffix. Only a couple of lines to add to
contrib/variables.c :-)