Company
Date Published
Author
Anthonin Bonnefoy, Mitch Ward, Gillian McGarvey
Word count
3540
Language
English
Hacker News points
6

Summary

The summary of the text is as follows: Postgres was experiencing crashes with a segmentation fault error on multiple EC2 nodes, specifically after running an expensive query that scanned a large database table. The team investigated the issue and found that it was caused by a bug in LLVM's JIT compilation for Arm64 architectures. The bug resulted in incorrect memory allocation and relocation of sections, leading to undefined behavior and crashes. The team identified the root cause as a failure to enforce the Arm64 ABI requirements, which led to gaps in the memory allocation. They discovered that modern versions of LLVM use a new dynamic linker, JITLink, which aims to deprecate RuntimeDyld, and thus was not impacted by this bug. To resolve the issue, Thomas Munro, a Postgres developer, patched MikaelSmith's work into the Postgres source tree and shipped Postgres with a fixed memory manager that respects the Arm64 ABI, fixing the issue in Postgres versions 17.1, 16.5, 15.9, 14.14, 13.17, and 12.21.