The investigation started with a Postgres server error log showing a segmentation fault on multiple EC2 nodes. The team quickly ruled out hardware issues and looked into the query logs to identify the problematic query pattern. They found that running this specific query would trigger a segfault, but not when JIT was disabled. By analyzing core dumps and using tools like `gdb`, they were able to reproduce the issue in a test environment. The key insight came from examining the generated assembly code for the query, which revealed an infinite loop caused by incorrect handling of address relocation on Arm64 architectures. This problem arose because LLVM's JIT compiler allocated separate sections for code and data without considering the Arm64 ABI requirements, leading to gaps in memory allocation that exceeded the maximum segment size. The team worked with the LLVM community to understand the issue and eventually found a patch that fixed the bug by introducing a custom `SectionMemoryManager` to respect the Arm64 ABI. This patch was committed and released in Postgres version 17.1, improving the reliability of Postgres on Arm64.