public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/36479]  New: Short buffer in libcpp
@ 2008-06-09 17:03 hjl dot tools at gmail dot com
  2008-06-09 17:12 ` [Bug preprocessor/36479] " hjl dot tools at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-06-09 17:03 UTC (permalink / raw)
  To: gcc-bugs

[hjl@gnu-6 prev-gcc]$ cat foo.ii
# 1 "/net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/g++.dg/pch/pch.C"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/g++.dg/pch/pch.C"


int main()
{
  return 0;
}
[hjl@gnu-6 prev-gcc]$ valgrind --tool=memcheck ./cc1plus -fpreprocessed foo.ii
-quiet -dumpbase foo.ii -m32 -mtune=generic -auxbase pch -O2 -version -o foo.s
==6304== Memcheck, a memory error detector.
==6304== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==6304== Using LibVEX rev 1804, a library for dynamic binary translation.
==6304== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==6304== Using valgrind-3.3.0, a dynamic binary instrumentation framework.
==6304== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==6304== For more details, rerun with: -v
==6304== 
GNU C++ (GCC) version 4.4.0 20080609 (experimental) [trunk revision 136589]
(x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.4.0 20080609 (experimental) [trunk revision
136589], GMP version 4.2.2, MPFR version 2.3.0-p4.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 9e36edea0acfb287d81f6630c10d1047
==6304== Invalid read of size 1
==6304==    at 0x4A07B24: strlen (mc_replace_strmem.c:242)
==6304==    by 0x693EB2: output_file_directive (toplev.c:680)
==6304==    by 0x7AE7E8: x86_file_start (i386.c:23343)
==6304==    by 0x694DA4: toplev_main (toplev.c:1343)
==6304==    by 0x39D3C1E329: (below main) (in /lib64/libc-2.8.so)
==6304==  Address 0x4cb7d01 is 0 bytes after a block of size 65 alloc'd
==6304==    at 0x4A074D1: realloc (vg_replace_malloc.c:429)
==6304==    by 0xA0313C: xrealloc (xmalloc.c:179)
==6304==    by 0x9D22AC: cpp_interpret_string (charset.c:1392)
==6304==    by 0x9D2860: cpp_interpret_string_notranslate (charset.c:1416)
==6304==    by 0x9D624A: do_linemarker (directives.c:956)
==6304==    by 0x9D4BB4: _cpp_handle_directive (directives.c:483)
==6304==    by 0x9DCE6E: cpp_read_main_file (init.c:536)
==6304==    by 0x4D9947: c_common_post_options (c-opts.c:1174)
==6304==    by 0x694309: toplev_main (toplev.c:1660)
==6304==    by 0x39D3C1E329: (below main) (in /lib64/libc-2.8.so)
==6304== 
==6304== Invalid read of size 1
==6304==    at 0x693114: output_quoted_string (toplev.c:652)
==6304==    by 0x693F03: output_file_directive (toplev.c:695)
==6304==    by 0x7AE7E8: x86_file_start (i386.c:23343)
==6304==    by 0x694DA4: toplev_main (toplev.c:1343)
==6304==    by 0x39D3C1E329: (below main) (in /lib64/libc-2.8.so)
==6304==  Address 0x4cb7d01 is 0 bytes after a block of size 65 alloc'd
==6304==    at 0x4A074D1: realloc (vg_replace_malloc.c:429)
==6304==    by 0xA0313C: xrealloc (xmalloc.c:179)
==6304==    by 0x9D22AC: cpp_interpret_string (charset.c:1392)
==6304==    by 0x9D2860: cpp_interpret_string_notranslate (charset.c:1416)
==6304==    by 0x9D624A: do_linemarker (directives.c:956)
==6304==    by 0x9D4BB4: _cpp_handle_directive (directives.c:483)
==6304==    by 0x9DCE6E: cpp_read_main_file (init.c:536)
==6304==    by 0x4D9947: c_common_post_options (c-opts.c:1174)
==6304==    by 0x694309: toplev_main (toplev.c:1660)
==6304==    by 0x39D3C1E329: (below main) (in /lib64/libc-2.8.so)
==6304== 
==6304== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 4 from 1)
==6304== malloc/free: in use at exit: 448,374 bytes in 1,606 blocks.
==6304== malloc/free: 4,000 allocs, 2,394 frees, 2,176,191 bytes allocated.
==6304== For counts of detected errors, rerun with: -v
==6304== searching for pointers to 1,606 not-freed blocks.
==6304== checked 3,757,576 bytes.
==6304== 
==6304== LEAK SUMMARY:
==6304==    definitely lost: 8,832 bytes in 30 blocks.
==6304==      possibly lost: 0 bytes in 0 blocks.
==6304==    still reachable: 439,542 bytes in 1,576 blocks.
==6304==         suppressed: 0 bytes in 0 blocks.
==6304== Rerun with --leak-check=full to see details of leaked memory.
[hjl@gnu-6 prev-gcc]$


-- 
           Summary: Short buffer in libcpp
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36479


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug preprocessor/36479] Short buffer in libcpp
  2008-06-09 17:03 [Bug preprocessor/36479] New: Short buffer in libcpp hjl dot tools at gmail dot com
@ 2008-06-09 17:12 ` hjl dot tools at gmail dot com
  2008-06-09 20:01 ` hjl dot tools at gmail dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-06-09 17:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from hjl dot tools at gmail dot com  2008-06-09 17:12 -------
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00491.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at redhat dot com
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2008-
                   |                            |06/msg00491.html


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36479


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug preprocessor/36479] Short buffer in libcpp
  2008-06-09 17:03 [Bug preprocessor/36479] New: Short buffer in libcpp hjl dot tools at gmail dot com
  2008-06-09 17:12 ` [Bug preprocessor/36479] " hjl dot tools at gmail dot com
