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 101748 - Fast Debugger session silently ends up
Summary: Fast Debugger session silently ends up
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-19 12:16 UTC by Martin Krauskopf
Modified: 2007-07-03 14:44 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
exception, pdf variable (2.22 KB, application/octet-stream)
2007-05-25 13:22 UTC, hernad
Details
my pdf-writer 1.1.3 patch (5.18 KB, application/octet-stream)
2007-06-18 12:19 UTC, hernad
Details
ruby-ide-patch.diff (568 bytes, text/plain)
2007-06-18 16:49 UTC, Martin Krauskopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Krauskopf 2007-04-19 12:16:57 UTC
1) Put breakpoint on line no. 4
2) Run Fast Debugger
3) Go to Local Variables, expand 'pdf' variable

Debugger session silently ends up. This is very like bug in the backend.
Simulating it with a telnet session, the client is disconnected without any
visible reason, however server does not finish.

require "rubygems"
require 'pdf/writer'
pdf = PDF::Writer.new
p pdf

Might be somehow related to issue 101625.
Comment 1 Martin Krauskopf 2007-05-23 15:49:47 UTC
This was bug in the fast debugger backend. I've fixed that in the version
ruby-debug-ide 0.1.5 and published on rubyforge.org.
So one needs to upgrade to the latest IDE and latest gem.
Comment 2 hernad 2007-05-25 13:20:46 UTC
I have tested debugging with NetBeans M9 (nb-m9) and ruby-ide-hudson build 1330
(ruby-ide)

this is  main.rb code

require "rubygems"
gem "pdf-writer"

require 'pdf/writer'

pdf = PDF::Writer.new()


encoding = {
      :encoding => "WinAnsiEncoding" ,
      :differences => {
        214 => "Cacute",
        215 => "cacute" }
}


<<BREAKPOINT_1>> pdf.select_font("BringOutBaTahomaMono2.afm", encoding)
pdf.text "BringOutBaTahomaMono2: \xd6 \xd7 ", :font_size => 7, :justification =>
:left

...

I have put breakpoint to position <<BREAKPOINT_1>>.

When I try "step over":
 * nb-m9 debug session silently die
 * ruby-ide successfuly finish debug session session


But there is another problem with ruby-ide. After passing <<BREAKPOINT_1>>, I
move to variable pdf, and getting exception org.xmlpull.v1.XmlPullParserException 


As you can see It is some binary content.


I suspect that there is problem (as I earlier sad) when an variable contain some
binary content.

note: ruby-debg-ide updated ruby-debug-ide-0.1.5


Comment 3 hernad 2007-05-25 13:22:18 UTC
Created attachment 42787 [details]
exception, pdf variable
Comment 4 Martin Krauskopf 2007-06-12 15:09:27 UTC
Hi Ernad. Which version of pdf-writer are you using? I'm using 1.1.3 and it
seems to does not work with the code you've attached. Should I use trunk branch
of pdf-writer to reproduce?

I'm getting exception:
.../pdf-writer-1.1.3/lib/pdf/writer.rb:860:in `load_font': undefined local
variable or method `firstchar' for #<PDF::Writer:0xb799363c> (NameError)
 from .../pdf-writer-1.1.3/lib/pdf/writer.rb:857:in `each'
 from .../pdf-writer-1.1.3/lib/pdf/writer.rb:857:in `load_font'
 from .../pdf-writer-1.1.3/lib/pdf/writer.rb:1039:in `select_font'
 from .../pdf/pdf.rb:18
 from .../ruby-debug-ide-0.1.5/lib/ruby-debug.rb:79:in `debug_load'
 from .../ruby-debug-ide-0.1.5/lib/ruby-debug.rb:79:in `main'
 from .../ruby-debug-ide-0.1.5/bin/rdebug-ide:74
 from ...rdebug-ide:16:in `load'
 from ...rdebug-ide:16
Comment 5 Martin Krauskopf 2007-06-12 15:11:50 UTC
Otherwise I've successfully debugged few demos from the PDF::Writer homepage. You are using Linux, right?
Comment 6 hernad 2007-06-18 12:19:36 UTC
Created attachment 43873 [details]
my pdf-writer 1.1.3 patch
Comment 7 hernad 2007-06-18 12:22:19 UTC
Sorry for delay, I am really busy these days.

I have submitted my patch for pdf-writer-1.1.3 

Apply patch with:

hernad@desk-h8:/usr/lib/ruby/gems/1.8/gems/pdf-writer-1.1.3$ patch -p1 < pdf-writer-1.1.3.hernad.patch


And yes, I am using Linux.

Regards, 
Ernad

 
Comment 8 hernad 2007-06-18 12:40:33 UTC
I already submitted these changes as files on ticket http://www.netbeans.org/issues/show_bug.cgi?id=101625


Meanwhile, I have change my font: http://www.netbeans.org/nonav/issues/showattachment.cgi/41229/BringOutBaTMono2.zip

So please extract font in the main.rb, and use the old fontname in the example:

...   
pdf.select_font("BringOutBaTMono2.afm", encoding)

Comment 9 Martin Krauskopf 2007-06-18 12:50:40 UTC
Great, I'm finally able to reproduce with the attached patch. Thanks.
Comment 10 Martin Krauskopf 2007-06-18 16:49:53 UTC
Created attachment 43902 [details]
ruby-ide-patch.diff
Comment 11 Martin Krauskopf 2007-06-18 16:50:45 UTC
Ernad could try to reproduce with the attached patch:

.../gems/ruby-debug-ide-0.1.5$ patch -p0 < ~/tmp/ruby-ide-patch.diff

and let me know the result. Thanks.
Comment 12 hernad 2007-06-18 18:04:25 UTC
i have applied patch to ruby-debug-ide, and tested with ruby-ide build 1945.

When I point to pdf variable, I'm getting [Binary data]. No exception.

It is working now.

Thank you!



Comment 13 Martin Krauskopf 2007-06-18 21:57:19 UTC
The same bug was in the classic(slow) debuggers. All should be fixed now. Note it requires ruby-debug-ide gem in version
0.1.6 which I've just released. So it might take some time until it is available through gem tool.

Thanks for really helpful feedback.

debug-commons-java/manifest.mf;
new revision: 1.15; previous revision: 1.14
debugger/manifest.mf;
new revision: 1.28; previous revision: 1.27
debugger/nbproject/project.properties;
new revision: 1.12; previous revision: 1.11
debugger/nbproject/project.xml;
new revision: 1.25; previous revision: 1.24
debugger/src/org/netbeans/modules/ruby/debugger/RubyDebugger.java;
new revision: 1.34; previous revision: 1.33
debugger/src/org/netbeans/modules/ruby/debugger/Util.java;
new revision: 1.20; previous revision: 1.19
debugger/test/unit/src/org/netbeans/modules/ruby/debugger/TestBase.java;
new revision: 1.17; previous revision: 1.16
Removing external/debug-commons-0.9.3-license.txt;
new revision: delete; previous revision: 1.1
Removing external/debug-commons-0.9.3.tar.gz;
new revision: delete; previous revision: 1.1
external/debug-commons-0.9.4-license.txt;
initial revision: 1.1
external/debug-commons-0.9.4.tar.gz;
initial revision: 1.1
Comment 14 Jiri Kovalsky 2007-07-03 14:02:45 UTC
Reassigning this issue to newly created 'ruby' component.
Comment 15 Jiri Kovalsky 2007-07-03 14:44:46 UTC
Changing target milestone of all resolved Ruby issues from TBD to 6.0 Beta 1 build.