Skip to contentSkip to conversation

Fix pahole segfault with --show_reorg_steps option

PATCH Applied [email protected] 2 participants 2 messages May 20, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Fix pahole segfault with --show_reorg_steps option

This function call seems to mistakenly use conf directly rather than cconf which protects against conf being null

This makes pahole segfault seemingly whenever --show_reorg_steps is used, for example: ./pahole -R -S -C task_struct

---
 dwarves_fprintf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dwarves_fprintf.c +1 -1
index 4407fd1..1ec478c 100644
@@ -2007,7 +2007,7 @@ next_member:
 
 		printed += fprintf(fp, " */\n");
 	}
-	cacheline = (cconf.base_offset + type->size) % conf_fprintf__cacheline_size(conf);
+	cacheline = (cconf.base_offset + type->size) % conf_fprintf__cacheline_size(&cconf);
 	if (cacheline != 0)
 		printed += fprintf(fp, "%.*s/* last cacheline: %u bytes */\n",
 				   cconf.indent, tabs,
Signature · 1 line
2.39.5
Applied
#1 lore raw
Quoted 7 lines · On 20/05/2025 11:13, [email protected] wrote:

This function call seems to mistakenly use conf directly rather than cconf which protects against conf being null

This makes pahole segfault seemingly whenever --show_reorg_steps is used, for example: ./pahole -R -S -C task_struct

Applied to the next branch of

https://git.kernel.org/pub/scm/devel/pahole/pahole.git/

Thank you!

Quoted 19 lines

---
 dwarves_fprintf.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
dwarves_fprintf.c +1 -1
index 4407fd1..1ec478c 100644
@@ -2007,7 +2007,7 @@ next_member:
 
          printed += fprintf(fp, " */\n");
      }
-    cacheline = (cconf.base_offset + type->size) %
 conf_fprintf__cacheline_size(conf);
+    cacheline = (cconf.base_offset + type->size) %
 conf_fprintf__cacheline_size(&cconf);
      if (cacheline != 0)

         printed += fprintf(fp, "%.*s/* last cacheline: %u bytes */\n", cconf.indent, tabs,