Import of lbtt 1.1.2

This commit is contained in:
Alexandre Duret-Lutz 2004-08-02 08:59:00 +00:00
parent 894050ed90
commit e4befcecc7
6 changed files with 50 additions and 17 deletions

View file

@ -1,3 +1,29 @@
2004-08-02 Heikki Tauriainen <heikki.tauriainen@hut.fi>
* Version 1.1.2 released.
2004-08-01 Heikki Tauriainen <heikki.tauriainen@hut.fi>
* 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 <heikki.tauriainen@hut.fi>
* 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 <heikki.tauriainen@hut.fi> 2004-07-30 Heikki Tauriainen <heikki.tauriainen@hut.fi>
* Version 1.1.1 released. * Version 1.1.1 released.

View file

@ -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 Copyright (C) 2004 Heikki Tauriainen
Permission is granted to anyone to make or distribute verbatim copies 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 <heikki.tauriainen@hut.fi>. Please send bug reports to <heikki.tauriainen@hut.fi>.
Version 1.1.2
* Another bug fix release that fixes memory access and job control
problems.
Version 1.1.1 Version 1.1.1
* This release includes fixes to build problems with non-GNU * This release includes fixes to build problems with non-GNU

View file

@ -1,4 +1,4 @@
lbtt version 1.1.1 lbtt version 1.1.2
------------------ ------------------
lbtt is a tool for testing programs that translate formulas lbtt is a tool for testing programs that translate formulas

View file

@ -1,8 +1,8 @@
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59]) AC_PREREQ([2.59])
AC_INIT([lbtt], [1.1.1], [heikki.tauriainen@hut.fi]) AC_INIT([lbtt], [1.1.2], [heikki.tauriainen@hut.fi])
AC_REVISION([Revision: 1.5]) AC_REVISION([Revision: 1.6])
AC_CONFIG_SRCDIR([src/main.cc]) AC_CONFIG_SRCDIR([src/main.cc])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
@ -191,7 +191,7 @@ AC_C_INLINE
# Checks for library functions. # Checks for library functions.
AC_CHECK_FUNCS( 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_MSG_ERROR([missing one of the library functions required for compilation])])
AC_CHECK_FUNCS([strsignal isatty getopt_long]) AC_CHECK_FUNCS([strsignal isatty getopt_long])

View file

@ -524,8 +524,8 @@ public:
*/ */
private: private:
const Graph<GraphEdgeContainer>::Edge* edge_1; /* Components of the */ GraphEdgeContainer::const_iterator edge_1; /* Components of the */
const Graph<GraphEdgeContainer>::Edge* edge_2; /* transition. */ GraphEdgeContainer::const_iterator edge_2; /* transition. */
}; };
@ -1598,7 +1598,7 @@ template <class Operations>
inline Product<Operations>::ProductEdge::ProductEdge inline Product<Operations>::ProductEdge::ProductEdge
(const GraphEdgeContainer::const_iterator& e1, (const GraphEdgeContainer::const_iterator& e1,
const GraphEdgeContainer::const_iterator& e2) const GraphEdgeContainer::const_iterator& e2)
: edge_1(*e1), edge_2(*e2) : edge_1(e1), edge_2(e2)
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* *
* Description: Constructor for class Product<Operations>::ProductEdge. * Description: Constructor for class Product<Operations>::ProductEdge.
@ -1643,7 +1643,7 @@ Product<Operations>::ProductEdge::firstComponent() const
* *
* ------------------------------------------------------------------------- */ * ------------------------------------------------------------------------- */
{ {
return *edge_1; return **edge_1;
} }
/* ========================================================================= */ /* ========================================================================= */
@ -1662,7 +1662,7 @@ Product<Operations>::ProductEdge::secondComponent() const
* *
* ------------------------------------------------------------------------- */ * ------------------------------------------------------------------------- */
{ {
return *edge_2; return **edge_2;
} }
/* ========================================================================= */ /* ========================================================================= */
@ -1679,7 +1679,7 @@ Product<Operations>::ProductEdge::targetNode() const
* *
* ------------------------------------------------------------------------- */ * ------------------------------------------------------------------------- */
{ {
return product->stateId(edge_1->targetNode(), edge_2->targetNode()); return product->stateId((*edge_1)->targetNode(), (*edge_2)->targetNode());
} }

View file

@ -938,11 +938,13 @@ void generateBuchiAutomaton
case 0 : /* child */ case 0 : /* child */
close(error_pipe[0]); 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) && dup2(stderr_capture_fileno, STDERR_FILENO) != -1)
execvp(algorithm.parameters[0], algorithm.parameters); 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<const void*>(&errno), write(error_pipe[1], static_cast<const void*>(&errno),
sizeof(int)); sizeof(int));
@ -993,7 +995,7 @@ void generateBuchiAutomaton
for (int attempts_to_terminate = 0; attempts_to_terminate < 4; for (int attempts_to_terminate = 0; attempts_to_terminate < 4;
++attempts_to_terminate) ++attempts_to_terminate)
{ {
kill(pid, sig); kill(-pid, sig);
sleep(delay); sleep(delay);
if (waitpid(pid, &exitcode, WNOHANG) != 0) if (waitpid(pid, &exitcode, WNOHANG) != 0)
{ {
@ -1081,14 +1083,14 @@ void generateBuchiAutomaton
throw Exception("could not terminate child process"); 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; stdout_capture_fileno = stderr_capture_fileno = -1;
ExecFailedException e; ExecFailedException e;
if (configuration.global_options.translator_timeout > 0 && timeout) if (configuration.global_options.translator_timeout > 0 && timeout)
e.changeMessage("Timeout after " + toString(elapsed_time, 2) e.changeMessage("Automaton generation aborted due to timeout.");
+ " seconds (user time).");
else else
e.changeMessage("Execution of `" + string(algorithm.parameters[0]) e.changeMessage("Execution of `" + string(algorithm.parameters[0])
+ "' failed (" + string(strerror(error_number)) + "' failed (" + string(strerror(error_number))