Skip to content

SIGSEGV running Next.js 13 app-playground #5582

Closed as not planned
Closed as not planned

Description

@patrickpilch

Describe GraalVM and your environment :

  • GraalVM version or commit id if built from source: 22.3.0
  • CE or EE: CE
  • JDK version: 19.0.1
  • OS and OS Version: macOS Ventura 13.0.1 Darwin Kernel Version 22.1.0; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000 arm64
  • Architecture: arm64
  • The output of java -Xinternalversion:
OpenJDK 64-Bit Server VM (19.0.1+10-jvmci-22.3-b08) for bsd-aarch64 JRE (19.0.1+10-jvmci-22.3-b08), built on 2022-10-19T10:54:34Z by "graal" with clang Apple LLVM 12.0.0 (clang-1200.0.32.29)

Have you verified this issue still happens when using the latest snapshot?
Yes, also verified on 23.0.0-dev commit 235e21081d88fdfbbf2588e0c2e2f602d2dd3ede. OpenJDK 64-Bit Server VM (19.0.1+10-jvmci-23.0-b04) for bsd-aarch64 JRE (19.0.1+10-jvmci-23.0-b04), built on 2022-12-01T21:03:13Z by "graal1" with clang Apple LLVM 12.0.0 (clang-1200.0.32.29).

Describe the issue
A memory access violation occurs when trying to launch Vercel's latest (as of 2022-12-07) "app-playground" example with Next.js 13.0.7-canary.1.

Code snippet or code repository that reproduces the issue
See here for the specific commit of the "app-playground".

Steps to reproduce the issue

  1. Install dependencies yarn install
  2. Launch the Next.js dev server yarn dev

Steps in #5581 can be followed to achieve close reproduction.
TL;DR - Run node node_modules/.bin/next dev

Expected behavior
Next.js development server should launch and start compiling and serving pages.

LLDB Backtrace
(lldb) target create "/Users/x/graalvm_installations/graalvm-ce-java19-22.3.0/Contents/Home/bin/node"
Current executable set to '/Users/x/graalvm_installations/graalvm-ce-java19-22.3.0/Contents/Home/bin/node' (arm64).
(lldb) settings set -- target.run-args  "node_modules/.bin/next" "dev"
(lldb) run
Process 15304 launched: '/Users/x/graalvm_installations/graalvm-ce-java19-22.3.0/Contents/Home/bin/node' (arm64)
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
warn  - You have enabled experimental feature (appDir) in next.config.js.
warn  - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
info  - Thank you for testing `appDir` please leave your feedback at https://nextjs.link/app-feedback

Process 15304 stopped
* thread #2, stop reason = EXC_BAD_ACCESS (code=1, address=0x64656c6a66e62070)
    frame #0: 0x0000000111db4314 libgraal-nodejs.dylib`IsolateEnterStub__VmLocatorSymbol__vmLocatorSymbol__bec84cad1f8708102cd8814ef3e496531bf6ff5b__b6484ec9f5c47b82c12ad1112cecc290d374ea64 + 33183284
libgraal-nodejs.dylib`IsolateEnterStub__VmLocatorSymbol__vmLocatorSymbol__bec84cad1f8708102cd8814ef3e496531bf6ff5b__b6484ec9f5c47b82c12ad1112cecc290d374ea64:
->  0x111db4314 <+33183284>: ldr    w5, [x5, #0x10]
    0x111db4318 <+33183288>: mov    w6, #-0x1a2a
    0x111db431c <+33183292>: add    w5, w6, w5, uxth
    0x111db4320 <+33183296>: cmp    w5, #0x4f
Target 0: (node) stopped.
(lldb) thread backtrace
* thread #2, stop reason = EXC_BAD_ACCESS (code=1, address=0x64656c6a66e62070)
  * frame #0: 0x0000000111db4314 libgraal-nodejs.dylib`IsolateEnterStub__VmLocatorSymbol__vmLocatorSymbol__bec84cad1f8708102cd8814ef3e496531bf6ff5b__b6484ec9f5c47b82c12ad1112cecc290d374ea64 + 33183284
    frame #1: 0x0000000100111218 node`napi_create_async_work + 504
    frame #2: 0x000000029549bf84 next-swc.darwin-arm64.node`___lldb_unnamed_symbol7646 + 568
    frame #3: 0x0000000295528984 next-swc.darwin-arm64.node`___lldb_unnamed_symbol9128 + 432
    frame #4: 0x0000000295433ad0 next-swc.darwin-arm64.node`___lldb_unnamed_symbol6387 + 760
    frame #5: 0x00000001000f671c node`v8impl::(anonymous namespace)::FunctionCallbackWrapper::Invoke(v8::FunctionCallbackInfo<v8::Value> const&) + 396
    frame #6: 0x0000000100390094 node`GraalExecuteFunction(JNIEnv_*, GraalIsolate*, int, GraalFunctionCallbackArguments&, _jobject*) + 452
    frame #7: 0x0000000100390f20 node`GraalExecuteFunction2(JNIEnv_*, _jclass*, int, _jobject*, int, _jobject*, _jobject*, int, _jobject*, int, _jobject*) + 400
    frame #8: 0x0000000111db7584 libgraal-nodejs.dylib`IsolateEnterStub__VmLocatorSymbol__vmLocatorSymbol__bec84cad1f8708102cd8814ef3e496531bf6ff5b__b6484ec9f5c47b82c12ad1112cecc290d374ea64 + 33196196
    frame #9: 0x00000001000060c0 node`node::InternalCallbackScope::Close() + 364
    frame #10: 0x0000000100005a04 node`node::InternalCallbackScope::~InternalCallbackScope() + 20
    frame #11: 0x00000001001804b4 node`node::fs::FileHandle::CloseReq::Resolve() + 688
    frame #12: 0x000000010019cae0 node`node::fs::FileHandle::ClosePromise()::$_0::__invoke(uv_fs_s*) + 176
    frame #13: 0x00000001003d0724 node`uv__work_done + 192
    frame #14: 0x00000001003d3ed4 node`uv__async_io + 320
    frame #15: 0x00000001003e5a70 node`uv__io_poll + 1032
    frame #16: 0x00000001003d4364 node`uv_run + 380
    frame #17: 0x0000000100008260 node`node::SpinEventLoop(node::Environment*) + 388
    frame #18: 0x00000001001ef7e8 node`node::NodeMainInstance::Run() + 376
    frame #19: 0x000000010010d294 node`node::Start(int, char**) + 224
    frame #20: 0x00000001005823e8 node`apple_main_new_thread(void*) + 28
    frame #21: 0x000000018e52a06c libsystem_pthread.dylib`_pthread_start + 148

Activity

  1. oubidar-Abderrahim commented on Dec 13, 2022

    @oubidar-Abderrahim
    Member

    Hi, thank you for reporting this issue, We'll take a look into it and get back to you shortly.

  2. patrickpilch commented on Dec 14, 2022

    @patrickpilch
    Author

    When upgrading next to 13.0.7-canary.5 and onwards, this becomes a silent failure where the node process just exits with exit code 1. When ran with NODE_DEBUG=module, the last line I see is node trying to load ... /node_modules/@next/swc-darwin-arm64/next-swc.darwin-arm64.node.

  3. iamstolis commented on Dec 14, 2022

    @iamstolis
    Member

    This issue has the same root as (i.e. is a duplicate of) #5581.

  4. added a commit that references this issue on Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions