[jruby-user] String#<< and Ruby threads

1 view
Skip to first unread message

Michael Klishin

unread,
Sep 5, 2008, 4:07:43 PM9/5/08
to us...@jruby.codehaus.org
This gist code raises java.lang.ArrayOutOfBounds exception:
https://gist.github.com/30c7b6e4f0473a8bab5c

If you change << to += though, the code does not raise.

Here's the stack trace:
http://gist.github.com/9012

Does it look like a JRuby problem or am I ignorant about something
with Ruby threads?

This issue breaks Merb applications running on JRuby:
http://snipr.com/3nfcg
--
MK

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Charles Oliver Nutter

unread,
Sep 5, 2008, 8:24:08 PM9/5/08
to us...@jruby.codehaus.org
Michael Klishin wrote:
> This gist code raises java.lang.ArrayOutOfBounds exception:
> https://gist.github.com/30c7b6e4f0473a8bab5c
>
> If you change << to += though, the code does not raise.
>
> Here's the stack trace:
> http://gist.github.com/9012
>
> Does it look like a JRuby problem or am I ignorant about something
> with Ruby threads?
>
> This issue breaks Merb applications running on JRuby:
> http://snipr.com/3nfcg

File it as a bug. We don't make guarantees about one thread stepping on
another thread as far as the contents of data structures go, but we
should never throw these kinds of errors and leave you with completely
unusable data structures. At worse, you should get a (Ruby) exception
about concurrency.

Also it may be worth filing it as a bug with Merb folks. I know they're
keep to avoid situations that are likely to cause concurrency problems.
So there's probably fixes to be done on both sides.

- Charlie

Charles Oliver Nutter

unread,
Sep 6, 2008, 2:25:08 AM9/6/08
to us...@jruby.codehaus.org
Michael Klishin wrote:
> This gist code raises java.lang.ArrayOutOfBounds exception:
> https://gist.github.com/30c7b6e4f0473a8bab5c
>
> If you change << to += though, the code does not raise.
>
> Here's the stack trace:
> http://gist.github.com/9012
>
> Does it look like a JRuby problem or am I ignorant about something
> with Ruby threads?
>
> This issue breaks Merb applications running on JRuby:
> http://snipr.com/3nfcg

Wow, I obviously didn't look at your last link. So it's already reported
to the merb guys. Ok, so just file one for us and we'll get it resolved.

- Charlie

Charles Oliver Nutter

unread,
Sep 6, 2008, 2:43:49 AM9/6/08
to us...@jruby.codehaus.org
Charles Oliver Nutter wrote:
> Michael Klishin wrote:
>> This gist code raises java.lang.ArrayOutOfBounds exception:
>> https://gist.github.com/30c7b6e4f0473a8bab5c
>>
>> If you change << to += though, the code does not raise.
>>
>> Here's the stack trace:
>> http://gist.github.com/9012
>>
>> Does it look like a JRuby problem or am I ignorant about something
>> with Ruby threads?
>>
>> This issue breaks Merb applications running on JRuby:
>> http://snipr.com/3nfcg
>
> Wow, I obviously didn't look at your last link. So it's already reported
> to the merb guys. Ok, so just file one for us and we'll get it resolved.

FWIW, I also talked to Yehuda about it and he said he'd bump it up on
the priority list. So we just need to give String some TLC and both ends
ought to be good to go.

Thanks for pointing it out.

Reply all
Reply to author
Forward
0 new messages