[Haskell-cafe] Can't figure out source of race condition when using System.Process

Rafal Kolanski xs at xaph.net
Sun Nov 2 09:02:12 EST 2008


Greetings Gentlemen (and Ladies),

As part of my small and simple framework for making presentations in 
Haskell I have a module which, given some text, makes a .tex file and 
then converts it to .svg for loading into a cairo canvas.
It features simple caching (performs md5 on the contents of the .tex 
file and uses that as the file name... if an .svg by that name exists, 
it'll get loaded rather than regenerated).

Unfortunately, it also segfaults once in a while, probably indicating I 
have some kind of race condition ... but I can't figure out why. This is 
the only point in my code that I think I'm using any concurrency, 
although I'm compiling with ghc --make -threaded. Compiling without 
-threaded results in a deadlock.

Ubuntu 8.10, 64-bit, GHC 6.8.2.

Any advice? I'm attaching the module in question (79 lines).

Sincerely,

Rafal Kolanski.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LatexSVG.hs
Type: text/x-haskell
Size: 2871 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20081103/2a2cdb31/LatexSVG.bin


More information about the Haskell-Cafe mailing list