@ 2008-06-09 20:01 ` hjl dot tools at gmail dot com
  2008-06-09 20:03 ` hjl dot tools at gmail dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-06-09 20:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hjl dot tools at gmail dot com  2008-06-09 20:00 -------
*** Bug 36379 has been marked as a duplicate of this bug. ***


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36479


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug preprocessor/36479] Short buffer in libcpp
  2008-06-09 17:03 [Bug preprocessor/36479] New: Short buffer in libcpp hjl dot tools at gmail dot com
  2008-06-09 17:12 ` [Bug preprocessor/36479] " hjl dot tools at gmail dot com
  2008-06-09 20:01 ` hjl dot tools at gmail dot com
@ 2008-06-09 20:03 ` hjl dot tools at gmail dot com
  2008-06-09 20:10 ` dfranke at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-06-09 20:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hjl dot tools at gmail dot com  2008-06-09 20:02 -------
An updated patch is at

http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00513.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|http://gcc.gnu.org/ml/gcc-  |http://gcc.gnu.org/ml/gcc-
                   |patches/2008-               |patches/2008-
                   |06/msg00491.html            |06/msg00513.html


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36479


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug preprocessor/36479] Short buffer in libcpp
  2008-06-09 17:03 [Bug preprocessor/36479] New: Short buffer in libcpp hjl dot tools at gmail dot com
                   ` (2 preceding siblings ...)
  2008-06-09 20:03 ` hjl dot tools at gmail dot com
@ 2008-06-09 20:10 ` dfranke at gcc dot gnu dot org
  2008-06-09 20:21 ` hjl dot tools at gmail dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2008-06-09 20:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dfranke at gcc dot gnu dot org  2008-06-09 20:09 -------
H.J., this is c++, correct?
For the fortran side of the problem, i.e. PR36379, I found that

+  cpp_option->char_precision = TYPE_PRECISION (char_type_node);

should be added (comment #5). Could you check if this by any chance is missing
on the c++ side of things as well?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36479


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug preprocessor/36479] Short buffer in libcpp
  2008-06-09 17:03 [Bug preprocessor/36479] New: Short buffer in libcpp hjl dot tools at gmail dot com
                   ` (3 preceding siblings ...)
  2008-06-09 20:10 ` dfranke at gcc dot gnu dot org
@ 2008-06-09 20:21 ` hjl dot tools at gmail dot com
  2008-06-09 21:12 ` hjl dot tools at gmail dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-06-09 20:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from hjl dot tools at gmail dot com  2008-06-09 20:20 -------
This may be introduced by

http://gcc.gnu.org/ml/gcc-patches/2008-04/msg01235.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kris dot van dot hees at
                   |                            |oracle dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36479


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug preprocessor/36479] Short buffer in libcpp
  2008-06-09 17:03 [Bug preprocessor/36479] New: Short buffer in libcpp hjl dot tools at gmail dot com
                   ` (4 preceding siblings ...)
  2008-06-09 20:21 ` hjl dot tools at gmail dot com
@ 2008-06-09 21:12 ` hjl dot tools at gmail dot com
  2008-06-12  0:13 ` kris dot van dot hees at oracle dot com
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-06-09 21:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hjl dot tools at gmail dot com  2008-06-09 21:11 -------
The updated patch is at

