Skip to contentSkip to conversation

Prevent vma05 from passing wrongly when no coredump generated at all

PATCH In review Marius Kittler 2 participants 2 messages Oct 11, 2023 – Oct 26, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Prevent vma05 from passing wrongly when no coredump generated at all

When debugging this test I noticed that it passes when no coredump could be generated at all. This change adds a check to verify whether the test is provoking a coredump as intended.

---
 testcases/kernel/mem/vma/vma05.sh | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/mem/vma/vma05.sh +1 -0
index c9e4becdb..bcc3b9623 100755
@@ -54,6 +54,7 @@ vma_report_check()
 
 	rm -rf core*
 	{ vma05_vdso; } > /dev/null 2>&1
+	[ -s ./core* ] || tst_brk TBROK "[vdso] no backtrace generated"
 	TRACE=$(gdb -silent -ex="thread apply all backtrace" -ex="quit"\
 		vma05_vdso ./core* 2> /dev/null)
 	if echo "$TRACE" | grep -qF "??"; then
Signature · 5 lines
2.42.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi Marius,

Quoted 3 lines

When debugging this test I noticed that it passes when no coredump could be generated at all. This change adds a check to verify whether the test is provoking a coredump as intended.

I'm sorry, I haven't noticed this when I was merging my old patch doing similar check:

https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/
https://lore.kernel.org/ltp/[email protected]/

Quoted 10 lines
---
 testcases/kernel/mem/vma/vma05.sh | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/mem/vma/vma05.sh +0 -0
index c9e4becdb..bcc3b9623 100755

testcases/kernel/mem/vma/vma05.sh vma_report_check() · line 57

Quoted 4 lines
testcases/kernel/mem/vma/vma05.sh +1 -0
@@ -54,6 +54,7 @@ vma_report_check()
 
 	rm -rf core*
 	{ vma05_vdso; } > /dev/null 2>&1
+	[ -s ./core* ] || tst_brk TBROK "[vdso] no backtrace generated"

Maybe checking with -s (size > 0) is better than for simple -f (file exists). But OTOH how often can happen that backtrace gets generated but it's empty? When no space left? But half of the LTP tests would blow up.

I'm closing this in patchwork because it's not applicable now, but feel free to send rebased v2.

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp