Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StringIO doesn't work with frozen strings in 1.7.5.dev #1008

Closed
bensummers opened this issue Sep 12, 2013 · 3 comments
Closed

StringIO doesn't work with frozen strings in 1.7.5.dev #1008

bensummers opened this issue Sep 12, 2013 · 3 comments

Comments

@bensummers
Copy link

@bensummers bensummers commented Sep 12, 2013

Regression from 1.7.4. Here's a short script:

require 'stringio'
str = "Hello".freeze
p StringIO.new(str).read

Running with 1.7.4 and 1.7.5:

$ jruby -v test/stringio_test_case.rb 
jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on Java HotSpot(TM) Server VM 1.7.0_25-b15 [SunOS-x86]
"Hello"

$ jruby -v test/stringio_test_case.rb 
jruby 1.7.5.dev (1.9.3p392) 2013-09-12 77a0453 on Java HotSpot(TM) Server VM 1.7.0_25-b15 [SunOS-x86]
IOError: not modifiable string
    read at org/jruby/ext/stringio/RubyStringIO.java:1002
  (root) at test/stringio_test_case.rb:3

I found this by trying to parse frozen strings with REXML.

@BanzaiMan
Copy link
Member

@BanzaiMan BanzaiMan commented Sep 12, 2013

Our check now includes one for frozenness, which didn't exist before… e14ea63 but I don't think the logic is quite right. https://github.com/ruby/ruby/blob/v1_9_3_448/ext/stringio/stringio.c#L167-L206

@bensummers
Copy link
Author

@bensummers bensummers commented Sep 13, 2013

Is this one worth fixing in 1.7.5?

@headius
Copy link
Member

@headius headius commented Sep 13, 2013

Will fix.

@headius headius closed this in 6e4c3d3 Sep 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants