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

[WebAssembly] wasm-ld assertion failure on isa<UndefinedData>(sym) #94077

Closed
kripken opened this issue May 31, 2024 · 3 comments · Fixed by #104876
Closed

[WebAssembly] wasm-ld assertion failure on isa<UndefinedData>(sym) #94077

kripken opened this issue May 31, 2024 · 3 comments · Fixed by #104876
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] lld:wasm

Comments

@kripken
Copy link
Member

kripken commented May 31, 2024

wasm-ld: /b/s/w/ir/cache/builder/emscripten-releases/llvm-project/lld/wasm/SyntheticSections.cpp:522: virtual void lld::wasm::GlobalSection::writeBody(): Assertion `isa<UndefinedData>(sym)' failed.

More context and details here, including steps to reproduce:

emscripten-core/emscripten#22008 (comment)

As mentioned there this is a regression, and bisection leads to it likely caused by one of these:

   2024-01-20 sbc@chromium.org [lld][WebAssembly] Fix regression in function signature checking (#78831)
    2024-01-20 sbc@chromium.org [lld][WebAssembly] Match the ELF linker in transitioning away from archive indexes. (#78658)
    2024-01-19 sbc@chromium.org [lld][WebAssembly] Use the archive offset with --whole-archive (#78791)
    2024-01-19 sbc@chromium.org [lld][WebAssembly] Reset context object after each link (#78770)
    2024-01-19 sbc@chromium.org [lld][ELF] Simplify handleLibcall. NFC (#78659)

I'll also email @sbc100 with the output of -Wl,--reproduce as requested (too big to attach here).

@llvmbot
Copy link
Member

llvmbot commented May 31, 2024

@llvm/issue-subscribers-lld-wasm

Author: Alon Zakai (kripken)

``` wasm-ld: /b/s/w/ir/cache/builder/emscripten-releases/llvm-project/lld/wasm/SyntheticSections.cpp:522: virtual void lld::wasm::GlobalSection::writeBody(): Assertion `isa<UndefinedData>(sym)' failed. ```

More context and details here, including steps to reproduce:

emscripten-core/emscripten#22008 (comment)

As mentioned there this is a regression, and bisection leads to it likely caused by one of these:

   2024-01-20 sbc@<!-- -->chromium.org [lld][WebAssembly] Fix regression in function signature checking (#<!-- -->78831)
    2024-01-20 sbc@<!-- -->chromium.org [lld][WebAssembly] Match the ELF linker in transitioning away from archive indexes. (#<!-- -->78658)
    2024-01-19 sbc@<!-- -->chromium.org [lld][WebAssembly] Use the archive offset with --whole-archive (#<!-- -->78791)
    2024-01-19 sbc@<!-- -->chromium.org [lld][WebAssembly] Reset context object after each link (#<!-- -->78770)
    2024-01-19 sbc@<!-- -->chromium.org [lld][ELF] Simplify handleLibcall. NFC (#<!-- -->78659)

I'll also email @sbc100 with the output of -Wl,--reproduce as requested (too big to attach here).

@sbc100
Copy link
Collaborator

sbc100 commented Jun 1, 2024

Am I correct in understanding that this is an LTO-only bug?

@kripken
Copy link
Member Author

kripken commented Jun 1, 2024

Hmm, I don't see any LTO involvement here. All the object files are wasm object files, and I don't see -flto in the final link command. But maybe I'm missing something, where do you see LTO?

sbc100 added a commit to sbc100/llvm-project that referenced this issue Aug 19, 2024
This was broken back in llvm#78658 when we transitioned away from archive
indexes to parsing lazy object files.

Fixes: llvm#94077
Fixes: emscripten-core/emscripten#22008
sbc100 added a commit to sbc100/llvm-project that referenced this issue Aug 19, 2024
This was broken back in llvm#78658 when we transitioned away from archive
indexes to parsing lazy object files.

Fixes: llvm#94077
Fixes: emscripten-core/emscripten#22008
@sbc100 sbc100 closed this as completed in 5403123 Aug 20, 2024
radekdoulik pushed a commit to dotnet/llvm-project that referenced this issue Nov 15, 2024
…s. (llvm#104876)

This was broken back in llvm#78658 when we transitioned away from archive
indexes to parsing lazy object files.

Fixes: llvm#94077
Fixes: emscripten-core/emscripten#22008
radekdoulik pushed a commit to radekdoulik/llvm-project that referenced this issue Nov 22, 2024
…s. (llvm#104876)

This was broken back in llvm#78658 when we transitioned away from archive
indexes to parsing lazy object files.

Fixes: llvm#94077
Fixes: emscripten-core/emscripten#22008
radekdoulik pushed a commit to dotnet/llvm-project that referenced this issue Nov 25, 2024
…s. (llvm#104876)

This was broken back in llvm#78658 when we transitioned away from archive
indexes to parsing lazy object files.

Fixes: llvm#94077
Fixes: emscripten-core/emscripten#22008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] lld:wasm
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants