GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — npm[7320]: src\fs_event_wrap.cc:90: Assertion `wrap != nullptr' failed. · Issue #20738 · nodejs/node

npm[7320]: src\fs_event_wrap.cc:90: Assertion `wrap != nullptr' failed. #20738

New issue
Copy link
New issue
Copy link
Closed
Closed
npm[7320]: src\fs_event_wrap.cc:90: Assertion `wrap != nullptr' failed.#20738
Copy link
Labels
fsIssues and PRs related to file-system APIs and the fs module.

Description

@phamVanLac
phamVanLac
opened on May 15, 2018
Issue body actions
  • Version: node 5.6.0
  • Platform:Windows 64-bit
  • Subsystem:

i had used rimraf to remove folder and use fs to remove file after download.
But when delete complete node have issue and i cant find the same on any where.
Thanks you very much.

clearFileAfterDownload (path) {

		if (fs.existsSync(path)) {

			rimraf(path, (err) => {

				if(err) {

					console.log(err);

				}

			});

		}

		if(fs.existsSync(path+'.zip')) {

			fs.unlinkSync(path+'.zip');

		}

}

(edited by @vsemozhetbyt: fix backticks for code block)

Activity

  1. mscdex commented on May 15, 2018

    @mscdex
    mscdex
    on May 15, 2018
    Contributor
    More actions

    Can you try it on a modern/supported version of node? v5.x hasn't been supported since 2016.

    Reacted by phamVanLac
  2. phamVanLac commented on May 15, 2018

    @phamVanLac
    phamVanLac
    on May 15, 2018
    Author
    More actions

    i try [email protected] and nothing change
    npm[5864]: src\fs_event_wrap.cc:90: Assertion wrap != nullptr' failed.
    1: node::DecodeWrite
    2: node::DecodeWrite
    3: node::Start
    4: 0000036569886400npm
    ERR! code ELIFECYCLE
    npm ERR! errno 134
    npm ERR! [email protected] start: nodemon node ./bin/www
    npm ERR! Exit status 134
    npm ERR!
    npm ERR! Failed at the [email protected] start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\LAC\AppData\Roaming\npm-cache_logs\2018-05-15T02_40_56_875Z-debug.log`

  3. phamVanLac commented on May 15, 2018

    @phamVanLac
    phamVanLac
    on May 15, 2018
    Author
    More actions

    When i try to delete a directory, and this error is appear. Every thing fine when i don't try to delete directory.

  4. mscdex commented on May 15, 2018

    @mscdex
    mscdex
    on May 15, 2018
    Contributor
    More actions

    Try with the latest version in the branch, such as v6.14.2 as of this writing.

  5. vsemozhetbyt
    added
    fsIssues and PRs related to file-system APIs and the fs module.
    on May 15, 2018
  6. bricss commented on May 25, 2018

    @bricss
    bricss
    on May 25, 2018
    Contributor
    More actions
    • Version: Node 10.2.1
    • Platform: Win10 x64

    Happens each time when switching between Git branches, while Grunt is running in watch mode.

    grunt[36836]: src\fs_event_wrap.cc:91: Assertion `wrap != nullptr' failed.
     1: node::DecodeWrite
     2: node::DecodeWrite
     3: node::Start
     4: 0000028F67786400
    npm ERR! code ELIFECYCLE
    npm ERR! errno 134
    npm ERR! [email protected] start-uat: `grunt && node server.js --uat`
    npm ERR! Exit status 134
    npm ERR! 
    npm ERR! Failed at the [email protected] start-uat script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\<Username>\AppData\Roaming\npm-cache\_logs\2018-05-25T14_48_07_433Z-debug.log
    Reacted by Andrew Albright and David Pohan
  7. WayneRiesterer commented on May 26, 2018

    @WayneRiesterer
    WayneRiesterer
    on May 26, 2018
    More actions

    I'm getting this error too.

    I am running the Angular CLI build process with a watcher and then serving up the build via NodeJS:

    ng build --output-path dist --watch | nodemon ./server/app.js

    Specs

    Window 10 x64
    NodeJS v10.1.0
    Angular CLI 6.0.5

    package.json

    {
      "name": "wr-mean-seed",
      "version": "0.0.0",
      "license": "MIT",
      "scripts": {
        "serve-dev": "ng build --output-path dist --watch | nodemon ./server/app.js",
        "serve-prod": "ng build --prod | node ./server/app.js",
        "client-start": "ng serve",
        "client-build": "ng build --prod",
        "client-test": "ng test",
        "client-lint": "ng lint",
        "client-e2e": "ng e2e"
      },
      "private": true,
      "dependencies": {
        "@angular/animations": "^6.0.3",
        "@angular/common": "^6.0.3",
        "@angular/compiler": "^6.0.3",
        "@angular/core": "^6.0.3",
        "@angular/forms": "^6.0.3",
        "@angular/http": "^6.0.3",
        "@angular/platform-browser": "^6.0.3",
        "@angular/platform-browser-dynamic": "^6.0.3",
        "@angular/router": "^6.0.3",
        "body-parser": "^1.18.3",
        "core-js": "^2.5.6",
        "express": "^4.16.3",
        "rxjs": "^6.2.0",
        "zone.js": "^0.8.19"
      },
      "devDependencies": {
        "@angular-devkit/build-angular": "^0.6.5",
        "@angular/cli": "~6.0.5",
        "@angular/compiler-cli": "^6.0.3",
        "@angular/language-service": "^6.0.3",
        "@types/jasmine": "~2.8.7",
        "@types/jasminewd2": "~2.0.2",
        "@types/node": "~10.1.2",
        "codelyzer": "^4.3.0",
        "jasmine-core": "~3.1.0",
        "jasmine-spec-reporter": "~4.2.1",
        "karma": "~2.0.2",
        "karma-chrome-launcher": "~2.2.0",
        "karma-coverage-istanbul-reporter": "^2.0.1",
        "karma-jasmine": "~1.1.2",
        "karma-jasmine-html-reporter": "^1.1.0",
        "nodemon": "^1.17.5",
        "protractor": "~5.3.2",
        "ts-node": "~6.0.5",
        "tslint": "~5.10.0",
        "typescript": "2.7.2"
      }
    }
    

    Error output

    $ ng build --output-path dist --watch | nodemon ./server/app.js
    [nodemon] 1.17.5
    [nodemon] to restart at any time, enter `rs`
    [nodemon] watching: *.*
    [nodemon] starting `node ./server/app.js`
    Server listening on localhost:3000
      - yarn  serve-dev[2648]: src\fs_event_wrap.cc:90: Assertion `wrap != nullptr' failed.
    ENOTEMPTY: directory not empty, rmdir 'C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\dist'
    Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\dist'
        at Object.fs.rmdirSync (fs.js:803:3)
        at MergeMapSubscriber.isDirectory.pipe.operators_1.concatMap.isDir [as project] (C:\Users\wprie\Documents\Wayn
    e\node-express-angular-cli-seed\node_modules\@angular-devkit\core\node\host.js:173:20)
        at MergeMapSubscriber._tryNext (C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\node_modules\@ang
    ular-devkit\core\node_modules\rxjs\internal\operators\mergeMap.js:122:27)
        at MergeMapSubscriber._next (C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\node_modules\@angula
    r-devkit\core\node_modules\rxjs\internal\operators\mergeMap.js:112:18)
        at MergeMapSubscriber.Subscriber.next (C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\node_modul
    es\@angular-devkit\core\node_modules\rxjs\internal\Subscriber.js:103:18)
        at MapSubscriber._next (C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\node_modules\@angular-dev
    kit\core\node_modules\rxjs\internal\operators\map.js:92:26)
        at MapSubscriber.Subscriber.next (C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\node_modules\@a
    ngular-devkit\core\node_modules\rxjs\internal\Subscriber.js:103:18)
        at Observable.rxjs_1.Observable.obs [as _subscribe] (C:\Users\wprie\Documents\Wayne\node-express-angular-cli-s
    eed\node_modules\@angular-devkit\core\node\host.js:212:17)
        at Observable.subscribe (C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\node_modules\@angular-de
    vkit\core\node_modules\rxjs\internal\Observable.js:162:69)
        at MapOperator.call (C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\node_modules\@angular-devkit
    \core\node_modules\rxjs\internal\operators\map.js:62:23)
        at Observable.subscribe (C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\node_modules\@angular-de
    vkit\core\node_modules\rxjs\internal\Observable.js:159:22)
        at MergeMapOperator.call (C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\node_modules\@angular-d
    evkit\core\node_modules\rxjs\internal\operators\mergeMap.js:87:23)
        at Observable.subscribe (C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\node_modules\@angular-de
    vkit\core\node_modules\rxjs\internal\Observable.js:159:22)
        at C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\node_modules\rxjs\internal\util\subscribeToObs
    ervable.js:16:20
        at Object.subscribeToResult (C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\node_modules\rxjs\in
    ternal\util\subscribeToResult.js:7:45)
        at MergeMapSubscriber._innerSub (C:\Users\wprie\Documents\Wayne\node-express-angular-cli-seed\node_modules\rxj
    s\internal\operators\mergeMap.js:132:38)
     1: node::DecodeWrite
     2: node::DecodeWrite
     3: node::Start
     4: 000002D4E3806400
    error Command failed with exit code 134.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    
  8. joyeecheung commented on May 26, 2018

    @joyeecheung
    joyeecheung
    on May 26, 2018
    Member
    More actions

    Could be duplicates of #20297 (somewhere in the inheritance some code sets the underlying pointer to nullptr before the object actually gets garbage collected)

    Reacted by phamVanLac
  9. joyeecheung commented on May 26, 2018

    @joyeecheung
    joyeecheung
    on May 26, 2018
    Member
    More actions

    A quick-and-dirty fix would be to turn the binding into a noop if the underlying pointer is set to nullptr instead of checking it, but that probably just hides the real bug...

  10. joyeecheung commented on May 26, 2018

    @joyeecheung
    joyeecheung
    on May 26, 2018
    Member
    More actions

    cc @addaleax

  11. addaleax commented on May 26, 2018

    @addaleax
    addaleax
    on May 26, 2018
    Member
    More actions

    @joyeecheung I think your suggestion is okay, it’s at least consistent because that’s what ASSIGN_OR_RETURN_UNWRAP does.

    Another (additional?) solution for this problem in other places is to set ._handle to null once the handle closes so that it can’t be accessed anymore – that might be trickier, but probably worth it because it’s also more consistent with most other code we have and would make us detect bugs like this earlier (whatever exactly this bug is).

  12. joyeecheung commented on May 27, 2018

    @joyeecheung
    joyeecheung
    on May 27, 2018
    Member
    More actions

    I think the problem comes from here

    node/src/handle_wrap.cc

    Line 129 in c241b7d

    delete wrap;

    Technically the watcher should not be used anymore once it's closed, I am guessing it's not followed by the user land hence the crashes.

    Reacted by Anna Henningsen
  13. joyeecheung commented on May 27, 2018

    @joyeecheung
    joyeecheung
    on May 27, 2018
    Member
    More actions

    Another (additional?) solution for this problem in other places is to set ._handle to null once the handle closes so that it can’t be accessed anymore – that might be trickier, but probably worth it because it’s also more consistent with most other code we have and would make us detect bugs like this earlier (whatever exactly this bug is).

    I tried to write some tests around this case and if we only set ._handle to null without any other change, it's going to hit the assertion the next time a method is called on the closed watcher. Seeing the user land usage here I am leaning towards returning early if ._handle is null as well (even though it's not supposed to happen if the docs are followed).

  14. joyeecheung
    closed this as completedin cd8f06fon Jun 3, 2018
  15. targos
    added a commit that references this issue on Jun 13, 2018

    fs: do not crash when using a closed fs event watcher

    c09bfd8
  16. sjarmak
    added a commit that references this issue on Jul 27, 2026

    fs: do not crash when using a closed fs event watcher

    cd8f06f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to file-system APIs and the fs module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.