Skip to content

jruby-1.7.3 Timeout is not working with long string and regexp. #792

@Leeheng86

Description

@Leeheng86

It is easy to reproduce situation trouble me.
And it is work with ruby 1.9.3.
plz help!!

require 'timeout'
posstr = "NRNRNNVVNRNNNNNNPUNNNNPUNRNNNNNNNNNNNNNRNNNNNRNNNRNNNNJJNNCCNNNRNNVVNNNNNRNNNNNRNNNNNRNNNNNRNNNRNNNNNNNNNNCCNNNNNNNNNNNNNNNRNNNNNNPUNNNNPUNNNNNNNRNNNNNNNRNNNNNNNNNNNNNNNNNNNNNNNNNRNNNNNNNNVVNNNNNNNNNNNNNNNNNNNNNRNNNNNNNNNRNNNNNNPUNNNNPUNRNNNNNNNNCCNNJJNN"
re= /((?:(?:(?:JJ|VA)(?:DEC)?)*|AS)?(?:(?:NN|NR|NT)+(?:PU|CC|PP)?)+)$/
begin
    Timeout::timeout(5) do
        posstr.scan(re)
    end
rescue
    puts "It won't never be there."
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions