Skip to content

Importing cjs file with "module.exports" export causes fatal error #57295

Open
@dsherret

Description

@dsherret

Version

23.9.0

Platform

Microsoft Windows NT 10.0.26100.0 x64

Subsystem

No response

What steps will reproduce the bug?

// a.mjs
import * as test from "./b.cjs";

console.log(test);

// b.cjs
module.exports["module.exports"] = 6;

Then node a.mjs

How often does it reproduce? Is there a required condition?

Every time.

What is the expected behavior? Why is that the expected behavior?

Probably:

> node a.mjs
[Module: null prototype] {
  default: { 'module.exports': 6 },
  'module.exports': { 'module.exports': 6 }
}

What do you see instead?

> node a.mjs


#
# Fatal error in , line 0
# Check failed: IsTheHole(exports->Lookup(name), isolate).
#
#
#
#FailureMessage Object: 00000026F33FE980
----- Native stack trace -----

 1: 00007FF73ED9FB1D node::SetCppgcReference+16781
 2: 00007FF73EC7CA1F node::TriggerNodeReport+74543
 3: 00007FF740005231 V8_Fatal+225
 4: 00007FF73F5C5201 v8::MemorySpan<std::basic_string_view<char,std::char_traits<char> > const >::end+4401
 5: 00007FF73F5D7CCC v8::MemorySpan<std::basic_string_view<char,std::char_traits<char> > const >::end+80892
 6: 00007FF73F607EDE v8::RegExp::GetFlags+166382
 7: 00007FF73F9F8698 v8::Module::InstantiateModule+136
 8: 00007FF73ED52C4C v8::base::CPU::has_bmi2+16684
 9: 00007FF73FA1FD6A v8::PropertyDescriptor::writable+79722
10: 00007FF73FA1DF02 v8::PropertyDescriptor::writable+71938
11: 00007FF73FA5F25B v8::PropertyDescriptor::writable+339035
12: 00007FF73FB41219 v8::PropertyDescriptor::writable+1264665
13: 00007FF73FA4DDD3 v8::PropertyDescriptor::writable+268243
14: 00007FF73FA1B953 v8::PropertyDescriptor::writable+62291
15: 00007FF73F8B955A v8::Isolate::NumberOfHeapSpaces+2634
16: 00007FF73F8B964B v8::Isolate::NumberOfHeapSpaces+2875
17: 00007FF73F8BA384 v8::Isolate::NumberOfHeapSpaces+6260
18: 00007FF73F88E257 v8::base::CPU::has_sse41+1671
19: 00007FF73F88DEC0 v8::base::CPU::has_sse41+752
20: 00007FF73EDE4F32 node::CallbackScope::~CallbackScope+530
21: 00007FF73EDE4DAE node::CallbackScope::~CallbackScope+142
22: 00007FF73ECE2946 v8::base::CPU::has_fpu+49734
23: 00007FF73ECFD045 EVP_MD_meth_get_input_blocksize+58213
24: 00007FF73EE1879A uv_timer_stop+1322
25: 00007FF73EE1493B uv_update_time+475
26: 00007FF73EE144A4 uv_run+884
27: 00007FF73EDE4525 node::SpinEventLoop+405
28: 00007FF73ECAD95A v8_inspector::protocol::Binary::operator=+130346
29: 00007FF73ED4E82C node::Start+4796
30: 00007FF73ED4D597 node::Start+39
31: 00007FF73EABF3ED AES_cbc_encrypt+158237
32: 00007FF740725174 inflateValidate+29428
33: 00007FFFF58EE8D7 BaseThreadInitThunk+23
34: 00007FFFF70FBF2C RtlUserThreadStart+44

Additional information

No response

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions