Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docusaurus build exists early #23297

Closed
littledivy opened this issue Apr 9, 2024 · 2 comments · Fixed by #23305
Closed

docusaurus build exists early #23297

littledivy opened this issue Apr 9, 2024 · 2 comments · Fixed by #23305
Labels
bug Something isn't working correctly node compat

Comments

@littledivy
Copy link
Member

git clone https://github.com/denoland/deno-docs && cd deno-docs

deno upgrade --canary
DENO_FUTURE=1 deno task build
@littledivy littledivy added bug Something isn't working correctly node compat labels Apr 9, 2024
@littledivy
Copy link
Member Author

littledivy commented Apr 10, 2024

Painful to debug but I think I tracked it down to the SSG plugin in Docusaurus. https://github.com/facebook/docusaurus/blob/73016d4936164ba38d4b86ec2aa8c168b5904a21/packages/docusaurus/src/ssg.ts#L249-L250

@littledivy
Copy link
Member Author

Process 34400 launched: '/home/divy/gh/littledivy/deno/target/debug/deno' (x86_64)
[INFO] [en] Creating an optimized production build...
[ "/home/divy/gh/littledivy/my-website/static" ]

✔ Client
  Compiled successfully in 1.87s

✔ Server
  

Process 34400 stopped
* thread #1, name = 'deno', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    frame #0: 0x000055555eff0ca2 deno`core::core_arch::x86::sse2::_mm_loadu_si128::h7a2c9eedf3d
5ad06 [inlined] core::intrinsics::copy_nonoverlapping::hd9d136cadbb174fa(src="", dst="", count=
16) at intrinsics.rs:2702:9
(lldb) up
frame #1: 0x000055555eff0ca2 deno`core::core_arch::x86::sse2::_mm_loadu_si128::h7a2c9eedf3d5ad0
6(mem_addr=0x000096a589c915f0) at sse2.rs:1241:5
(lldb) up
frame #2: 0x000055555efdd180 deno`hashbrown::raw::RawTable$LT$T$C$A$GT$::find::h7fffc08ef3e260e
9 at sse2.rs:53:15
(lldb) up
frame #3: 0x000055555efdd17b deno`hashbrown::raw::RawTable$LT$T$C$A$GT$::find::h7fffc08ef3e260e
9 at mod.rs:2187:34
(lldb) up
frame #4: 0x000055555efdd0d7 deno`hashbrown::raw::RawTable$LT$T$C$A$GT$::find::h7fffc08ef3e260e
9(self=0x0000555565a8c7f0, hash=14514092052931611360, eq={closure_env#0}<core::any::TypeId, cor
e::any::TypeId, v8::isolate::RawSlot> @ 0x00007ffffffc1e28) at mod.rs:1464:26
(lldb) up
frame #5: 0x000055555efdcfdb deno`hashbrown::raw::RawTable$LT$T$C$A$GT$::get::h0a8ba4edb5b17f06
(self=0x0000555565a8c7f0, hash=14514092052931611360, eq={closure_env#0}<core::any::TypeId, core
::any::TypeId, v8::isolate::RawSlot> @ 0x00007ffffffc20c0) at mod.rs:1481:15
(lldb) up
frame #6: 0x000055555eff8497 deno`hashbrown::map::HashMap$LT$K$C$V$C$S$C$A$GT$::get::h2f4edba0c
a847629 at map.rs:1359:13
(lldb) up
frame #7: 0x000055555eff8447 deno`hashbrown::map::HashMap$LT$K$C$V$C$S$C$A$GT$::get::h2f4edba0c
a847629(self=0x0000555565a8c7f0, k=0x00007ffffffc2528) at map.rs:1313:20
(lldb) up
frame #8: 0x000055555f000434 deno`std::collections::hash::map::HashMap$LT$K$C$V$C$S$GT$::get::h
ef8cd182ac67cc96(self=0x0000555565a8c7f0, k=0x00007ffffffc2528) at map.rs:879:9
(lldb) up
frame #9: 0x000055555ebde9c0 deno`deno_core::runtime::bindings::promise_reject_callback::h1c51e
b30389968db at context.rs:227:7
   224      isolate: &'a mut Isolate,
   225    ) -> Option<&'a T> {
   226      if let Some(annex) = self.get_annex_mut(isolate, false) {
-> 227        annex.slots.get(&TypeId::of::<T>()).map(|slot| {
   228          // SAFETY: `Self::set_slot` guarantees that only values of type T will be
   229          // stored with T's TypeId as their key.
   230          unsafe { slot.borrow::<T>() }
(lldb) up
frame #10: 0x000055555ebde914 deno`deno_core::runtime::bindings::promise_reject_callback::h1c51
eb30389968db at jsrealm.rs:216:5
   213      scope: &mut v8::HandleScope,
   214    ) -> Rc<ExceptionState> {
   215      let context = scope.get_current_context();
-> 216      context
   217        .get_slot::<Rc<ContextState>>(scope)
   218        .unwrap()
   219        .exception_state
(lldb) up
frame #11: 0x000055555ebde2df deno`deno_core::runtime::bindings::promise_reject_callback::h1c51
eb30389968db(message=PromiseRejectMessage @ 0x00007ffffffc25f0) at bindings.rs:657:25
   654    // SAFETY: `CallbackScope` can be safely constructed from `&PromiseRejectMessage`
   655    let scope = &mut unsafe { v8::CallbackScope::new(&message) };
   656 
-> 657    let exception_state = JsRealm::exception_state_from_scope(scope);
   658    exception_state.track_promise_rejection(
   659      scope,
   660      message.get_promise(),
(lldb) up
frame #12: 0x000055555f100ba2 deno`v8::internal::Isolate::ReportPromiseReject(v8::internal::Han
dle<v8::internal::JSPromise>, v8::internal::Handle<v8::internal::Object>, v8::PromiseRejectEven
t) at isolate.cc:6074:3
(lldb) up
frame #13: 0x000055555fa8b193 deno`v8::internal::Runtime_PromiseResolveAfterResolved(int, unsig
ned long*, v8::internal::Isolate*) at runtime-promise.cc:42:1
(lldb) up
frame #14: 0x000055555f7f2c36 deno`Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit + 54
deno`Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit:
->  0x55555f7f2c36 <+54>: cmpq   0x2d0(%r13), %rax
    0x55555f7f2c3d <+61>: je     0x55555f7f2c5d            ; <+93>
    0x55555f7f2c43 <+67>: leave  
    0x55555f7f2c44 <+68>: movq   0xa0(%r13), %rsi
(lldb) up
frame #15: 0x000055555f86a64d deno`Builtins_PromiseCapabilityDefaultResolve + 141
deno`Builtins_PromiseCapabilityDefaultResolve:
->  0x55555f86a64d <+141>: jmp    0x55555f86a61e            ; <+94>
    0x55555f86a64f <+143>: movq   %rsi, -0x20(%rbp)
    0x55555f86a653 <+147>: movq   0x3cd0(%r13), %rbx
    0x55555f86a65a <+154>: xorl   %eax, %eax

littledivy added a commit to littledivy/deno that referenced this issue Apr 10, 2024
littledivy added a commit that referenced this issue Apr 13, 2024
Fixes #23297

`docusaurus build` works!

```
$ deno run -A repro.js 
fish: Job 1, 'deno run -A ../../littledivy/fs…' terminated by signal SIGSEGV (Address
 boundary error)
$ denod run -A repro.js
error: Uncaught (in promise) Error: rejected
```

Depends on denoland/deno_core#693
bartlomieju pushed a commit that referenced this issue Apr 15, 2024
Fixes #23297

`docusaurus build` works!

```
$ deno run -A repro.js 
fish: Job 1, 'deno run -A ../../littledivy/fs…' terminated by signal SIGSEGV (Address
 boundary error)
$ denod run -A repro.js
error: Uncaught (in promise) Error: rejected
```

Depends on denoland/deno_core#693
littledivy added a commit to littledivy/deno that referenced this issue Apr 19, 2024
Fixes denoland#23297

`docusaurus build` works!

```
$ deno run -A repro.js 
fish: Job 1, 'deno run -A ../../littledivy/fs…' terminated by signal SIGSEGV (Address
 boundary error)
$ denod run -A repro.js
error: Uncaught (in promise) Error: rejected
```

Depends on denoland/deno_core#693
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant