public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40326]  New: <string> object fails to allocate memory
@ 2009-06-02 15:46 rykunov at hotmail dot com
  2009-06-02 15:49 ` [Bug c++/40326] " rykunov at hotmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rykunov at hotmail dot com @ 2009-06-02 15:46 UTC (permalink / raw)
  To: gcc-bugs

code
<string> s( "-", 8192 );
causes segmentation fault. I have Fedora 10 box, using g++ 4.3.2 20081105 (Red
Hat 4.3.2-7)


-- 
           Summary: <string> object fails to allocate memory
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rykunov at hotmail dot com
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux


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


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

* [Bug c++/40326] <string> object fails to allocate memory
  2009-06-02 15:46 [Bug c++/40326] New: <string> object fails to allocate memory rykunov at hotmail dot com
@ 2009-06-02 15:49 ` rykunov at hotmail dot com
  2009-06-02 15:59 ` rykunov at hotmail dot com
  2009-06-02 16:09 ` paolo dot carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: rykunov at hotmail dot com @ 2009-06-02 15:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rykunov at hotmail dot com  2009-06-02 15:49 -------
Created an attachment (id=17945)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17945&action=view)
example which reproduces the error


-- 


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


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

* [Bug c++/40326] <string> object fails to allocate memory
  2009-06-02 15:46 [Bug c++/40326] New: <string> object fails to allocate memory rykunov at hotmail dot com
  2009-06-02 15:49 ` [Bug c++/40326] " rykunov at hotmail dot com
@ 2009-06-02 15:59 ` rykunov at hotmail dot com
  2009-06-02 16:09 ` paolo dot carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: rykunov at hotmail dot com @ 2009-06-02 15:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rykunov at hotmail dot com  2009-06-02 15:59 -------
command line and compiler options:
$ g++ -o tst_str tst_str.cpp -save-temps -O0 -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-cpu=generic --build=i386-redhat-linux
Thread model: posix
gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) 
COLLECT_GCC_OPTIONS='-o' 'tst_str' '-save-temps' '-O0' '-v' '-shared-libgcc'
'-mtune=generic'
 /usr/libexec/gcc/i386-redhat-linux/4.3.2/cc1plus -E -quiet -v -D_GNU_SOURCE
tst_str.cpp -mtune=generic -O0 -fpch-preprocess -o tst_str.ii
ignoring nonexistent directory
"/usr/lib/gcc/i386-redhat-linux/4.3.2/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/i386-redhat-linux/4.3.2/../../../../i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/i386-redhat-linux/4.3.2/../../../../include/c++/4.3.2

/usr/lib/gcc/i386-redhat-linux/4.3.2/../../../../include/c++/4.3.2/i386-redhat-linux
 /usr/lib/gcc/i386-redhat-linux/4.3.2/../../../../include/c++/4.3.2/backward
 /usr/local/include
 /usr/lib/gcc/i386-redhat-linux/4.3.2/include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-o' 'tst_str' '-save-temps' '-O0' '-v' '-shared-libgcc'
'-mtune=generic'
 /usr/libexec/gcc/i386-redhat-linux/4.3.2/cc1plus -fpreprocessed tst_str.ii
-quiet -dumpbase tst_str.cpp -mtune=generic -auxbase tst_str -O0 -version -o
tst_str.s
GNU C++ (GCC) version 4.3.2 20081105 (Red Hat 4.3.2-7) (i386-redhat-linux)
        compiled by GNU C version 4.3.2 20081105 (Red Hat 4.3.2-7), GMP version
4.2.2, MPFR version 2.3.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: a43cbcaee4cf8f26ffea6bb0c2e68739
COLLECT_GCC_OPTIONS='-o' 'tst_str' '-save-temps' '-O0' '-v' '-shared-libgcc'
'-mtune=generic'
 as -V -Qy -o tst_str.o tst_str.s
GNU assembler version 2.18.50.0.9 (i386-redhat-linux) using BFD version version
2.18.50.0.9-8.fc10 20080822
COMPILER_PATH=/usr/libexec/gcc/i386-redhat-linux/4.3.2/:/usr/libexec/gcc/i386-redhat-linux/4.3.2/:/usr/libexec/gcc/i386-redhat-linux/:/usr/lib/gcc/i386-redhat-linux/4.3.2/:/usr/lib/gcc/i386-redhat-linux/:/usr/libexec/gcc/i386-redhat-linux/4.3.2/:/usr/libexec/gcc/i386-redhat-linux/:/usr/lib/gcc/i386-redhat-linux/4.3.2/:/usr/lib/gcc/i386-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/i386-redhat-linux/4.3.2/:/usr/lib/gcc/i386-redhat-linux/4.3.2/:/usr/lib/gcc/i386-redhat-linux/4.3.2/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-o' 'tst_str' '-save-temps' '-O0' '-v' '-shared-libgcc'
'-mtune=generic'
 /usr/libexec/gcc/i386-redhat-linux/4.3.2/collect2 --eh-frame-hdr --build-id -m
elf_i386 --hash-style=gnu -dynamic-linker /lib/ld-linux.so.2 -o tst_str
/usr/lib/gcc/i386-redhat-linux/4.3.2/../../../crt1.o
/usr/lib/gcc/i386-redhat-linux/4.3.2/../../../crti.o
/usr/lib/gcc/i386-redhat-linux/4.3.2/crtbegin.o
-L/usr/lib/gcc/i386-redhat-linux/4.3.2 -L/usr/lib/gcc/i386-redhat-linux/4.3.2
-L/usr/lib/gcc/i386-redhat-linux/4.3.2/../../.. tst_str.o -lstdc++ -lm -lgcc_s
-lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/i386-redhat-linux/4.3.2/crtend.o
/usr/lib/gcc/i386-redhat-linux/4.3.2/../../../crtn.o

execution:
$ ./tst_str
Segmentation fault


-- 

rykunov at hotmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rykunov at hotmail dot com


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


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

* [Bug c++/40326] <string> object fails to allocate memory
  2009-06-02 15:46 [Bug c++/40326] New: <string> object fails to allocate memory rykunov at hotmail dot com
  2009-06-02 15:49 ` [Bug c++/40326] " rykunov at hotmail dot com
  2009-06-02 15:59 ` rykunov at hotmail dot com
@ 2009-06-02 16:09 ` paolo dot carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-06-02 16:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from paolo dot carlini at oracle dot com  2009-06-02 16:09 -------
This is plain invalid. I suppose you want s( 8192, '=' ). In the testcase as
written you are telling the relevant constructor to use the first 8192 chars of
"="!


-- 

paolo dot carlini at oracle dot com changed:

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


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


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

end of thread, other threads:[~2009-06-02 16:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-02 15:46 [Bug c++/40326] New: <string> object fails to allocate memory rykunov at hotmail dot com
2009-06-02 15:49 ` [Bug c++/40326] " rykunov at hotmail dot com
2009-06-02 15:59 ` rykunov at hotmail dot com
2009-06-02 16:09 ` paolo dot carlini at oracle dot com

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