[NTG-pdftex] [pdftex-Bugs][1242] pdftex opens the .pdf output file with write sharing access

pdftex-bugs at sarovar.org pdftex-bugs at sarovar.org
Fri Jun 6 23:20:09 CEST 2008


Bugs item #1242, was opened at 2008-06-06 13:53
Status: Closed
Priority: 3
Submitted By: William Blum (wblum)
Assigned to: Nobody (None)
Summary: pdftex opens the .pdf output file with write sharing access 
Resolution: Invalid
Group: None
Category: None


Initial Comment:
pdftex v1.40.7 opens the output .pdf file with write sharing access (at least on the Miktex distribution). This is bad for many reasons (and can actually be an indirect cause of file locking problems in some situations).

This means that you can start two instances of pdftex on the same .tex file without getting any error, the writing operations gets interleaved and you end up with a corrupt .pdf.

pdftex should open the file with read sharing access only. If the file is opened using the C++ fstream::open function then this means setting the protection mode to 'filebuf::sh_read' but not to 'filebuf::sh_write'. That way if another instance is running, it will prevent the new instance from writing into the file.

----------------------------------------------------------------------

Comment By: William Blum (wblum)
Date: 2008-06-06 22:20

Message:
> We don't support MikTeX-pdfTeX; please discuss this with the
> MikTeX maintainer.

This bug does not affect only MikTex! I have just tried with teTeX on cygwin and the same problem occurs. I suspect that all TeX distributions suffer from the same bug since there is no reason for them to change the way the files are opened by pdftex. Since all distributions derive from the pdftex code maintained here, I though it would make more sense to patch the bug at the source...



----------------------------------------------------------------------

Comment By: Martin Schröder (oneiros)
Date: 2008-06-06 14:45

Message:
We don't support MikTeX-pdfTeX; please discuss this with the MikTeX maintainer.

----------------------------------------------------------------------

You can respond by visiting: 
http://sarovar.org/tracker/?func=detail&atid=493&aid=1242&group_id=106


More information about the ntg-pdftex mailing list