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

self-hosted wasm linker bug #23025

Open
Rexicon226 opened this issue Feb 27, 2025 · 0 comments
Open

self-hosted wasm linker bug #23025

Rexicon226 opened this issue Feb 27, 2025 · 0 comments

Comments

@Rexicon226
Copy link
Contributor

follow-up on #22488

Apply this diff

diff --git a/test/link/wasm/export-data/build.zig b/test/link/wasm/export-data/build.zig
index 1cddde208d..865017a22f 100644
--- a/test/link/wasm/export-data/build.zig
+++ b/test/link/wasm/export-data/build.zig
@@ -13,9 +13,6 @@ pub fn build(b: *std.Build) void {
         }),
     });
     lib.entry = .disabled;
-    // Disabled to work around the Wasm linker crashing.
-    // Can be reproduced by commenting out the line below.
-    lib.bundle_ubsan_rt = false;
     lib.use_lld = false;
     lib.root_module.export_symbol_names = &.{ "foo", "bar" };
test
└─ zig build-exe lib Debug wasm32-freestanding failure
error: warning(object): unimplemented: element section in /Users/david/Code/zig/test/link/wasm/export-data/.zig-cache/o/00d7fe87c6978366952f114cc1712760/lib.wasm.o null
thread 22727590 panic: attempt to use null value
/Users/david/Code/zig/src/link/Wasm/Object.zig:1358:72: 0x10db77be3 in parse (zig)
        const ptr = wasm.object_table_imports.getPtr(table_import_name).?;
                                                                       ^
/Users/david/Code/zig/src/link/Wasm.zig:3063:36: 0x10db6c54f in parseObject (zig)
    const object = try Object.parse(wasm, file_contents, obj.path, null, wasm.object_host_name, &ss, obj.must_link, gc_sections);
                                   ^
/Users/david/Code/zig/src/link/Wasm.zig:3036:21: 0x10d7e422b in openParseObjectReportingFailure (zig)
    wasm.parseObject(obj) catch |err| {
                    ^
/Users/david/Code/zig/src/link/Wasm.zig:3808:40: 0x10d4caba7 in flushModule (zig)
        openParseObjectReportingFailure(wasm, module_obj_path);
                                       ^
/Users/david/Code/zig/src/link/Wasm.zig:3384:28: 0x10d30811f in flush (zig)
    return wasm.flushModule(arena, tid, prog_node);
                           ^
/Users/david/Code/zig/src/link.zig:833:77: 0x10d1a4fbb in flush (zig)
                return @as(*tag.Type(), @fieldParentPtr("base", base)).flush(arena, tid, prog_node);
                                                                            ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant