Code Monkey home page Code Monkey logo

Comments (8)

SamSaffron avatar SamSaffron commented on July 17, 2024

Can you confirm this happens as well on latest (2.3.1?)

from mini_racer.

seanmakesgames avatar seanmakesgames commented on July 17, 2024

Oh! You are referring to ruby right?

from mini_racer.

seanmakesgames avatar seanmakesgames commented on July 17, 2024

I assume this is true. It's going to take me a bit of time to get environments up to 2.3.1.

from mini_racer.

seanmakesgames avatar seanmakesgames commented on July 17, 2024

Due to multiple factors, I cannot upgrade to 2.3.1 at this time. My current version is 2.2.4 -
I'll attempt to create a repro in mini_racer based off the linked article. If I get it to work, then I'll try for a test run against 2.3.1

from mini_racer.

seanmakesgames avatar seanmakesgames commented on July 17, 2024

Managed to get the load testing setup working and got 31 instances of this in 25 minutes. So, if we do get a 'fix', it'll be pretty easy to test it. :)

from mini_racer.

seanmakesgames avatar seanmakesgames commented on July 17, 2024

Ok. I have repro for the segfault. Can't tell what it is, but it seems running full context many times in a loop can cause it sometimes. Potentially it's the GC freeing something it shouldn't be.
Originally I had the loop running 50 times, and right before I was going to give up and change the code-- I got the repro, so I pumped it up to 5000 -- obv. not the most efficient test case, and not even consistent, but man, it hits a segfault pretty consistently in a similar way.

  def test_segfault
    5000.times do
      GC.start

      context = MiniRacer::Context.new(timeout: 5)
      context.attach("echo", proc{|msg| msg.to_sym.to_s})
      assert_raises(MiniRacer::EvalError) do
        context.eval("while(true) echo('foo');")
      end
    end
  end

from mini_racer.

seanmakesgames avatar seanmakesgames commented on July 17, 2024

Ok and looks like if you just run the above code in a loop with or without GC.start, you basically get every class of c-level exception I have seen in my logs.
Probably should have provided that test case a while back.

from mini_racer.

seanmakesgames avatar seanmakesgames commented on July 17, 2024

I have confirmed that these segfaults are related to during script-run GC issues (most likely moving ruby/c-memory around when it's still in use by ruby or c++)
Please see #41

from mini_racer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.