fsevents: napi_create_string_utf8 assertion failed

In the last couple days, my regularly scheduled builds have been failing with:

Assertion failed: (napi_create_string_utf8(env, events->events[idx].path, NAPI_AUTO_LENGTH, &args[0]) == napi_ok), function fse_dispatch_event, file ../src/fsevents.c, line 147.
Abort trap: 6

Failures occur on latest versions of node 10, 12, and 14.

I do not have a minimum reproducible example, but wanted to create an issue to create awareness in case I’m not the only person with this problem. All I can offer right now is this reproduction that uses fsevents through a transitive relation (so may not offer much help).

git clone https://github.com/nickbabcock/highwayhasher.git
cd highwayhasher/verifier
npm install
npm test

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 10
  • Comments: 26 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Well the long night is over. I have found the issue.

The test script has a bug (that also triggers this) https://github.com/sunknudsen/fsevents-test/pull/1 fixes it for the test script/

I have also solved the issue that this triggers and created PR #356 with an explanation of what was going on.

TL;DR garbage collection bit me by triggering this and made me hit a missing argument check quite blatantly.

I’ve found the reason for the crash. I just don’t have a solution yet. It looks like if it doesn’t creash (because if(cause) ) then it just stops delivering events, so equally useful.

I seem to be in for a longish night.

Released as v2.3.2

downgrading to chokidar@3.4.3 worked for me.

@sunknudsen It’s quite possible that this is the same cause. Because if the stop gets garbage collected and stops before another event comes in, then it would indeed just stop watching. I’ll have to check chokidar and chat with @paulmillr to see if this may be the cause.

@sunknudsen about 39 times

If someone can create reproducible repo this would help

I was able to get this to work it by downloading fsevents@2.1.3 (ie what’s referenced by chokidar@3.4.3) and copying the fsevents.{js,node} from 2.1.3 into an fsevents 2.2.x or 2.3.x installation dir. This heavily implies the regression was introduced in fsevents 2.2 and still present fsevents 2.3