Skip to content

[clang] Clang crashes when an objective C exception is attempted to be caught when -fwasm-exceptions is enabled on a wasm{32,64} target #123659

Open
@Frityet

Description

@Frityet

Crash info

Reproducer:

extern void f();

int main()
{
	@try {
		f();
	} @catch(id) {

	}
}

Command:

# Crash reproducer for Homebrew clang version 19.1.6
# Driver args: "t.m" "-target" "wasm32-unknown-none" "-fwasm-exceptions"
# Original command:  "/usr/local/Cellar/llvm/19.1.6/bin/clang-19" "-cc1" "-triple" "wasm32-unknown-none" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "t.m" "-mrelocation-model" "static" "-mframe-pointer=none" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-target-feature" "+exception-handling" "-mllvm" "-wasm-enable-eh" "-target-feature" "+multivalue" "-target-feature" "+reference-types" "-target-cpu" "generic" "-fvisibility=hidden" "-debugger-tuning=gdb" "-fdebug-compilation-dir=/Users/frityet/Documents/scratch" "-target-linker-version" "1022.1" "-fcoverage-compilation-dir=/Users/frityet/Documents/scratch" "-resource-dir" "/usr/local/Cellar/llvm/19.1.6/lib/clang/19" "-internal-isystem" "/usr/local/Cellar/llvm/19.1.6/lib/clang/19/include" "-internal-isystem" "/include" "-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-runtime=gnustep" "-fobjc-encode-cxx-class-template-spec" "-fobjc-exceptions" "-fexceptions" "-exception-model=wasm" "-fcolor-diagnostics" "-o" "/var/folders/ps/cqv_3ytx5nn59k5q3k17th500000gn/T/t-e67633.o" "-x" "objective-c" "t.m"
 "/usr/local/Cellar/llvm/19.1.6/bin/clang-19" "-cc1" "-triple" "wasm32-unknown-none" "-emit-obj" "-dumpdir" "a-" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "t.m" "-mrelocation-model" "static" "-mframe-pointer=none" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-target-feature" "+exception-handling" "-mllvm" "-wasm-enable-eh" "-target-feature" "+multivalue" "-target-feature" "+reference-types" "-target-cpu" "generic" "-fvisibility=hidden" "-debugger-tuning=gdb" "-fdebug-compilation-dir=/Users/frityet/Documents/scratch" "-target-linker-version" "1022.1" "-fcoverage-compilation-dir=/Users/frityet/Documents/scratch" "-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fobjc-runtime=gnustep" "-fobjc-encode-cxx-class-template-spec" "-fobjc-exceptions" "-fexceptions" "-exception-model=wasm" "-fcolor-diagnostics" "-x" "objective-c" "t-3e83b8.m"

Cannot be reproduced on godbolt due to the fact that godbolt objective C does not allow for clang to be selected as the compiler for some reason?

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions