- changed status to open
- removed comment
Formaline can deadlock
I found that Formaline recently started to deadlock when creating git repositories. The problem was that cat
was called without arguments. This patch corrects the problem:
Change line 382 from
cat $(filter-out '$(TARBALL_DIR)/config-Cactus.files', $?) && \
to
cat /dev/null $(filter-out '$(TARBALL_DIR)/config-Cactus.files', $?) && \
i.e. add a /dev/null
there.
Keyword:
Comments (7)
-
-
- changed status to open
- removed comment
-
- removed comment
The alternative would be to create a zero byte file and at it as an argument to cat just to that there is at least one argument. Or use and $if in make:
$(if $(filter-out $(TARBALL_DIR)/config-Cactus.files,$?), \ cat $(filter-out $(TARBALL_DIR)/config-Cactus.files,$?), \ :) && \
I believe the only OS without /dev/null is likely Windows where the correct name is likely NUL (or /dev/null is cygwin has sufficiently much emulation for this built in or if maybe even the shell does so).
-
reporter - removed comment
Posix requires
/dev/null
, and we require Posix for Cactus. Cygwin provides/dev/null
. -
- removed comment
That is good to know. As far as I know (from grep POSIX in the Cactus docs), we do not actually spell out the requirement for POSIX anywhere. I would be very happy to have this added since in practice we use these features rather than just eg C99 and C++11. Either in Cactus or in the ET (since Formaline is CactusUtils it would have to be in Cactus).
-
reporter - removed comment
Yes, we should add it. Posix provides things like
mkdir
(for output directories), output redirection,M_PI
, it ensures thatsizeof(char)==1
, and probably a few other useful properties as well. -
- changed status to resolved
- removed comment
- Log in to comment
In general I don't like to use OS-specific file names (/dev/null). However, since this would close a critical bug, and since the script uses /dev/null already in a few other places, using it in one more wouldn't make it worse.