All of lore.kernel.org
 help / color / mirror / Atom feed
* valgrind tests don't test anything
@ 2020-03-08 18:32 Arkadiusz Drabczyk
       [not found] ` <20200308183221.GA10025-Zrdc6muVEXg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Arkadiusz Drabczyk @ 2020-03-08 18:32 UTC (permalink / raw)
  To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

I'm not sure this is what David Gibson meant in
67b6b33b9b413a450a72135b5dc59c0a1e33e647 when he said:

"At present the valgrinding won't do anything useful for testcases
invoked via a shell script - which includes all the dtc testcases.  I
plan to fix that later."

but if valgrind is called without --leak-check=full as in line 1038 in
tests/run_tests.sh it always returns 0 to the parent process and it
looks like there are no errors but in fact dtc suffers from memory
leaks:

$ valgrind ~/dtc/dtc -O dts t2080qds.dts
(...)
==9428==
==9428== HEAP SUMMARY:
==9428==     in use at exit: 286,968 bytes in 8,355 blocks
==9428==   total heap usage: 11,162 allocs, 2,807 frees, 1,157,178 bytes allocated
==9428==
==9428== LEAK SUMMARY:
==9428==    definitely lost: 5,619 bytes in 174 blocks
==9428==    indirectly lost: 106 bytes in 6 blocks
==9428==      possibly lost: 0 bytes in 0 blocks
==9428==    still reachable: 281,243 bytes in 8,175 blocks
==9428==         suppressed: 0 bytes in 0 blocks
==9428== Rerun with --leak-check=full to see details of leaked memory
==9428==
==9428== For lists of detected and suppressed errors, rerun with: -s
==9428== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

If valgrind invocation in tests/run_tests is changed to something like
this:

VALGRIND="valgrind --leak-check=full --tool=memcheck -q --error-exitcode=$VGCODE"

then `make checkm' fails:

********** TEST SUMMARY
*     Total testcases:  2067
*                PASS:  1552
*                FAIL:  1
*   Bad configuration:  0
*    valgrind errors:   514
* Strange test result:  0
**********
tests/Makefile.tests:92: recipe for target 'checkm' failed
make: *** [checkm] Error 1

-- 
Arkadiusz Drabczyk <arkadiusz-42WfZ8EewN5g9hUCZPvPmw@public.gmane.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-09 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-08 18:32 valgrind tests don't test anything Arkadiusz Drabczyk
     [not found] ` <20200308183221.GA10025-Zrdc6muVEXg@public.gmane.org>
2020-03-09  8:29   ` David Gibson
     [not found]     ` <20200309082920.GF617846-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2020-03-09 16:31       ` Arkadiusz Drabczyk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.