[XeTeX] Low-level diagnostic ("fwrite") generated by XeTeX

Keith J. Schultz keithjschultz at web.de
Wed Feb 3 09:36:21 CET 2010


Am 03.02.2010 um 09:00 schrieb Jonathan Kew:
	[snip, snip]
> At some point (asynchronously), the output driver is ready to begin writing *it's* output (the pdf). That's when the problem is detected, because Acrobat has the file locked. So the driver aborts with a message to stderr ("** ERROR ** Unable to open...."), and terminates. This means xetex no longer has a valid destination (pipe) for its xdv output; the process on the other end of the pipe is gone. So the next time it has a buffer of xdv data ready, and calls fwrite, that fails, and the web2c code (see the WRITE_OUT macro in texmfmp.h) treats this as a fatal error and abruptly terminates xetex.
> 
> Possible solutions: (a) make the WRITE_OUT macro do something friendlier than just calling FATAL_PERROR("fwrite") in the case of an error; or (b) have xetex check that the intended pdf destination is writable as part of its open_dvi_output function, before actually opening the pipe.
> 
> Option (b) is likely to be simpler, and more parallel to the existing behavior of TeX, though it is not 100% robust - but probably good enough.
	One of my suggestion. The other way is to check the integrity of the pipe before you write. Propably, to much
	overkill, since the situtation of a broken pipe would be rarer if the writablity is checked ahead of time.
	But, it would be robust!

	regards
		Keith.


> 
[snip, snip]


More information about the XeTeX mailing list