public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "daffra.claudio at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/95257] New: valgrind gives me error when wprintf in stderr
Date: Thu, 21 May 2020 11:40:09 +0000	[thread overview]
Message-ID: <bug-95257-4@http.gcc.gnu.org/bugzilla/> (raw)

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	other threads:[~2020-05-21 11:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21 11:40 daffra.claudio at gmail dot com [this message]
2020-05-22  2:48 ` [Bug c/95257] valgrind gives me error when fwprintf " pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-95257-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).