tape-testing / tape

tap-producing test harness for node and browsers
MIT License
5.77k stars 305 forks source link

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal. #491

Closed ghost closed 4 years ago

ghost commented 4 years ago

Tape: 4.12.1 Node: 13.5.0

Tape is throwing v8 errors when using deasync. This is not the cause of deasync as it works outside of tape.

To reproduce:

const it = require('tape')
const ByteArray = require('bytearray-node')
const CompressionAlgorithm = require('bytearray-node/enums/CompressionAlgorithm')

it('Supports LZMA', (tape) => {
  const ba = new ByteArray()

  ba.writeUTF('Hello.')
  ba.compress(CompressionAlgorithm.LZMA)
  ba.uncompress(CompressionAlgorithm.LZMA)

  tape.equal(ba.readUTF(), 'Hello.')

  tape.end()
})

This creates the error:

FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal.
 1: 00007FF6DACEDACF napi_wrap+124991
 2: 00007FF6DAC8EEF6 v8::base::CPU::has_sse+35302
 3: 00007FF6DAC8FBC6 v8::base::CPU::has_sse+38582
 4: 00007FF6DB4AEA25 v8::V8::ToLocalEmpty+53
 5: 00007FF6DACD9A45 napi_wrap+42933
 6: 00007FF6DAD2CE38 uv_check_init+120
 7: 00007FF6DAD36B7A uv_run+682
 8: 00007FFE7DF7798D
 9: 00007FFE7DF772BE
10: 00007FFE7DF76C67
11: 00007FFE7DF77D83
12: 00007FF6DACC79E3 node::Stop+68835
13: 00007FF6DB459C40 v8::internal::Builtins::builtin_handle+324848
14: 00007FF6DB459180 v8::internal::Builtins::builtin_handle+322096
15: 00007FF6DB4594C8 v8::internal::Builtins::builtin_handle+322936
16: 00007FF6DB4592CE v8::internal::Builtins::builtin_handle+322430
17: 00007FF6DB8E8E0D v8::internal::SetupIsolateDelegate::SetupHeap+545005
18: 00007FF6DB86E379 v8::internal::SetupIsolateDelegate::SetupHeap+42585
19: 00007FF6DB86E379 v8::internal::SetupIsolateDelegate::SetupHeap+42585
20: 00007FF6DB86E379 v8::internal::SetupIsolateDelegate::SetupHeap+42585
21: 00007FF6DB86E379 v8::internal::SetupIsolateDelegate::SetupHeap+42585
22: 00007FF6DB867709 v8::internal::SetupIsolateDelegate::SetupHeap+14825
23: 00007FF6DB86E379 v8::internal::SetupIsolateDelegate::SetupHeap+42585
24: 00007FF6DB86E379 v8::internal::SetupIsolateDelegate::SetupHeap+42585
25: 00007FF6DB86E379 v8::internal::SetupIsolateDelegate::SetupHeap+42585
26: 00007FF6DB86E379 v8::internal::SetupIsolateDelegate::SetupHeap+42585
27: 00007FF6DB86B88E v8::internal::SetupIsolateDelegate::SetupHeap+31598
28: 00007FF6DB86B47C v8::internal::SetupIsolateDelegate::SetupHeap+30556
29: 00007FF6DB3B35E2 v8::internal::Execution::CallWasm+1410
30: 00007FF6DB3B2F59 v8::internal::Execution::Call+185
31: 00007FF6DB4846D0 v8::Function::Call+608
32: 00007FF6DAD09EC8 node::CallbackScope::~CallbackScope+1608
33: 00007FF6DAD0A387 node::MakeCallback+199
34: 00007FF6DACD9A3B napi_wrap+42923
35: 00007FF6DAD2CE38 uv_check_init+120
36: 00007FF6DAD36B7A uv_run+682
37: 00007FF6DAC5B762 v8::internal::interpreter::BytecodeArrayWriter::source_position_table_builder+30738
38: 00007FF6DACB6350 node::Start+288
39: 00007FF6DAB7666C RC4_options+339308
40: 00007FF6DB99F5F8 v8::internal::SetupIsolateDelegate::SetupHeap+1292504
41: 00007FFE97567BD4 BaseThreadInitThunk+20
42: 00007FFE9828CED1 RtlUserThreadStart+33
ghost commented 4 years ago

Also has been issued here: https://github.com/stianeikeland/node-etcd/issues/88 and here: https://github.com/abbr/deasync/issues/91

ljharb commented 4 years ago

Since this issue can only happen inside c code, and take has none, it is definitely a deasync issue. That tape triggers it is bad luck, but there’s nothing a JS lib can do to work around a flaw in something in native code.