web-infra-dev / rspack

The fast Rust-based web bundler with webpack-compatible API 🦀️
https://rspack.dev
MIT License
9.11k stars 521 forks source link

[Bug]: memory iterator issue #7393

Closed ii64 closed 2 weeks ago

ii64 commented 1 month ago

System Info

  System:
    OS: Linux 6.8 Arch Linux
    CPU: (12) x64 AMD Ryzen 5 4600H with Radeon Graphics
    Memory: 17.69 GB / 62.22 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.18.2 - /usr/bin/node
    Yarn: 1.22.22 - /usr/bin/yarn
    npm: 10.5.2 - /usr/bin/npm
    pnpm: 9.3.0 - /usr/bin/pnpm
  Browsers:
    Brave Browser: 123.1.64.116
    Chrome: 126.0.6478.114
  npmPackages:
    @rspack/cli: workspace:* => 1.0.0-beta.1 

Details

rspack/rsbuild crashed with iterator/memory issue, empty backtrace

image image

Reproduce link

https://github.com/ii64/rspack-repro-import-meta-url

Reproduce Steps

  1. Run pnpm build:webpack, it'll show you errors, and generated files persisted Run pnpm build:rsbuild or pnpm build:rspack, got run-time abort/segfault/napi stuff/iterator capacity overflow
LingyuCoder commented 1 month ago

After replacing the ts-loader to builtin:swc-loader, do not meet the same issue. Just build like webpack and report lots of errors:

image

h-a-n-a commented 1 month ago

Cannot reproduce this issue on arch. The only error it shows is related to ts-loader.

image
ii64 commented 1 month ago

I have updated the repro config, got rsbuild panic on crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs:95 image

h-a-n-a commented 2 weeks ago

I have updated the repro config, got rsbuild panic on crates/rspack_plugin_javascript/src/parser_plugin/import_meta_plugin.rs:95 image

Sorry for the late reply. The context you provided is not an absolute path, this breaks the invariant of bundler internals. We are going to improve that.