[llvm] [ORC][JITLink] Fix unitialised JIT dump header (PR #175204)

Anthonin Bonnefoy via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 9 09:14:41 PST 2026


https://github.com/bonnefoa created https://github.com/llvm/llvm-project/pull/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.

>From 143fa3637068fd6e10ea43c8590bc319d82bd5e1 Mon Sep 17 00:00:00 2001
From: Anthonin Bonnefoy <anthonin.bonnefoy at datadoghq.com>
Date: Fri, 9 Jan 2026 18:01:41 +0100
Subject: [PATCH] [ORC][JITLink] Fix unitialised JIT dump header

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.
---
 llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderPerf.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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