Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: JRuby 1.6.6
    • Fix Version/s: JRuby 1.7.0.pre1
    • Component/s: None
    • Labels:
      None
    • Environment:
    • Testcase included:
      yes
    • Number of attachments :
      0

      Description

      While running the tests in the ruby library 'mustache' (link: https://github.com/defunkt/mustache), one test in particular is failing:

      https://github.com/defunkt/mustache/blob/master/test/mustache_test.rb#L510-522

      JRuby dies calling StringScanner#scan_until here:

      https://github.com/defunkt/mustache/blob/master/lib/mustache/parser.rb#L231

      You can reproduce the issue with the following:

      require 'strscan'
      regex = /(^[ \t]*)?\{\{/
      text = "<h1>&#20013;&#25991; {{test}}</h1>\n\n{{> utf8_partial}}\n"
      text.force_encoding 'BINARY'
      scanner = StringScanner.new(text)
      scanner.scan_until(regex) # Fans spin up, and this method never returns.
      

      This seems to happen regardless of whether or not JRuby is in 1.8 or 1.9 mode. I am running this test like so:

      JRUBY_OPTS=--1.9 ruby -I"lib:test" test/mustache_test.rb -n test_utf8 -v

      I've also run it with: JRUBY_OPTS="--1.9 LC_ALL=en_US.UTF-8"

      It appears that this affects UTF-8 characters. If I replace the chinese characters with "foo bar", then there is no problem.

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        Ahh, yes. The noformat tags do monkey with unicode characters. Can you attach this as a script or confirm it's actually working on master?

        Show
        Charles Oliver Nutter added a comment - Ahh, yes. The noformat tags do monkey with unicode characters. Can you attach this as a script or confirm it's actually working on master?
        Hide
        Charles Oliver Nutter added a comment -

        Or put the script into a gist/pastie.

        Show
        Charles Oliver Nutter added a comment - Or put the script into a gist/pastie.
        Show
        Scott Gonyea added a comment - https://github.com/jruby/jruby/issues/174
        Hide
        Scott Gonyea added a comment -
        Show
        Scott Gonyea added a comment - Moved issue to Github ( https://github.com/jruby/jruby/issues/174 )
        Hide
        Scott Gonyea added a comment -

        God I suck at JIRA. Sorry for my spam.

        Show
        Scott Gonyea added a comment - God I suck at JIRA. Sorry for my spam.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Scott Gonyea
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: