Mailinglist Archive: opensuse-factory (536 mails)

< Previous Next >
[opensuse-factory] Leap 15 - valgrind misreports the number of allocations and amount of memory allocated
All,

I have filed https://bugzilla.opensuse.org/show_bug.cgi?id=1092054 against
valgrind misreporting the number of allocations, and size of memory allocated.
valgrind has correctly reported in all prior openSuSE releases, but not
reports additional allocations (which gets exponentially worse as the number
of allocations in your code increases)

If you have any additional insight, please add it to the bug. Simple test
case:

#include <stdio.h>
#include <stdlib.h>

int main (void) {

int *a = malloc (sizeof *a);
*a = 5;
printf ("a: %d\n", *a);
free (a);
}

Compile *without* optimization, e.g.

$ gcc -std=gnu11 -O0 -o bin/vgtest2 vgtest2.c

Check with valgrind:

$ valgrind ./bin/vgtest2
==3018== Memcheck, a memory error detector
==3018== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3018== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==3018== Command: ./bin/vgtest2
==3018==
a: 5
==3018==
==3018== HEAP SUMMARY:
==3018== in use at exit: 0 bytes in 0 blocks
==3018== total heap usage: 2 allocs, 2 frees, 1,028 bytes allocated
==3018==
==3018== All heap blocks were freed -- no leaks are possible
==3018==
==3018== For counts of detected and suppressed errors, rerun with: -v
==3018== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

All prior openSuSE release correctly show 1-allocation, 4-bytes allocated.

--
David C. Rankin, J.D.,P.E.
--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-factory+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups