dwww: cat and file (pipe race condition)
I'm reading my system documentation with dwww. However, with current
potato/woody versions of dwww and file I have trouble for some files
(i.e the web server hangs and reports a timeout)
Examples for "bad" files are
It seems, that the problem only occurs with longer (more than 10000 chars)
files. Looking for the cause of this problem, I found that the line
"$decompress $file | file -b - | magic2mime" in dwww-convert is responsible.
Apparently the $decompress command (which is actually 'cat') is not
finished when file has its job already done. I can find a 'dangling'
cat process with 'ps'. So the pipe is not closed and the system would
wait forever (actually just until the timeout is reached or cat is
I downloaded the source of the file package, but I don't know what
I need to change. How are such pipe problems normally handled?