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

Thread #9

Open
sakuro opened this issue Mar 24, 2019 · 0 comments
Open

Thread #9

sakuro opened this issue Mar 24, 2019 · 0 comments

Comments

@sakuro
Copy link

sakuro commented Mar 24, 2019

Following script succeeds or fails with NoMethodError randomly.

  • case 1 .../himl-0.1.1/lib/himl/parser.rb:141:in current_line': undefined method column' for nil:NilClass (NoMethodError)
  • case 2 .../himl-0.1.1/lib/himl/parser.rb:149:in close_tags': undefined method name' for nil:NilClass (NoMethodError)

To reproduce, give two (large) integer numbers: number of threads and number of loops

require 'himl'
require 'erb'

parser = Himl::Parser.new
template = '<%= 1 %>'

nthreads = (ARGV.shift || 10).to_i
nloop = (ARGV.shift || 1000).to_i

nthreads.times.map {
  Thread.start do
    nloop.times do
      ERB.new(parser.call(template).to_erb).result
    end
  end
}.each(&:join)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant