Chasing Elusive Memory Bugs in GPU Programs
Anubhab Ghosh*, Ajay Nayak*, Dhananjay Rao Thallikar Shyam, Arkaprava Basu · 2026
Read Chasing Elusive Memory Bugs in GPU Programs by Anubhab Ghosh*, Ajay Nayak*, Dhananjay Rao Thallikar Shyam, Arkaprava Basu (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-21552.txt.
Introduction
Anubhab Ghosh, Ajay Nayak, Dhananjay Rao Thallikar Shyam, and Arkaprava Basu hunt elusive memory bugs in graphics processor programs. Out-of-bounds memory access can break security and crash GPU software. The nasty cases hide until one specific input triggers them.
All current detectors need the bug to fire during a test run before they can see it. If no test input triggers it, the bug ships. The authors report such input-dependent bugs found in the wild. Their work pushes detection toward finding the flaw in the code itself, before the one bad input ever arrives.
Catalog record
| CREATOR | Anubhab Ghosh*, Ajay Nayak*, Dhananjay Rao Thallikar Shyam, Arkaprava Basu |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 67 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2601-21552
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Chasing Elusive Memory Bugs in GPU Programs Anubhab Ghosh*, Ajay Nayak*, Dhananjay Rao Thallikar Shyam, Arkaprava Basu Abstract Memory safety bugs, such as out-of-bound accesses (OOB) in GPU programs, can compromise the security and reliability of GPU-accelerated software. We report the existence of input-dependent OOBs in the wild that manifest only under specific inputs. All existing tools to detect OOBs in GPU programs rely on runtime techniques that require an OOB to manifest for detection. Thus, input-dependent OOBs elude them. We also discover intra-allocation OOBs that arise in the presence of logical partitioning of a memory allocation into multiple data structures. Existing techniques are oblivious to the possibility of such OOBs. We make a key observation that the presence (or absence) of semantic relations among program variables, which determines the size of allocations (CPU code) and those calculating offsets into memory allocations (GPU code), helps identify the absence (or presence) of OOBs. We build SCuBA, a first-of-its-kind compile-time technique that analyzes CPU and GPU code to capture such semantic relations (if present). It uses a SAT solver to check if an OOB access is possible under any input, given the captured relations expressed as constraints. It further analyzes GPU code to track logical partitioning of memory allocations for detecting intra-allocation OOB. Compared to NVIDIA’s Compute sanitizer that misses 45 elusive memory bugs across 20 programs, SCuBA misses none with no false alarms. 1 1 footnotetext: Both authors contributed equally. I Introduction A recent article by Google’s Project Zero highlights memory safety bugs as a key vulnerability of the software ecosystem [ 41 ] . It reports that over 40\% of the reported vulnerabilities are due to out-of-bound (OOB) accesses, even after decades of research in detecting them [ 32 , 30 , 44 , 14 , 24 , 7 , 37 , 51 , 53 , 45 , 36 , 19 , 23 ] . An OOB occurs when a program accesses a memory allocation outside its bounds. These bugs are common in programs written in memory-unsafe languages that allow pointer manipulations, such as C and C++. The OOBs often serve as doors to security vulnerabilities, and they can cause crashes and incorrect results, threatening software reliability [ 41 , 42 ] . Today, GPU programs are a key component of the software ecosystem – from AI/ML to HPC [ 13 , 1 ] . The primary languages used to program GPUs, e.g., CUDA [ 34 ] , OpenCL [ 15 ] , HIP [ 2 ] , and OpenACC [ 6 ] , are dialects of C++. Like C/C++, GPU programs written in these languages are vulnerable to memory safety bugs. Recent works demonstrated that attackers can exploit OOBs in GPU programs to critically threaten the security and privacy of software [ 16 , 9 , 38 ] . Several recent works focus on detecting memory safety bugs in GPU programs [ 33 , 50 , 55 , 10 , 27 , 26 ] . At a high level, they all follow the same basic principle – maintain metadata for every memory allocation and instrument memory instructions in the kernel to detect safety violations at runtime. Some adopt a software-only approach [ 33 , 50 , 10 , 12 ] while others propose new hardware to limit the overheads of checks at runtime [ 27 , 55 , 26 ] . Limitations of prior works: We notice that all existing techniques rely on runtime dynamic analysis. Consequently, they suffer from a fundamental shortcoming – they require memory safety bugs to manifest during execution for detection. However, a bug may not manifest in every execution of a buggy program. Arguably, the most critical bugs to catch are the elusive ones – those that do not manifest in many executions and thus, are more likely to escape software testing. However, when they do manifest, these bugs (e.g., OOBs) can cause unpredictable and intermittent disruptions. We demonstrate that such elusive OOBs exist in the wild! We discover the existence of tens of input-dependent OOBs in open-source CUDA programs (kernels) and popular libraries. These OOBs manifest only when a GPU-accelerated program is executed with specific inputs, i.e., depends on the input. Unfortunately, existing techniques are highly susceptible to missing such elusive OOBs. They would need a stroke of luck in the form of ‘right’ inputs to manifest these bugs during testing, so that they can detect these input-dependent OOBs before the bugs may cause intermittent failures and/or open security vulnerabilities during production deployment. Next, we discover the possibility of a new type of bug in CUDA programs – intra-allocation OOB. Many CUDA programs logically partition a single buffer (memory allocation) into multiple different data structures. Such a program structure is often forced upon by the constraints of the programming language. For example, CUDA allows programmers to allocate only one buffer in the scratchpad (shared memory) at runtime , a.k.a., dynamic shared memory [ 17 ] . If the program logic requires multiple data structures in the shared memory, programmers must logically partition the buffer (allocation). In such programs, an intra-allocation OOB occurs when an instruction accesses a data structure other than the one it was supposed to, where both the data structures are carved out of the same memory allocation. The existing techniques, however, track only memory allocation boundaries and are agnostic of the partitioning of an allocation into multiple data structures. Consequently, they are incapable of detecting intra-allocation OOBs. Furthermore, prior software-only works [ 50 , 33 , 10 ] add significant performance and memory overhead due to the need to track allocation and memory accesses at runtime. Others propose significant new hardware to limit overheads [ 26 , 55 , 27 ] . Both pose significant challenges to wider adoption. Goals and Insights: We set out to create a first-of-its-kind static analysis (compile-time) technique to detect elusive input-dependent and intra-allocation OOBs, without requiring hardware modifications and runtime overheads. The key challenge is to detect OOBs by analyzing only the source code during compilation when the actual inputs to the program are unknown. To this end, we make a key observation: bug-free CUDA programs naturally relate program variables that determine the sizes of memory allocations to the offsets (indices) of GPU memory instructions that access those allocations. An absence of a semantic relation between these variables indicates the possibility of input-dependent OOBs. Importantly, the semantic relations are inferable from the source thanks to the use of common program variables. For example, it is typical for the host (CPU) code to decide memory allocation size based on input problem size (e.g., matrix size). Usually, the input size also determines the number of threads (a.k.a., thread grid dimension) that the GPU program (i.e., kernel) is launched with. Each GPU thread would then use its unique thread identifier within the grid to derive the offset(s) into an allocation that it must compute on. The range of values of thread identifiers is bounded by the dimension of the thread grid. In effect, this binds the offsets of memory instructions to the size of the memory allocations it accesses. An absence of such relations among the variables indicates the presence of OOBs, even if it is yet