Skip to content

N-API stability issues? #1318

Closed
Closed
@s-h-a-d-o-w

Description

@s-h-a-d-o-w

https://github.com/s-h-a-d-o-w/napi-test

  • Version: v10.3.0
  • Platform: Win7 x64

My repo that I linked to above contains a very simple example based around Promises. Considering the fact that N-API in node 10 is called "Stable", I would've expected that at least once everything was compiled successfully, my code would run consistently. Unfortunately, it doesn't and I wonder whether it's N-API's fault or mine (Maybe some problem with how I handle the async work? That's the only thing I can think of that might cause random problems):

Expected output:

D:\...>node .
Before Promise resolved
Promise resolved!

Errors that I get about 10% of the time (One time, execution even froze, I had to interrupt it. And sometimes, there is no output at all...):

D:\...>node .
Before Promise resolved
FATAL ERROR: EscapableHandleScope::Escape Escape value set twice
 1: node::DecodeWrite
 2: node_module_register
 3: v8::EscapableHandleScope::Escape
 4: v8::Function::Call
 5: std::basic_ostream<char,std::char_traits<char> >::operator<<
 6: v8::internal::interpreter::BytecodeDecoder::Decode
 7: v8::internal::RegExpImpl::Exec
 8: v8::internal::RegExpImpl::Exec
 9: v8::internal::RegExpImpl::Exec
10: 000000CB3B484281

D:\...>node .
console.js:196
Console.prototype.log = function log(...args) {
                                    ^^

SyntaxError: Unexpected identifier
    at Object.<anonymous> (D:\development\github\mute-volume\something.js:10:9)
    at Module._compile (internal/modules/cjs/loader.js:702:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
    at Module.load (internal/modules/cjs/loader.js:612:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
    at Function.Module._load (internal/modules/cjs/loader.js:543:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
    at startup (internal/bootstrap/node.js:238:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:572:3)

D:\...>node .
Stacktrace:
   ptr1=0000029304803B99
    ptr2=0000000000000000
    ptr3=0000000000000000
    ptr4=0000000000000000
    failure_message_object=00000000001C5C10

==== JS stack trace =========================================

    0: ExitFrame [pc: 0000018337E84281]
    1: StubFrame [pc: 0000018337F05787]
Security context: 0000029304820769 <JSObject>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions