Skip to content

Using -fsanitize=undefined with -static segfault the binary #51538

@sylvestre

Description

@sylvestre
Bugzilla Link 52196
Version unspecified
OS Linux
CC @Kojoley

Extended Description

With

-- foo.cpp --

int main() {
	return 0;
}
$ clang-14 -static -fsanitize=undefined foo.cpp -lstdc++ && ./a.out
segmentation fault  ./a.out

With gcc

$ gcc-10 -static -fsanitize=undefined foo.cpp -lstdc++ && ./a.out && echo $?
0

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillacompiler-rt:ubsanUndefined behavior sanitizerconfirmedVerified by a second party

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions