Strange.  I only have an Ubuntu 18.04 machine and the latest valgrind is
3.13.  I downloaded the Fedora 28 docker image and built in there, and it
definitely complains. Output below:
[root@4fe07db648b4 home]# gcc p.c -lpthread -o p
[root@4fe07db648b4 home]# ./p
start
thread created
thread running
done
[root@4fe07db648b4 home]# valgrind ./p
==137== Memcheck, a memory error detector
==137== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==137== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==137== Command: ./p
==137==
start
thread created
thread running
==137== Invalid write of size 8
==137==    at 0x4C35E5F: memset (vg_replace_strmem.c:1251)
==137==    by 0x400873: main (in /home/p)
==137==  Address 0x54281d8 is 60,760 bytes inside a block of size 65,536
alloc'd
==137==    at 0x4C2EE0B: malloc (vg_replace_malloc.c:299)
==137==    by 0x4007DF: main (in /home/p)
==137==
==137== Invalid write of size 8
==137==    at 0x4C35E54: memset (vg_replace_strmem.c:1251)
==137==    by 0x400873: main (in /home/p)
==137==  Address 0x54281e0 is 60,768 bytes inside a block of size 65,536
alloc'd
==137==    at 0x4C2EE0B: malloc (vg_replace_malloc.c:299)
==137==    by 0x4007DF: main (in /home/p)
==137==
==137== Invalid write of size 8
==137==    at 0x4C35E57: memset (vg_replace_strmem.c:1251)
==137==    by 0x400873: main (in /home/p)
==137==  Address 0x54281e8 is 60,776 bytes inside a block of size 65,536
alloc'd
==137==    at 0x4C2EE0B: malloc (vg_replace_malloc.c:299)
==137==    by 0x4007DF: main (in /home/p)
==137==
==137== Invalid write of size 8
==137==    at 0x4C35E5B: memset (vg_replace_strmem.c:1251)
==137==    by 0x400873: main (in /home/p)
==137==  Address 0x54281f0 is 60,784 bytes inside a block of size 65,536
alloc'd
==137==    at 0x4C2EE0B: malloc (vg_replace_malloc.c:299)
==137==    by 0x4007DF: main (in /home/p)
==137==
done
==137==
==137== HEAP SUMMARY:
==137==     in use at exit: 0 bytes in 0 blocks
==137==   total heap usage: 3 allocs, 3 frees, 66,832 bytes allocated
==137==
==137== All heap blocks were freed -- no leaks are possible
==137==
==137== For counts of detected and suppressed errors, rerun with: -v
==137== ERROR SUMMARY: 37 errors from 4 contexts (suppressed: 0 from 0)
[root@4fe07db648b4 home]# valgrind --version
valgrind-3.14.0


On Wed, Dec 12, 2018 at 9:36 PM John Reiser <jrei...@bitwagon.com> wrote:

> > - I have reproduced this on valgrind 3.10 and 3.13
>
> It works correctly (no complaints) on x86_64 under valgrind 3.14 as
> distributed
> by Fedora 28 in valgrind-3.14.0-1.fc28.x86_64.rpm .
>
> $ rpm -q valgrind
> valgrind-3.14.0-1.fc28.x86_64
> $ type valgrind
> valgrind is hashed (/usr/bin/valgrind)
> $ valgrind --version
> valgrind-3.14.0
> $ gcc -g -O pthread_test.c -lpthread
> $ valgrind ./a.out
> ==18824== Memcheck, a memory error detector
> ==18824== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
> ==18824== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright
> info
> ==18824== Command: ./a.out
> ==18824==
> start
> thread created
> thread running
> done
> ==18824==
> ==18824== HEAP SUMMARY:
> ==18824==     in use at exit: 0 bytes in 0 blocks
> ==18824==   total heap usage: 3 allocs, 3 frees, 66,832 bytes allocated
> ==18824==
> ==18824== All heap blocks were freed -- no leaks are possible
> ==18824==
> ==18824== For counts of detected and suppressed errors, rerun with: -v
> ==18824== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
> $
>
>
> _______________________________________________
> Valgrind-users mailing list
> Valgrind-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to