GithubHelp home page GithubHelp logo

Environment can be null about isolated-vm HOT 2 OPEN

farhaven avatar farhaven commented on June 18, 2024 1
Environment can be null

from isolated-vm.

Comments (2)

laverdet avatar laverdet commented on June 18, 2024

A stack trace would be helpful if you can provide it. The change 478815b was legit because without the assertion we otherwise would be dereferencing a null pointer. The assertion fails faster and louder.

from isolated-vm.

jpshack-at-palomar avatar jpshack-at-palomar commented on June 18, 2024

I believe I am seeing this w/ node 20.10.0 and isolated-vm 5.0.0 on linux but not MacOS. I have an exit hander that tries to clean up when the process ends. I get a clean exit on MacOS but on linux after all test has passed successfully at the very end I get: node: ../src/isolate/environment.h:202: static ivm::IsolateEnvironment& ivm::IsolateEnvironment::GetCurrent(): Assertion `environment != nullptr' failed and non zero exit code.

Happy to provide any additional information if you can tell me how to get it.

   static async initializeIsolate() {
        if (!EvalAction.isolate) {
            EvalAction.isolate = new ivm.Isolate();

            process.on('exit', (code) => {
                this.debug(`The process is terminating with with code: ${code}`);
                this.debug(`Disposing of VM isolate and context...`);
                if (EvalAction.isolate) {
                    try {
                        EvalAction.isolate.dispose();
                        EvalAction.isolate = null;
                        EvalAction.context = null;
                    } catch {
                        // no op
                        // tests are passing but in ci I see this error after the test suite has run:
                        // node: ../src/isolate/environment.h:202: 
                        // static ivm::IsolateEnvironment& ivm::IsolateEnvironment::GetCurrent(): 
                        // Assertion `environment != nullptr' failed.
                    }
                }

                this.debug('Cleanup complete.');
            });

            EvalAction.context = await EvalAction.isolate!.createContext();

            // Expose globals
            await EvalAction.initGlobals();

        }
    }

from isolated-vm.

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.