gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master dd98a60: Removed extra output option and log i


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master dd98a60: Removed extra output option and log in tests/match/merged-cols.sh
Date: Tue, 5 Jun 2018 09:03:56 -0400 (EDT)

branch: master
commit dd98a6071934ac52045a297e3cf0c3e9c1e340a8
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    Removed extra output option and log in tests/match/merged-cols.sh
    
    The command to test Match's output when mixing the columns of two catalogs
    had one call to `--output' and another to `-o'! The first one had remained
    from the `tests/match/positions.sh' script (that was used as a basis for
    this one): we had forgotten to correct it.
    
    Also, the fact that both calls to Match in the tests used the `--log'
    option caused a crash in Debian's build of Gnuastro 0.6. I had confronted
    this once before on my system, but since I couldn't reproduce it and it
    happened rarely (randomly, only once so far), I had forgot about it.
    
    The problem is that the log file has a single name for any call. So when
    the first call creates it and wants to write to it, but another call then
    deletes it for its own use, we get this crash. So two calls to a progarm
    with `--log' shouldn't be made in the same directory. A notice about this
    important issue is now added in the description of the general `--log'
    option and also in Invoking Match.
    
    This fixes bug #54063.
---
 NEWS                       |  2 +-
 doc/gnuastro.texi          | 19 +++++++++++++++++++
 tests/match/merged-cols.sh |  4 ++--
 3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 9905592..0158d35 100644
--- a/NEWS
+++ b/NEWS
@@ -12,7 +12,7 @@ GNU Astronomy Utilities NEWS                          -*- 
outline -*-
 ** Bug fixes
 
   bug #54057: Building failure due to not finding gsl_interp_steffen.
-
+  bug #54063: Match tests in make check fail randomly.
 
 
 
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index b5c5591..6412382 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -7278,6 +7278,15 @@ file. When this option is called in those programs, the 
log file will also
 be printed. If the program doesn't generate a log file, this option is
 ignored.
 
address@hidden
address@hidden
address@hidden@option{--log} isn't thread-safe}: The log file usually has a 
fixed
+name. Therefore if two simultaneous calls (with @option{--log}) of a
+program are made in the same directory, the program will try to write to
+the same file. This will cause problems like unreasonable log file,
+un-defined behavior, or a crash.
address@hidden cartouche
+
 @cindex CPU threads, set number
 @cindex Number of CPU threads to use
 @item -N INT
@@ -18050,6 +18059,16 @@ below). When @option{--logasoutput} is called, no log 
file (with a fixed
 name) will be created. In this case, the output file (possibly given by the
 @option{--output} option) will have the contents of this log file.
 
address@hidden
address@hidden
address@hidden@option{--log} isn't thread-safe}: As described above, when
address@hidden is not called, the Log file has a fixed name for all
+calls to Match. Therefore if a separate log is requested in two
+simultaneous calls to Match in the same directory, Match will try to write
+to the same file. This will cause problems like unreasonable log file,
+un-defined behavior, or a crash.
address@hidden cartouche
+
 @table @option
 @item -H STR
 @itemx --hdu2=STR
diff --git a/tests/match/merged-cols.sh b/tests/match/merged-cols.sh
index ea1e124..3cc7245 100755
--- a/tests/match/merged-cols.sh
+++ b/tests/match/merged-cols.sh
@@ -49,5 +49,5 @@ if [ ! -f $execname ]; then echo "$execname not created."; 
exit 77; fi
 
 # Actual test script
 # ==================
-$execname $cat1 $cat2 --aperture=0.5 --log --output=match-positions.fits \
-          --outcols=a1,aEFGH,bACCU1,aIJKL,bACCU2 -omatch-merged-cols.txt
+$execname $cat1 $cat2 --aperture=0.5 -omatch-merged-cols.txt \
+          --outcols=a1,aEFGH,bACCU1,aIJKL,bACCU2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]