[Tikzdevice-bugs] Error in createLockFile(lockname) : cannot create lock file

Sharpie chuck at sharpsteen.net
Tue May 24 00:20:05 CEST 2011


On Monday, May 23, 2011 6:51:41 AM UTC-7, Vegard Nossum wrote:
>
> Hi,
>
> I got this error:
>
> > tikz(file="plot.tex")
> > cr.plots(lm(A ~ B, data = C), ask = F)
> Error in createLockFile(lockname) : cannot create lock file
>
> By some googling, I found a similar report (with no replies):
>
> http://r.789695.n4.nabble.com/debug-R-device-plot-tt3403638.html
>
> So what's wrong is that I had earlier aborted cr.plots() by pressing
> ctrl-C, and it appears that somebody didn't clean up the
> tikzMetricDictionary lock file. Moreover, tikzDevice appears to
> proceed to call close(-1) if creating the file fails (strace output):
>
> open("/tmp/Rtmp1HU5cv/tikzMetricsDictionary", O_RDONLY) = 4
> open("/tmp/Rtmp1HU5cv/tikzMetricsDictionary___LOCK",
> O_WRONLY|O_CREAT|O_EXCL, 0666) = -1 EEXIST (File exists)
> close(4294967295)                       = -1 EBADF (Bad file descriptor)
> write(2, "Error in createLockFile(lockname"..., 60) = 60
>
> Removing the ___LOCK file fixed things for me.
>
> Just wanted to let you know. My version of R is 2.10.0 (2009-10-26)
> and my version of tikzDevice is 0.5.3.
>
>
> Vegard
>
A stray lockfile can happen if R is interrupted while the tikzDevice is 
accessing the metrics dictionary which is managed by the filehash package. 
 The operations shown by `strace` are actually happening inside the filehash 
package, not the tikzDevice.  I don't know if adding code that tries to 
automatically clean up the lockfile would be a wise idea as it may 
cause unforeseen side effects, especially in cases where multiple R 
processes are sharing the same metrics file. Having to stop everything and 
remove the lockfile is a pain, but probably less of a pain than having to 
remove a corrupted metrics dictionary.

-Charlie


More information about the Tikzdevice-bugs mailing list