Just compile

```c
int main(int argc, char **argv) {
  int x = -1;
  int arr[x];
  return 0;
}
```

with
`clang  -fsanitize=vla-bound -ftrivial-auto-var-init=zero`
or with
`clang  -fsanitize=vla-bound -ftrivial-auto-var-init=pattern`
Run the executable and see that UBSan rt catches segfault:
`UndefinedBehaviorSanitizer:DEADLYSIGNAL`.


With
`clang  -fsanitize=vla-bound -ftrivial-auto-var-init=uninitialized`
UBSan works fine and the process terminates with zero exit-code.

Observed in clang-17.0.6 and clang-18.1.3.
OSes: Ubuntu-24.04 and ArchLinux.
[clang][UBSan] Segfault with -fsanitize=vla-bound -ftrivial-auto-var-init=zero/pattern
This is a GitHub Issue
repo:llvm-project
owner:llvm
Title : [clang][UBSan] Segfault with -fsanitize=vla-bound -ftrivial-auto-var-init=zero/pattern
Issue date:

--- start body ---
Just compile

```c
int main(int argc, char **argv) {
  int x = -1;
  int arr[x];
  return 0;
}
```

with
`clang  -fsanitize=vla-bound -ftrivial-auto-var-init=zero`
or with
`clang  -fsanitize=vla-bound -ftrivial-auto-var-init=pattern`
Run the executable and see that UBSan rt catches segfault:
`UndefinedBehaviorSanitizer:DEADLYSIGNAL`.


With
`clang  -fsanitize=vla-bound -ftrivial-auto-var-init=uninitialized`
UBSan works fine and the process terminates with zero exit-code.

Observed in clang-17.0.6 and clang-18.1.3.
OSes: Ubuntu-24.04 and ArchLinux.
--- end body ---
