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

Spack - define clone function on prototype causes compiler to panic #7410

Open
diasbruno opened this issue May 18, 2023 · 0 comments
Open

Spack - define clone function on prototype causes compiler to panic #7410

diasbruno opened this issue May 18, 2023 · 0 comments
Labels

Comments

@diasbruno
Copy link

diasbruno commented May 18, 2023

Describe the bug

Bundling with spack, when a prototype function is defined with name clone,
the compiler panics.

Details:

npx spack
thread '<unnamed>' panicked at 'cannot access a scoped thread local variable without calling `set` first', /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/scoped-tls-1.0.1/src/lib.rs:168:9
stack backtrace:
   0:     0x7f7aa1afaada - <unknown>
   1:     0x7f7aa1b25c9e - <unknown>
   2:     0x7f7aa1af6e55 - <unknown>
   3:     0x7f7aa1afa8a5 - <unknown>
   4:     0x7f7aa1afc1cf - <unknown>
   5:     0x7f7aa1afbf0b - <unknown>
   6:     0x7f7aa1afc778 - <unknown>
   7:     0x7f7aa169d99a - <unknown>
   8:     0x7f7aa169d726 - <unknown>
   9:     0x7f7a9fa4ea0c - <unknown>
  10:     0x7f7aa16c5ce6 - <unknown>
  11:     0x7f7aa16b42d9 - <unknown>
  12:     0x7f7aa16b31e2 - <unknown>
  13:     0x7f7a9fd27e6f - <unknown>
  14:     0x7f7a9fd26251 - <unknown>
  15:     0x7f7a9faaab3b - <unknown>
  16:     0x7f7a9fb08398 - <unknown>
  17:     0x7f7a9fd2bfe4 - <unknown>
  18:     0x7f7a9fd226e4 - <unknown>
  19:     0x7f7a9fb878ac - <unknown>
  20:     0x7f7ab53ebd05 - worker
  21:     0x7f7ab229fe24 - start_thread
  22:     0x7f7ab23219b0 - __clone3
  23:                0x0 - <unknown>
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: panic detected] { code: 'GenericFailure' }

Input code

function A() {}
A.prototype.clone = function() {};
let a = new A();
let b = a.clone();

Config

Indifferent. Same happens when compiling with npx swc --no-swcrc

Playground link

Couldn't reproduce on payground.

Expected behavior

Not crash.

Actual behavior

thread '<unnamed>' panicked at 'cannot access a scoped thread local variable without calling `set` first', /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/scoped-tls-1.0.1/src/lib.rs:168:9
stack backtrace:
   0:     0x7f7aa1afaada - <unknown>
   1:     0x7f7aa1b25c9e - <unknown>
   2:     0x7f7aa1af6e55 - <unknown>
   3:     0x7f7aa1afa8a5 - <unknown>
   4:     0x7f7aa1afc1cf - <unknown>
   5:     0x7f7aa1afbf0b - <unknown>
   6:     0x7f7aa1afc778 - <unknown>
   7:     0x7f7aa169d99a - <unknown>
   8:     0x7f7aa169d726 - <unknown>
   9:     0x7f7a9fa4ea0c - <unknown>
  10:     0x7f7aa16c5ce6 - <unknown>
  11:     0x7f7aa16b42d9 - <unknown>
  12:     0x7f7aa16b31e2 - <unknown>
  13:     0x7f7a9fd27e6f - <unknown>
  14:     0x7f7a9fd26251 - <unknown>
  15:     0x7f7a9faaab3b - <unknown>
  16:     0x7f7a9fb08398 - <unknown>
  17:     0x7f7a9fd2bfe4 - <unknown>
  18:     0x7f7a9fd226e4 - <unknown>
  19:     0x7f7a9fb878ac - <unknown>
  20:     0x7f7ab53ebd05 - worker
  21:     0x7f7ab229fe24 - start_thread
  22:     0x7f7ab23219b0 - __clone3
  23:                0x0 - <unknown>
node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: panic detected] { code: 'GenericFailure' }

Version

@swc/cli: 0.1.62 @swc/core: 1.3.57

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant