This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 91779 - streams are not flushed when app is killed
Summary: streams are not flushed when app is killed
Status: VERIFIED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Torbjorn Norbye
URL:
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2007-01-03 17:25 UTC by Tomas Danek
Modified: 2007-07-03 14:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Danek 2007-01-03 17:25:49 UTC
#208:
is it possible to fix or workaround following???


 - create an app, have a simple code like this:

      puts "type something:"
      value= gets

 - if you run it, it prints message and waits for input. Do not give any input
and kill application (ruby process), you get FAILED - returned -1

 - now run it again, you don't see prompt "type something:". Anyway, if you type
 "thisIsWhatITyped" to input and push enter, you get

STARTING
thisIsWhatITyped
type something:

- moreover if you type the same (just hit enter in input box), you get IOException:

java.io.IOException: Broken pipe
	at java.io.FileOutputStream.writeBytes(Native Method)
	at java.io.FileOutputStream.write(FileOutputStream.java:260)
	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
	at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:278)
	at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
	at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
	at java.io.BufferedWriter.flush(BufferedWriter.java:236)
	at
org.netbeans.modules.ruby.rubyproject.api.RubyExecutionService$Input.run(RubyExecutionService.java:496)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:541)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:963)
Comment 1 Torbjorn Norbye 2007-02-01 23:07:06 UTC
This is fixed in #271.
Comment 2 Tomas Danek 2007-02-02 13:44:12 UTC
mostly fixed, but had to reopen:

- create project, into main.rb put

puts "start"
val = gets
puts "end"

- run project (F6), "start" is printed and program is waiting for input.
- kill the process (the x button on progress)
- run it again (F6)
- "start" is printed and program is waiting for input
- type any input, push enter
- end is printed, but process did not finish - still waiting on input
- if you provide input, java.io.IOException: Broken pipe again

however, not 100% reproducible (at least for me), thus lower priority..
Comment 3 Tomas Danek 2007-03-06 16:46:37 UTC
run the following snippet from some tutorial using ruby from command line, and
run it in IDE started with fresh userdir, with interpreter set to ruby. You'll
see the difference.

# inform the user what this script does
puts "This script searches the log files for a specified search term."
# an empty line to make it look pretty
puts
# prompt the user for a search term, use print so the cursor stays on
# the same line as the prompt
print "Search term: "
# get the search term and remove the newline character in the process
term = gets.chomp!
# let the user know you are searching
puts "Searching for '" + term + "'..."
# display results if this actually worked
puts "[results go here]"

Comment 4 Torbjorn Norbye 2007-03-19 22:09:40 UTC
This is now fixed (as of Features / Ruby = 0.39).
Comment 5 Tomas Danek 2007-05-25 15:10:40 UTC
verified 20070525
Comment 6 Jiri Kovalsky 2007-07-03 14:13:46 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 7 Jiri Kovalsky 2007-07-03 14:44:18 UTC
Changing target milestone of all resolved Ruby issues from TBD to 6.0 Beta 1 build.