diff --git a/lbtt/ChangeLog b/lbtt/ChangeLog index 56664b92f..1184042b1 100644 --- a/lbtt/ChangeLog +++ b/lbtt/ChangeLog @@ -1,3 +1,29 @@ +2004-08-02 Heikki Tauriainen + + * Version 1.1.2 released. + +2004-08-01 Heikki Tauriainen + + * src/TestOperations.cc (generateBuchiAutomaton): Use + process groups to terminate the child process along with + all of its children (if any) on timeouts. + Do not write the time elapsed before a timeout into the + log file. + + * configure.ac: Add test for the setsid library function. + +2004-07-31 Heikki Tauriainen + + * src/Product.h (ProductEdge::edge_1, ProductEdge::edge_2): + Change type to GraphEdgeContainer::const_iterators to move all + edge dereference operations to member functions instead of the + class constructor (where dereferencing is not always safe). + (ProductEdge::ProductEdge, ProductEdge::firstComponent) + (ProductEdge::secondComponent, ProductEdge::targetNode): + Change member initialization and access accordingly. + + * configure.ac, NEWS, README: Update version. + 2004-07-30 Heikki Tauriainen * Version 1.1.1 released. diff --git a/lbtt/NEWS b/lbtt/NEWS index 0621efd5a..5e168d954 100644 --- a/lbtt/NEWS +++ b/lbtt/NEWS @@ -1,4 +1,4 @@ -lbtt NEWS -- history of user-visible changes. 30 Jul 2004 +lbtt NEWS -- history of user-visible changes. 02 Aug 2004 Copyright (C) 2004 Heikki Tauriainen Permission is granted to anyone to make or distribute verbatim copies @@ -12,6 +12,11 @@ Copyright (C) 2004 Heikki Tauriainen Please send bug reports to . +Version 1.1.2 + +* Another bug fix release that fixes memory access and job control + problems. + Version 1.1.1 * This release includes fixes to build problems with non-GNU diff --git a/lbtt/README b/lbtt/README index 41506e366..f6e9927b6 100644 --- a/lbtt/README +++ b/lbtt/README @@ -1,4 +1,4 @@ -lbtt version 1.1.1 +lbtt version 1.1.2 ------------------ lbtt is a tool for testing programs that translate formulas diff --git a/lbtt/configure.ac b/lbtt/configure.ac index 5c9df77bc..863b97792 100644 --- a/lbtt/configure.ac +++ b/lbtt/configure.ac @@ -1,8 +1,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.59]) -AC_INIT([lbtt], [1.1.1], [heikki.tauriainen@hut.fi]) -AC_REVISION([Revision: 1.5]) +AC_INIT([lbtt], [1.1.2], [heikki.tauriainen@hut.fi]) +AC_REVISION([Revision: 1.6]) AC_CONFIG_SRCDIR([src/main.cc]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE @@ -191,7 +191,7 @@ AC_C_INLINE # Checks for library functions. AC_CHECK_FUNCS( - [strchr strtod strtol strtoul strerror mkdir mkstemp open read write close popen pclose pipe fork execvp getpid waitpid alarm sigaction sigprocmask sigemptyset sigaddset times sysconf], + [strchr strtod strtol strtoul strerror mkdir mkstemp open read write close popen pclose pipe fork execvp setsid getpid waitpid alarm sigaction sigprocmask sigemptyset sigaddset times sysconf], [], [AC_MSG_ERROR([missing one of the library functions required for compilation])]) AC_CHECK_FUNCS([strsignal isatty getopt_long]) diff --git a/lbtt/src/Product.h b/lbtt/src/Product.h index f7b49a677..9a856cadf 100644 --- a/lbtt/src/Product.h +++ b/lbtt/src/Product.h @@ -524,8 +524,8 @@ public: */ private: - const Graph::Edge* edge_1; /* Components of the */ - const Graph::Edge* edge_2; /* transition. */ + GraphEdgeContainer::const_iterator edge_1; /* Components of the */ + GraphEdgeContainer::const_iterator edge_2; /* transition. */ }; @@ -1598,7 +1598,7 @@ template inline Product::ProductEdge::ProductEdge (const GraphEdgeContainer::const_iterator& e1, const GraphEdgeContainer::const_iterator& e2) - : edge_1(*e1), edge_2(*e2) + : edge_1(e1), edge_2(e2) /* ---------------------------------------------------------------------------- * * Description: Constructor for class Product::ProductEdge. @@ -1643,7 +1643,7 @@ Product::ProductEdge::firstComponent() const * * ------------------------------------------------------------------------- */ { - return *edge_1; + return **edge_1; } /* ========================================================================= */ @@ -1662,7 +1662,7 @@ Product::ProductEdge::secondComponent() const * * ------------------------------------------------------------------------- */ { - return *edge_2; + return **edge_2; } /* ========================================================================= */ @@ -1679,7 +1679,7 @@ Product::ProductEdge::targetNode() const * * ------------------------------------------------------------------------- */ { - return product->stateId(edge_1->targetNode(), edge_2->targetNode()); + return product->stateId((*edge_1)->targetNode(), (*edge_2)->targetNode()); } diff --git a/lbtt/src/TestOperations.cc b/lbtt/src/TestOperations.cc index 5389cdbef..8dd515b66 100644 --- a/lbtt/src/TestOperations.cc +++ b/lbtt/src/TestOperations.cc @@ -938,11 +938,13 @@ void generateBuchiAutomaton case 0 : /* child */ close(error_pipe[0]); - if (dup2(stdout_capture_fileno, STDOUT_FILENO) != -1 + if (setsid() != -1 + && dup2(stdout_capture_fileno, STDOUT_FILENO) != -1 && dup2(stderr_capture_fileno, STDERR_FILENO) != -1) execvp(algorithm.parameters[0], algorithm.parameters); - /* dup2 or exec failed: write the value of errno to error_pipe */ + /* setsid, dup2 or exec failed: write the value of errno to + * error_pipe */ write(error_pipe[1], static_cast(&errno), sizeof(int)); @@ -993,7 +995,7 @@ void generateBuchiAutomaton for (int attempts_to_terminate = 0; attempts_to_terminate < 4; ++attempts_to_terminate) { - kill(pid, sig); + kill(-pid, sig); sleep(delay); if (waitpid(pid, &exitcode, WNOHANG) != 0) { @@ -1081,14 +1083,14 @@ void generateBuchiAutomaton throw Exception("could not terminate child process"); } - if (error_number != 0) /* pipe, fork, dup2, execvp or waitpid failed */ + if (error_number != 0) /* pipe, fork, setsid, dup2, execvp or waitpid + * failed */ { stdout_capture_fileno = stderr_capture_fileno = -1; ExecFailedException e; if (configuration.global_options.translator_timeout > 0 && timeout) - e.changeMessage("Timeout after " + toString(elapsed_time, 2) - + " seconds (user time)."); + e.changeMessage("Automaton generation aborted due to timeout."); else e.changeMessage("Execution of `" + string(algorithm.parameters[0]) + "' failed (" + string(strerror(error_number))