can't debug `File.new('foo.jpg','r').read` - Exception in DebugThread loop: invalid byte sequence in UTF-8

Such a problem.
If threre's binary file reading in code (f.ex. File.new('foo.jpg','r').read)  - debugger disconnetcts.
Simple run - is ok, either utf8 output in rib console.

ubuntu intrepid, ruby1.9.1

/usr/local/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) /usr/local/bin/rdebug-ide --debug --port 37200 -- /home/semen/RubymineProjects/untitled/test.rb
Fast Debugger (ruby-debug-ide 0.4.9) listens on :37200
Starting command read loop
Processing: b /home/semen/RubymineProjects/untitled/test.rb:19
<breakpointAdded no="3" location="/home/semen/RubymineProjects/untitled/test.rb:19"/>
Processing: b /home/semen/RubymineProjects/untitled/test.rb:21
<breakpointAdded no="4" location="/home/semen/RubymineProjects/untitled/test.rb:21"/>
Processing: start
Starting: running program script
<breakpoint file="/home/semen/RubymineProjects/untitled/test.rb" line="21" threadId="1"/>
bla
61516015
Processing: th l
<threads>
<thread id="1" status="sleep" />
</threads>
Stopping Thread #<Thread:0x9be23f8>
Threads equal: true
Processing: th l
<threads>
<thread id="1" status="sleep" />
</threads>
Processing: w
Processing context: w
<frames>
<frame no='1' file='/home/semen/RubymineProjects/untitled/test.rb' line='21' current='true' />
</frames>
Processing: frame 1; v l
Processing context: frame 1
Selected frame no 0
Processing context:  v l
<variables>
</variables>
Exception in DebugThread loop: invalid byte sequence in UTF-8


and some crap in console:

Dec 18, 2009 11:00:00 AM java.util.prefs.FileSystemPreferences$2 run
INFO: Created user preferences directory.
Dec 18, 2009 11:00:00 AM java.util.prefs.FileSystemPreferences$7 run
WARNING: Prefs file removed in background /root/.java/.userPrefs/prefs.xml
Warning:  The encoding 'UTF-8' is not supported by the Java runtime.
Dec 18, 2009 11:05:23 AM org.rubyforge.debugcommons.Util collect
INFO: Stream closed
java.io.IOException: Stream closed
    at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:189)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
    at org.rubyforge.debugcommons.Util.collect(Util.java:189)
    at org.rubyforge.debugcommons.Util.access$000(Util.java:39)
    at org.rubyforge.debugcommons.Util$1.run(Util.java:163)
    at java.lang.Thread.run(Thread.java:619)
Dec 18, 2009 11:05:24 AM org.rubyforge.debugcommons.Util collect
INFO: Bad file descriptor
java.io.IOException: Bad file descriptor
    at java.io.FileInputStream.read(Native Method)
    at org.rubyforge.debugcommons.Util.collect(Util.java:189)
    at org.rubyforge.debugcommons.Util.access$000(Util.java:39)
    at org.rubyforge.debugcommons.Util$1.run(Util.java:163)
    at java.lang.Thread.run(Thread.java:619)



wonder what does "Warning:  The encoding 'UTF-8' is not supported by the Java runtime." mean?
sun-java6-bin  6-14-0ubuntu1.8.10 being used



Attachment(s):
test.rb.zip
image.png
3 comments
Comment actions Permalink

Hi A Zelt,

What gem versions do you have?
Do you have both of ruby1.8 and ruby1.9 installed on your computer?
Please have a look at the first line of /usr/local/bin/rdebug-ide? Does it point to ruby1.9?

Regards,
Oleg

0
Comment actions Permalink

ruby 1.9.1p376 (2009-12-07 revision 26041) [i686-linux]
build from source


gems installed
ruby-debug-base19 (0.11.23)
ruby-debug-ide19 (0.4.12)


>>Do you have both of ruby1.8 and ruby1.9 installed on your computer?
1.9 lonely

>>Please have a look at the first line of /usr/local/bin/rdebug-ide? Does it point to ruby1.9?
yes.

0
Comment actions Permalink

I was able to reproduce this on

Ubuntu9.10
ruby 1.9.1p0 (2009-01-30 revision 21907) [x86_64-linux]

ruby-debug-base19 (0.11.23)
ruby-debug-ide (0.4.9)
ruby-debug-ide19 (0.4.12)


This is not a RubyMine issue, anyway it should be reported to ruby-debug-ide gem developers.

Regards,
Oleg
0

Please sign in to leave a comment.