compiler-explorer / compiler-explorer/compiler-explorer

[BUG]: Exceptions aren't correctly set up for ARM 64 architecture

Open
#8,293 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
19.1k
Forks
2.1k
Avg merge
3d 15h
Merged PRs (30d)
67

Description

### Describe the bug

Any code throwing an exception seems to yield a segmentation fault when run on an ARM64 architecture, both with clang and gcc.

### Steps to reproduce

1. Visit godbolt.org
2. Choose any recent ARM64 (e.g. ARM 64 gcc 15.2.0)
3. Run the following snippet:

```c++
#include

int main()
{
try
{
std::vector empty;
int foo = empty.at(1);
}
catch(...)
{

}
return 0;
}
```

### Expected behavior

Output like:

```
ASM generation compiler returned: 0
Execution build compiler returned: 0
Program returned: 0
```

(obtained x86-64 gcc 15.2.0)

Instead we get:

```
ASM generation compiler returned: 0
Execution build compiler returned: 0
Program returned: 139
Program terminated with signal: SIGSEGV
```

### Reproduction link

https://godbolt.org/z/M7fYf8xPv

### Screenshots

Not applicable

### Operating System

NA

### Browser version

Firefox 144.0.2 (aarch64)

Contributor guide

Open the contributing guide

Research direction

Start with the reproduction link and run the provided C++ snippet on ARM64 gcc and clang, then compare it with the x86-64 result. Trace the compiler-explorer execution path for ARM64 exception handling; done means the exception is caught and the program returns 0 instead of terminating with SIGSEGV.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.