These are chat archives for Snaipe/Criterion

22nd
Feb 2016
Dominik
@kaidowei
Feb 22 2016 15:37
@Snaipe Hi, I worked with your patch for the empty format string warnings and something emerged:
Valgrind doesn't like asserts, with format string like " cr_assert_eq(i, 1, "i=%d", i);" if the patch is applied against 2.2.0
==19902== Syscall param write(buf) points to uninitialised byte(s)
==19902== at 0x53B988D: ??? (syscall-template.S:81)
==19902== by 0x4E42AD7: pipe_write (pipe.c:282)
==19902== by 0x4E447F3: criterion_send_event (event.c:160)
==19902== by 0x4019C7: cslist_cslist_for_each_with_item_impl (container.c:68)
==19902== by 0x4E425C5: criterion_internal_test_main (test.c:56)
==19902== by 0x4013A5: cslist_cslist_for_each_with_item_jmp (container.c:50)
==19902== by 0x4E3F6F8: run_test_child (runner.c:180)
==19902== by 0x4E41808: run_worker (worker.c:84)
==19902== by 0x4E4193C: spawn_test_worker (worker.c:111)
==19902== by 0x4E40FCE: run_test (runner_coroutine.c:66)
==19902== by 0x4E41506: run_next_test (runner_coroutine.c:162)
==19902== by 0x4E408F0: run_tests_async (runner.c:410)
==19902== Address 0x5f01af8 is 56 bytes inside a block of size 57 alloc'd
==19902== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19902== by 0x4E4479B: criterion_send_event (event.c:156)
==19902== by 0x4019C7: cslist_cslist_for_each_with_item_impl (container.c:68)
==19902== by 0x4E425C5: criterion_internal_test_main (test.c:56)
==19902== by 0x4013A5: cslist_cslist_for_each_with_item_jmp (container.c:50)
==19902== by 0x4E3F6F8: run_test_child (runner.c:180)
==19902== by 0x4E41808: run_worker (worker.c:84)
==19902== by 0x4E4193C: spawn_test_worker (worker.c:111)
==19902== by 0x4E40FCE: run_test (runner_coroutine.c:66)
==19902== by 0x4E41506: run_next_test (runner_coroutine.c:162)
==19902== by 0x4E408F0: run_tests_async (runner.c:410)
==19902== by 0x4E40BEF: criterion_run_all_tests_impl (runner.c:457)
==19902== Uninitialised value was created by a heap allocation
==19902== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19902== by 0x40196D: cslist_cslist_for_each_with_item_impl (container.c:68)
==19902== by 0x4E425C5: criterion_internal_test_main (test.c:56)
==19902== by 0x4013A5: cslist_cslist_for_each_with_item_jmp (container.c:50)
==19902== by 0x4E3F6F8: run_test_child (runner.c:180)
==19902== by 0x4E41808: run_worker (worker.c:84)
==19902== by 0x4E4193C: spawn_test_worker (worker.c:111)
==19902== by 0x4E40FCE: run_test (runner_coroutine.c:66)
==19902== by 0x4E41506: run_next_test (runner_coroutine.c:162)
==19902== by 0x4E408F0: run_tests_async (runner.c:410)
==19902== by 0x4E40BEF: criterion_run_all_tests_impl (runner.c:457)
==19902== by 0x4E40CCB: criterion_run_all_tests (runner.c:482)
==19902==
the assert-line from above is in container.c:68
Franklin Mathieu
@Snaipe
Feb 22 2016 15:41
Huh. Maybe valgrind consider manipulating non-aligned addresses as an error
although I'm not getting why it would complain about the buffer not being initialized
Franklin Mathieu
@Snaipe
Feb 22 2016 15:48
I am able to reproduce it locally, so I'll experiment a bit on it and report back.
Franklin Mathieu
@Snaipe
Feb 22 2016 15:54
Nevermind, I'm dumb, there's an out-of-bounds access during the assertion
there we go, fixed
Dominik
@kaidowei
Feb 22 2016 16:23
thanks :)