public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/30416]  New: SIGSEGV in valarray::cshift(n) on empty array
@ 2007-01-09 21:47 sebor at roguewave dot com
  2007-01-09 22:02 ` [Bug libstdc++/30416] " pinskia at gcc dot gnu dot org
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: sebor at roguewave dot com @ 2007-01-09 21:47 UTC (permalink / raw)
  To: gcc-bugs

AFAIK, the program below should have well-defined behavior but it abends with
gcc 4.1.0 on Solaris 9.

$ cat t.cpp && g++ -g t.cpp -static && gdb ./a.out
#include <valarray>

int main ()
{
    const std::valarray<int> a;

    a.cshift (1);
} 
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.9"...
(gdb) run
Starting program: a.out 

Program received signal SIGSEGV, Segmentation fault.
0x00024db8 in memcpy ()
(gdb) where
#0  0x00024db8 in memcpy ()
#1  0x00010368 in std::_Array_copy_ctor<int, true>::_S_do_it (__b=0x0, 
    __e=0x4, __o=0xffbffb94)
    at
/usr/local/gcc-4.1.0/lib/gcc/sparc-sun-solaris2.9/4.1.0/../../../../include/c++/4.1.0/bits/valarray_array.h:165
#2  0x00010398 in std::__valarray_copy_construct<int> (__b=0x0, __e=0x4, 
    __o=0xffbffb94)
    at
/usr/local/gcc-4.1.0/lib/gcc/sparc-sun-solaris2.9/4.1.0/../../../../include/c++/4.1.0/bits/valarray_array.h:174
#3  0x0001057c in std::valarray<int>::cshift (this=0xffbffc20, __n=1)
    at
/usr/local/gcc-4.1.0/lib/gcc/sparc-sun-solaris2.9/4.1.0/../../../../include/c++/4.1.0/valarray:821
#4  0x00010288 in main () at /nfs/b20/sebor/tmp/t.cpp:8


-- 
           Summary: SIGSEGV in valarray::cshift(n) on empty array
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com


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


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

end of thread, other threads:[~2007-01-12 14:57 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-09 21:47 [Bug libstdc++/30416] New: SIGSEGV in valarray::cshift(n) on empty array sebor at roguewave dot com
2007-01-09 22:02 ` [Bug libstdc++/30416] " pinskia at gcc dot gnu dot org
2007-01-09 22:05 ` gdr at integrable-solutions dot net
2007-01-09 22:21 ` chris at bubblescope dot net
2007-01-09 22:34 ` sebor at roguewave dot com
2007-01-09 23:17 ` pcarlini at suse dot de
2007-01-10  3:32 ` gdr at integrable-solutions dot net
2007-01-10  3:33 ` gdr at integrable-solutions dot net
2007-01-10  3:37 ` gdr at integrable-solutions dot net
2007-01-10  5:55 ` sebor at roguewave dot com
2007-01-10 18:57 ` pcarlini at suse dot de
2007-01-10 19:19 ` pcarlini at suse dot de
2007-01-10 23:27 ` gdr at integrable-solutions dot net
2007-01-10 23:47 ` pcarlini at suse dot de
2007-01-12 11:09 ` paolo at gcc dot gnu dot org
2007-01-12 11:10 ` pcarlini at suse dot de
2007-01-12 13:06 ` gdr at integrable-solutions dot net
2007-01-12 13:35 ` paolo at gcc dot gnu dot org
2007-01-12 14:56 ` paolo at gcc dot gnu dot org
2007-01-12 14:57 ` pcarlini at suse dot de

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