https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95257

            Bug ID: 95257
           Summary: valgrind gives me error when wprintf in stderr
           Product: gcc
           Version: 7.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: daffra.claudio at gmail dot com
  Target Milestone: ---

this simple program gives me error when i check with valgrind,
this happen in stderr only.

valgrind --leak-check=full --show-leak-kinds=all ./x


#include <stdio.h>
#include <wchar.h>

int main ( void )
{

        fwprintf ( stderr , L"valgrind error\n" ) ;
        return 0 ;
}

valgrind error :

==7438== Memcheck, a memory error detector
==7438== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==7438== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==7438== Command: ./x
==7438== 
valgrind error==7438== 
==7438== HEAP SUMMARY:
==7438==     in use at exit: 5,120 bytes in 2 blocks
==7438==   total heap usage: 2 allocs, 0 frees, 5,120 bytes allocated
==7438== 
==7438== 1,024 bytes in 1 blocks are still reachable in loss record 1 of 2
==7438==    at 0x4C2FB0F: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7438==    by 0x4EBA18B: _IO_file_doallocate (filedoalloc.c:101)
==7438==    by 0x4EBB88C: _IO_wfile_doallocate (wfiledoalloc.c:70)
==7438==    by 0x4ECA378: _IO_doallocbuf (genops.c:365)
==7438==    by 0x4EC26C7: _IO_wfile_overflow (wfileops.c:430)
==7438==    by 0x4EBFD51: __woverflow (wgenops.c:217)
==7438==    by 0x4EBFD51: _IO_wdefault_xsputn (wgenops.c:317)
==7438==    by 0x4EC2AD0: _IO_wfile_xsputn (wfileops.c:1012)
==7438==    by 0x4EA7089: buffered_vfprintf (vfprintf.c:2343)
==7438==    by 0x4EA40FD: vfwprintf (vfprintf.c:1301)
==7438==    by 0x4EBEA23: fwprintf (fwprintf.c:33)
==7438==    by 0x1086A8: main (in /home/claudio/x)
==7438== 
==7438== 4,096 bytes in 1 blocks are still reachable in loss record 2 of 2
==7438==    at 0x4C2FB0F: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7438==    by 0x4EBB858: _IO_wfile_doallocate (wfiledoalloc.c:79)
==7438==    by 0x4ECA378: _IO_doallocbuf (genops.c:365)
==7438==    by 0x4EC26C7: _IO_wfile_overflow (wfileops.c:430)
==7438==    by 0x4EBFD51: __woverflow (wgenops.c:217)
==7438==    by 0x4EBFD51: _IO_wdefault_xsputn (wgenops.c:317)
==7438==    by 0x4EC2AD0: _IO_wfile_xsputn (wfileops.c:1012)
==7438==    by 0x4EA7089: buffered_vfprintf (vfprintf.c:2343)
==7438==    by 0x4EA40FD: vfwprintf (vfprintf.c:1301)
==7438==    by 0x4EBEA23: fwprintf (fwprintf.c:33)
==7438==    by 0x1086A8: main (in /home/claudio/x)
==7438== 
==7438== LEAK SUMMARY:
==7438==    definitely lost: 0 bytes in 0 blocks
==7438==    indirectly lost: 0 bytes in 0 blocks
==7438==      possibly lost: 0 bytes in 0 blocks
==7438==    still reachable: 5,120 bytes in 2 blocks
==7438==         suppressed: 0 bytes in 0 blocks
==7438== 
==7438== For counts of detected and suppressed errors, rerun with: -v
==7438== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

compiler :

gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04).

Reply via email to