[llvm] 91dafc7 - [ORC][JITLink] Fix unitialised JIT dump header (#175204)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 11 19:13:36 PST 2026


Author: Anthonin Bonnefoy
Date: 2026-01-12T14:13:31+11:00
New Revision: 91dafc7f40541ca18943c0370e4408578e60cb64

URL: https://github.com/llvm/llvm-project/commit/91dafc7f40541ca18943c0370e4408578e60cb64
DIFF: https://github.com/llvm/llvm-project/commit/91dafc7f40541ca18943c0370e4408578e60cb64.diff

LOG: [ORC][JITLink] Fix unitialised JIT dump header (#175204)

When trying to perf inject JIT dump generatd through the perf plugin,
perf fails with the following error:
```
jitdump file contains invalid or unsupported flags 0xf5880666c26c
0x2b750 [0xa8]: failed to process type: 10 [Operation not permitted]
```
It turns out that Header's Flags field was never initialized, so the
value could be random.
This patch fixes the issue by initialising all Header's fields.

Co-authored-by: Lang Hames <lhames at gmail.com>

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderPerf.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderPerf.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderPerf.cpp
index eb69119bcafee..886422218a4e7 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderPerf.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderPerf.cpp
@@ -241,7 +241,7 @@ void CloseMarker(PerfState &State) {
 }
 
 static Expected<Header> FillMachine(PerfState &State) {
-  Header Hdr;
+  Header Hdr = {0, 0, 0, 0, 0, 0, 0, 0};
   Hdr.Magic = LLVM_PERF_JIT_MAGIC;
   Hdr.Version = LLVM_PERF_JIT_VERSION;
   Hdr.TotalSize = sizeof(Hdr);


        


More information about the llvm-commits mailing list