http://gcc.gnu.org/ml/gcc-patches/2008-06/msg00523.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|http://gcc.gnu.org/ml/gcc-  |http://gcc.gnu.org/ml/gcc-
                   |patches/2008-               |patches/2008-
                   |06/msg00513.html            |06/msg00523.html


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36479


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug preprocessor/36479] Short buffer in libcpp
  2008-06-09 17:03 [Bug preprocessor/36479] New: Short buffer in libcpp hjl dot tools at gmail dot com
                   ` (5 preceding siblings ...)
  2008-06-09 21:12 ` hjl dot tools at gmail dot com
@ 2008-06-12  0:13 ` kris dot van dot hees at oracle dot com
  2008-06-12 17:05 ` hjl at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: kris dot van dot hees at oracle dot com @ 2008-06-12  0:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from kris dot van dot hees at oracle dot com  2008-06-12 00:12 -------
Patch looks good to me.  Good catch!


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36479


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug preprocessor/36479] Short buffer in libcpp
  2008-06-09 17:03 [Bug preprocessor/36479] New: Short buffer in libcpp hjl dot tools at gmail dot com
                   ` (6 preceding siblings ...)
  2008-06-12  0:13 ` kris dot van dot hees at oracle dot com
@ 2008-06-12 17:05 ` hjl at gcc dot gnu dot org
  2008-06-12 18:40 ` hjl dot tools at gmail dot com
  2008-06-13 16:03 ` tromey at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: hjl at gcc dot gnu dot org @ 2008-06-12 17:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from hjl at gcc dot gnu dot org  2008-06-12 17:04 -------
Subject: Bug 36479

Author: hjl
Date: Thu Jun 12 17:03:41 2008
New Revision: 136714

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136714
Log:
2008-06-12  H.J. Lu  <hongjiu.lu@intel.com>

        PR preprocessor/36479
        * charset.c (cpp_interpret_string_notranslate): Also set
        narrow_cset_desc.width.

Modified:
    trunk/libcpp/ChangeLog
    trunk/libcpp/charset.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36479


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug preprocessor/36479] Short buffer in libcpp
  2008-06-09 17:03 [Bug preprocessor/36479] New: Short buffer in libcpp hjl dot tools at gmail dot com
                   ` (7 preceding siblings ...)
  2008-06-12 17:05 ` hjl at gcc dot gnu dot org
@ 2008-06-12 18:40 ` hjl dot tools at gmail dot com
  2008-06-13 16:03 ` tromey at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: hjl dot tools at gmail dot com @ 2008-06-12 18:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from hjl dot tools at gmail dot com  2008-06-12 18:39 -------
Fixed as of revision 136717:

http://gcc.gnu.org/ml/gcc-testresults/2008-06/msg00994.html

Revision 136712:

http://gcc.gnu.org/ml/gcc-testresults/2008-06/msg00993.html

FAIL: gcc.dg/pch/save-temps-1.c -O0 -g assembly comparison
FAIL: gcc.dg/pch/save-temps-1.c  -O0  assembly comparison
FAIL: gcc.dg/pch/save-temps-1.c  -O1  assembly comparison
FAIL: gcc.dg/pch/save-temps-1.c  -O2  assembly comparison
FAIL: gcc.dg/pch/save-temps-1.c  -O3 -fomit-frame-pointer  assembly comparison
FAIL: gcc.dg/pch/save-temps-1.c  -O3 -g  assembly comparison
FAIL: gcc.dg/pch/save-temps-1.c  -Os  assembly comparison


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36479


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug preprocessor/36479] Short buffer in libcpp
  2008-06-09 17:03 [Bug preprocessor/36479] New: Short buffer in libcpp hjl dot tools at gmail dot com
                   ` (8 preceding siblings ...)
  2008-06-12 18:40 ` hjl dot tools at gmail dot com
@ 2008-06-13 16:03 ` tromey at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: tromey at gcc dot gnu dot org @ 2008-06-13 16:03 UTC (permalink / raw)
  To: gcc-bugs



-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36479


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-06-13 16:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-09 17:03 [Bug preprocessor/36479] New: Short buffer in libcpp hjl dot tools at gmail dot com
2008-06-09 17:12 ` [Bug preprocessor/36479] " hjl dot tools at gmail dot com
2008-06-09 20:01 ` hjl dot tools at gmail dot com
2008-06-09 20:03 ` hjl dot tools at gmail dot com
2008-06-09 20:10 ` dfranke at gcc dot gnu dot org
2008-06-09 20:21 ` hjl dot tools at gmail dot com
2008-06-09 21:12 ` hjl dot tools at gmail dot com
2008-06-12  0:13 ` kris dot van dot hees at oracle dot com
2008-06-12 17:05 ` hjl at gcc dot gnu dot org
2008-06-12 18:40 ` hjl dot tools at gmail dot com
2008-06-13 16:03 ` tromey at gcc dot gnu dot org

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).