Stuck when loading marshalled data > 32000 bytes from IO stream ---------------------------------------------------------------
Key: JRUBY-5002 URL: http://jira.codehaus.org/browse/JRUBY-5002 Project: JRuby Issue Type: Bug Components: Core Classes/Modules Affects Versions: JRuby 1.5.1, JRuby 1.x+ Environment: OS X / Linux with Java 6 Reporter: Wouter de Bie Priority: Critical When loading a marshaled object larger than 32000 bytes, JRuby hangs. This behavior can be reproduced with the following script: class A attr_accessor :a end 100.times do |x| data = "a" * (1000 * x + 1000) y = A.new y.a = data File.open("x","w") do |f| Marshal.dump(y, f) end puts "File of #{x * 1000 + 1} bytes written" File.open("x") do |f| Marshal.load(f) end end A thread dump gives the following: "main" prio=5 tid=101801000 nid=0x100501000 runnable [1004ff000] java.lang.Thread.State: RUNNABLE at org.jruby.runtime.marshal.UnmarshalStream.unmarshalString(UnmarshalStream.java:249) at org.jruby.RubyString.unmarshalFrom(RubyString.java:6902) at org.jruby.runtime.marshal.UnmarshalStream.unmarshalObjectDirectly(UnmarshalStream.java:146) at org.jruby.runtime.marshal.UnmarshalStream.unmarshalObject(UnmarshalStream.java:95) at org.jruby.runtime.marshal.UnmarshalStream.defaultVariablesUnmarshal(UnmarshalStream.java:313) at org.jruby.RubyClass$6.unmarshalFrom(RubyClass.java:1116) at org.jruby.RubyClass.unmarshal(RubyClass.java:1086) at org.jruby.runtime.marshal.UnmarshalStream.defaultObjectUnmarshal(UnmarshalStream.java:302) at org.jruby.runtime.marshal.UnmarshalStream.unmarshalObjectDirectly(UnmarshalStream.java:200) at org.jruby.runtime.marshal.UnmarshalStream.unmarshalObject(UnmarshalStream.java:95) at org.jruby.RubyMarshal.load(RubyMarshal.java:165) at org.jruby.RubyMarshal$s_method_0_1$RUBYFRAMEDINVOKER$load.call(org/jruby/RubyMarshal$s_method_0_1$RUBYFRAMEDINVOKER$load.gen:65535) .... This behavior doesn't appear when the marshaled data is first loaded into a string (with File.read) and then passed on to Marshal#load -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email