Skip to contentSkip to conversation

test: use a more stable data item

PATCH In review Kris Van Hees 2 participants 2 messages Apr 26, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test: use a more stable data item

The runtime bounds check exception for dynamically sized arrays in kernel structures depended on a kernel symbol that is not quite as stable as expected. Use a member from the mm_struct instead.

---
 test/unittest/arrays/tst.ctf-dynsized-bounds-runtime.d | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
test/unittest/arrays/tst.ctf-dynsized-bounds-runtime.d +1 -1
index 62c2e9a5..4d8dfd0b 100644
@@ -15,7 +15,7 @@
 BEGIN
 {
 	i = pid - pid;			/* Non-constant 0 value. */
-	trace(`__start_BTF[i]);
+	trace(curthread->mm->cpu_bitmap[i]);
 	exit(0);
 }
 
Signature · 1 line
2.42.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Kris Van Hees

The runtime bounds check exception for dynamically sized arrays in kernel structures depended on a kernel symbol that is not quite as stable as expected. Use a member from the mm_struct instead.

Your assumption that it was analyzed in any way for stability is touching, but inaccurate :P

Pure gut feeling replaced with something a bit more obviously sorta stable (at least it needs more work to massively change it upstream, and massive mm changes are fairly rare):

Quoted 1 line