Formaline can deadlock

Create issue
Issue #1996 closed
Erik Schnetter created an issue

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', $?) && \


        cat /dev/null $(filter-out '$(TARBALL_DIR)/config-Cactus.files', $?) && \

i.e. add a /dev/null there.


Comments (8)

  1. Frank Löffler
    • changed status to open
    • removed 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.

  2. Roland Haas
    • 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).

  3. Erik Schnetter reporter
    • removed comment

    Posix requires /dev/null, and we require Posix for Cactus. Cygwin provides /dev/null.

  4. Roland Haas
    • 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).

  5. Erik Schnetter reporter
    • removed comment

    Yes, we should add it. Posix provides things like mkdir (for output directories), output redirection, M_PI, it ensures that sizeof(char)==1, and probably a few other useful properties as well.

  6. Log in to comment