Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.2
-
Fix Version/s: JRuby 1.2
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:jruby 1.1.7 (ruby 1.8.6 patchlevel 287) (2009-01-28 rev 6586) [i386-java]
Mac OS X 10.5.5 Intel
Description
This bug surfaces when trying to load a Truetype font with the (100% Ruby) Prawn gem, version 0.4.1. I have been unable to trace the exact event where it happens in the Prawn code, but this is an example:
"prawn.rb"
require 'rubygems' gem 'prawn', '0.4.1' require 'prawn' Prawn::Document.generate "prawn.pdf" do font "#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf" # This is what generates the error text "Hello from JRuby" end
When run in the latest JRuby build as of today:
~/dev% jruby -v jruby 1.1.7 (ruby 1.8.6 patchlevel 287) (2009-01-28 rev 6586) [i386-java] ~/dev% jruby -S gem list *** LOCAL GEMS *** prawn (0.4.1) prawn-layout (0.1.0) rake (0.8.3) rspec (1.1.12) sources (0.0.1) ~/dev% jruby prawn.rb RubyArray.java:752:in `eltInternal': java.lang.ArrayIndexOutOfBoundsException: 259 from Pack.java:1197:in `encode' from Pack.java:1494:in `pack' from RubyArray.java:3235:in `pack' ...
The code works fine in MRI. Problem is also present in JRuby 1.1.6.
Confirmed on trunk. Here's a trunk trace: