ls | grep
gives below error in View Logs and I have to kill ADS. The log gets filled with the below errors
at java.lang.Thread.run(Thread.java:662)
at java.lang.Thread.run(Thread.java:662)
ls ~/* | \grep
is still not hanging and even ls | grep sometimes gives the same errors in the log
I cannot reproduce ADS-hang problem using head of 11.0 branch, SVN r26387.
I executed 'ls | grep' quite a few times and always get the followings:
(1) An error is logged in the log file:
<2012-04-18 20:15:57,796> ERROR [AWT-EventQueue-0] <com.aquafold.datastudio.tools.shell.ShellEditor>
java.io.IOException: Pipe closed
at java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:244)
at java.io.PipedInputStream.receive(PipedInputStream.java:210)
at java.io.PipedOutputStream.write(PipedOutputStream.java:132)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272)
at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:276)
at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
at com.aquafold.datastudio.tools.shell.bash.shell.io.CommandOutput.flush(CommandOutput.java:95)
at com.aquafold.datastudio.tools.shell.bash.shell.CommandRunner.run(CommandRunner.java:67)
at java.lang.Thread.run(Thread.java:662)
at com.aquafold.datastudio.tools.shell.bash.shell.AsynchBashCmdContext.run(AsynchBashCmdContext.java:26)
(2) In GUI, the following is displayed:
Failed to flush output: Pipe closed (in green)
•Usage: grep [OPTION ...] PATTERN [FILE ...] (in red)
grep [OPTION ...] [-e PATTERN | -f FILE] [FILE ...] (in red)
Try "\help grep" for more information. (in red)
Pipe closed (in red)
---X---X---
The 'Pipe closed' exception is an expected exception. This is because the grep command terminated while the ls command is still running. The reason that the grep command terminated immaturely is because you did not pass required argument to it.
In general, the command on the left hand side of the | character is a writer, and the command on the right hand side of the | character is a reader. If reader terminated before writer finished its job, an exception is thrown.
It is possible that 'ls | grep' will not thrown exception but just generate the Usage message; this is because grep terminated after ls. This is possible because they are running concurrently. This implies 'ls | ls' could also throw a 'Pipe closed' exception, because ls will not read its standard input, thus 'ls | ls' actually means running two ls commands simultaneously (the second ls will not read its input from the output generated by the first ls; both ls commands simply display the contents of the current directory and write it to stdout).
I cannot reproduce ADS-hang problem using head of 11.0 branch, SVN r26387.
I executed 'ls | grep' quite a few times and always get the followings:
(1) An error is logged in the log file:
<2012-04-18 20:15:57,796> ERROR [AWT-EventQueue-0] <com.aquafold.datastudio.tools.shell.ShellEditor>
java.io.IOException: Pipe closed
at java.io.PipedInputStream.checkStateForReceive(PipedInputStream.java:244)
at java.io.PipedInputStream.receive(PipedInputStream.java:210)
at java.io.PipedOutputStream.write(PipedOutputStream.java:132)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:272)
at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:276)
at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
at com.aquafold.datastudio.tools.shell.bash.shell.io.CommandOutput.flush(CommandOutput.java:95)
at com.aquafold.datastudio.tools.shell.bash.shell.CommandRunner.run(CommandRunner.java:67)
at java.lang.Thread.run(Thread.java:662)
at com.aquafold.datastudio.tools.shell.bash.shell.AsynchBashCmdContext.run(AsynchBashCmdContext.java:26)
(2) In GUI, the following is displayed:
Failed to flush output: Pipe closed (in green)
•Usage: grep [OPTION ...] PATTERN [FILE ...] (in red)
grep [OPTION ...] [-e PATTERN | -f FILE] [FILE ...] (in red)
Try "\help grep" for more information. (in red)
Pipe closed (in red)
---X---X---
The 'Pipe closed' exception is an expected exception. This is because the grep command terminated while the ls command is still running. The reason that the grep command terminated immaturely is because you did not pass required argument to it.
In general, the command on the left hand side of the | character is a writer, and the command on the right hand side of the | character is a reader. If reader terminated before writer finished its job, an exception is thrown.
It is possible that 'ls | grep' will not thrown exception but just generate the Usage message; this is because grep terminated after ls. This is possible because they are running concurrently. This implies 'ls | ls' could also throw a 'Pipe closed' exception, because ls will not read its standard input, thus 'ls | ls' actually means running two ls commands simultaneously (the second ls will not read its input from the output generated by the first ls; both ls commands simply display the contents of the current directory and write it to stdout).
Issue #6671 |
Closed |
Unreproducible |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
ls ~/* | \grep
is still not hanging and even ls | grep sometimes gives the same errors in the log