Francisco R. Santos created JRUBY-6354:
------------------------------------------

             Summary: SyntaxError: (RegexpError) invalid multibyte escape in 
1.9 mode in the 50th iteration
                 Key: JRUBY-6354
                 URL: https://jira.codehaus.org/browse/JRUBY-6354
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules, Ruby 1.9.2
    Affects Versions: JRuby 1.6.5
         Environment: JRuby 1.6.5
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Ubuntu Oneiric/Debian Lenny
Trinidad 1.3.2
            Reporter: Francisco R. Santos
         Attachments: test.rb

In a yet to be deployed application, we get the following error trying to 
connect to external resources (Exchange, GMail):

(RegexpError) invalid multibyte escape: /\A(?-mix:[\r\n\t ]+)?((?-mix:[^\x00- 
()<>@,;:\\"\/\[\]?={}\x7f]+))(?-mix:[\r\n\t ]+)?\/((?-mix:[^\x00- 
()<>@,;:\\"\/\[\]?={}\x7f]+))(?-mix:[\r\n\t 
]+)?((?-mix:(?:;(?-mix:[\r\n\t ]+)?(?-mix:[^\x00- 
()<>@,;:\\"\/\[\]?={}\x7f]+)(?-mix:[\r\n\t ]+)?=(?-mix:[\r\n\t 
]+)?(?:(?-mix:[^\x00- 
()<>@,;:\\"\/\[\]?={}\x7f]+)|(?-mix:"(?:[\r\n\t 
!#-\[\]-~\x80-\xff]|\\[\x00-\x7f])*"))(?-mix:[\r\n\t 
]+)?)*))(?:;(?-mix:[\r\n\t ]+)?)?\z/

 /opt/jruby/lib/ruby/1.9/open-uri.rb:463:in `content_type_parse'
 /opt/jruby/lib/ruby/1.9/open-uri.rb:498:in `charset'
 /opt/jruby/lib/ruby/1.9/open-uri.rb:422:in `meta_setup_encoding'
 /opt/jruby/lib/ruby/1.9/open-uri.rb:443:in `meta_add_field'
 
/home/bbvaui/app/shared/bundle/jruby/1.9/gems/httpclient-2.2.4/lib/httpclient/http.rb:229:in
 `set_body_encoding'
 
/home/bbvaui/app/shared/bundle/jruby/1.9/gems/httpclient-2.2.4/lib/httpclient/http.rb:313:in
 `set_headers'
 
/home/bbvaui/app/shared/bundle/jruby/1.9/gems/httpclient-2.2.4/lib/httpclient.rb:1115:in
 `do_get_header'
 
/home/bbvaui/app/shared/bundle/jruby/1.9/gems/httpclient-2.2.4/lib/httpclient.rb:1063:in
 `do_get_block'
 
/home/bbvaui/app/shared/bundle/jruby/1.9/gems/httpclient-2.2.4/lib/httpclient.rb:869:in
 `do_request'
 
/home/bbvaui/app/shared/bundle/jruby/1.9/gems/httpclient-2.2.4/lib/httpclient.rb:956:in
 `protect_keep_alive_disconnected'
 
/home/bbvaui/app/shared/bundle/jruby/1.9/gems/httpclient-2.2.4/lib/httpclient.rb:868:in
 `do_request'
 
/home/bbvaui/app/shared/bundle/jruby/1.9/gems/httpclient-2.2.4/lib/httpclient.rb:756:in
 `request'

This errors starts to happen after some requests, and then, we have to restart 
the Trinidad server to get rid of it. Some requests later, we get it again.

I have reduced the error to a test case, that always fails at the 50th 
iteration. The test fails with an empty rails application (using only rails 
3.1.3 gem in the Gemset).

$ jruby --1.9 -v
jruby 1.6.5 (ruby-1.9.2-p136) (2011-10-25 9dcd388) (Java HotSpot(TM) Server VM 
1.6.0_26) [linux-i386-java]

$ jruby -S --1.9 rails r test.rb
JRuby limited openssl loaded. http://jruby.org/openssl
gem install jruby-openssl for full support.
Test #1
Test #2
Test #3
Test #4
Test #5
Test #6
Test #7
Test #8
Test #9
Test #10
Test #11
Test #12
Test #13
Test #14
Test #15
Test #16
Test #17
Test #18
Test #19
Test #20
Test #21
Test #22
Test #23
Test #24
Test #25
Test #26
Test #27
Test #28
Test #29
Test #30
Test #31
Test #32
Test #33
Test #34
Test #35
Test #36
Test #37
Test #38
Test #39
Test #40
Test #41
Test #42
Test #43
Test #44
Test #45
Test #46
Test #47
Test #48
Test #49
Test #50
SyntaxError: (RegexpError) invalid multibyte escape: /\A(?-mix:[\r\n\t 
]+)?((?-mix:[^\x00- ()<>@,;:\\"\/\[\]?={}\x7f]+))(?-mix:[\r\n\t 
]+)?\/((?-mix:[^\x00- ()<>@,;:\\"\/\[\]?={}\x7f]+))(?-mix:[\r\n\t 
]+)?((?-mix:(?:;(?-mix:[\r\n\t ]+)?(?-mix:[^\x00- 
()<>@,;:\\"\/\[\]?={}\x7f]+)(?-mix:[\r\n\t ]+)?=(?-mix:[\r\n\t 
]+)?(?:(?-mix:[^\x00- ()<>@,;:\\"\/\[\]?={}\x7f]+)|(?-mix:"(?:[\r\n\t 
!#-\[\]-~\x80-\xff]|\\[\x00-\x7f])*"))(?-mix:[\r\n\t ]+)?)*))(?:;(?-mix:[\r\n\t 
]+)?)?\z/
  test_regexp at test.rb:8
       (root) at test.rb:17
        times at org/jruby/RubyFixnum.java:256
       (root) at test.rb:11
         eval at org/jruby/RubyKernel.java:1093
       (root) at 
/home/frsantos/.rvm/gems/jruby-1.6.5@test/gems/railties-3.1.3/lib/rails/commands/runner.rb:47
      require at org/jruby/RubyKernel.java:1047
       (root) at 
/home/frsantos/.rvm/gems/jruby-1.6.5@test/gems/railties-3.1.3/lib/rails/commands/runner.rb:63
      require at org/jruby/RubyKernel.java:1047
       (root) at script/rails:6


Without rails, it fails at the first iteration.

$ jruby --1.9 test.rb
Test #1
SyntaxError: (RegexpError) invalid multibyte escape: /\A(?-mix:[\r\n\t 
]+)?((?-mix:[^\x00- ()<>@,;:\\"\/\[\]?={}\x7f]+))(?-mix:[\r\n\t 
]+)?\/((?-mix:[^\x00- ()<>@,;:\\"\/\[\]?={}\x7f]+))(?-mix:[\r\n\t 
]+)?((?-mix:(?:;(?-mix:[\r\n\t ]+)?(?-mix:[^\x00- 
()<>@,;:\\"\/\[\]?={}\x7f]+)(?-mix:[\r\n\t ]+)?=(?-mix:[\r\n\t 
]+)?(?:(?-mix:[^\x00- ()<>@,;:\\"\/\[\]?={}\x7f]+)|(?-mix:"(?:[\r\n\t 
!#-\[\]-~\x80-\xff]|\\[\x00-\x7f])*"))(?-mix:[\r\n\t ]+)?)*))(?:;(?-mix:[\r\n\t 
]+)?)?\z/
  test_regexp at test.rb:8
     __file__ at test.rb:17
        times at org/jruby/RubyFixnum.java:256
       (root) at test.rb:11


Using MRI 1.9.2 or jruby in 1.8 mode, the test does not fail.

$ jruby --1.8 test.rb
Test #1
Test #2
.
.
.
Test #100

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.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


Reply via email to