#1996: Formaline can deadlock -----------------------------------+---------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: new Priority: critical | Milestone: ET_2016_11 Component: EinsteinToolkit thorn | Version: development version Keywords: | -----------------------------------+---------------------------------------- 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.
#1996: Formaline can deadlock ------------------------------------+--------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: review Priority: critical | Milestone: ET_2016_11 Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+--------------------------------------- Changes (by knarf):
* status: new => review
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.
#1996: Formaline can deadlock ------------------------------------+--------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: reviewed_ok Priority: critical | Milestone: ET_2016_11 Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+--------------------------------------- Changes (by knarf):
* status: review => reviewed_ok
#1996: Formaline can deadlock ------------------------------------+--------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: reviewed_ok Priority: critical | Milestone: ET_2016_11 Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+---------------------------------------
Comment (by rhaas):
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).
#1996: Formaline can deadlock ------------------------------------+--------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: reviewed_ok Priority: critical | Milestone: ET_2016_11 Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+---------------------------------------
Comment (by eschnett):
Posix requires {{{/dev/null}}}, and we require Posix for Cactus. Cygwin provides {{{/dev/null}}}.
#1996: Formaline can deadlock ------------------------------------+--------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: reviewed_ok Priority: critical | Milestone: ET_2016_11 Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+---------------------------------------
Comment (by rhaas):
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).
#1996: Formaline can deadlock ------------------------------------+--------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: reviewed_ok Priority: critical | Milestone: ET_2016_11 Component: EinsteinToolkit thorn | Version: development version Resolution: | Keywords: ------------------------------------+---------------------------------------
Comment (by eschnett):
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.
#1996: Formaline can deadlock ------------------------------------+--------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: closed Priority: critical | Milestone: ET_2016_11 Component: EinsteinToolkit thorn | Version: development version Resolution: fixed | Keywords: ------------------------------------+--------------------------------------- Changes (by knarf):
* status: reviewed_ok => closed * resolution: => fixed
trac@lists.einsteintoolkit.org