ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 51917] New: Race condition in PumpStreamHandler causes incorrect output from exec
Date Thu, 29 Sep 2011 13:59:36 GMT

             Bug #: 51917
           Summary: Race condition in PumpStreamHandler causes incorrect
                    output from exec
           Product: Ant
           Version: 1.8.2
          Platform: PC
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Core
    Classification: Unclassified

There is a race condition in PumpStreamHandler. To reproduce execute a process
using the ant API - the Execute class initialized with a LogStreamHandler
instance. Put breakpoints at the beginning of PumpStreamHandler.stop() and

Make sure the process started with Execute.execute() outputs at least one line
in the standard output and exits. Once you start debugging, the debugger will
stop at both breakpoints - the process has exited and PumpStreamHandler.stop()
is called, while the thread which handles the output has also stopped at the
breakpoint in LogOutputStream.processLine(). At this point if you resume the
first thread, flush() will be called on the output stream - this will call
processLine(). Thus, two different threads will process the same line,
duplicating it in the output.

We are working on a build tool in Eclipse which start an Ant build script and
then parses the output. Because of this race condition we can't get a reliable
output of a spawned process.

Also this problem is not present in Ant 1.7.1.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message