[llvm] [llvm-debuginfo-analyzer] Fix crash with WebAssembly dead code (PR #141616)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 17 11:10:33 PDT 2025


================
@@ -0,0 +1,124 @@
+# REQUIRES: x86-registered-target
+
+# llvm-debuginfo-analyzer crashes on dead code
+# https://github.com/llvm/llvm-project/issues/136772
+
+# For the attached reproducer:
+# llvm-dwarfdump out/lzma-lzmadec.wasm --all
+#
+# shows:
+#
+# 0x000002b3:   DW_TAG_subprogram
+#                 DW_AT_low_pc	(dead code)
+#                 DW_AT_high_pc	(0x00000362)
+#                 DW_AT_frame_base	(DW_OP_WASM_location 0x0 0x6, DW_OP_stack_value)
+
+# llvm-debuginfo-analyzer out/lzma-lzmadec.wasm --print=instructions
+#
+# crashes and shows a stack dump:
+#
+# PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/
+# and include the crash backtrace.
+# Stack dump:
+# 0. Program arguments: llvm-debuginfo-analyzer out/lzma-lzmadec.wasm --print=instructions
+
----------------
dwblaikie wrote:

This commentary, and the name of the test file are probably not suitable/may be confusing - they describe the state of the world before this patch, and in somewhat vague terms "this complex test causes this thing to crash" rather than the specific issue it's been debugged down to.





Something more like "wasm-32bit-tombstone" might be a more suitable title, and a sentence describing "test that DWARF tombstones are correctly detected/respected in wasm 32 bit object files"? (& then proceed to describe the test case as done below - creating a single function, tombstoning it in the assembly, etc)

https://github.com/llvm/llvm-project/pull/141616


More information about the llvm-commits mailing list