This is the mail archive of the libstdc++-prs@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libstdc++/6: SIGILL in __builtin_new



>Number:         6
>Category:       libstdc++
>Synopsis:       SIGILL in __builtin_new
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 30 12:27:02 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator:     clasen@mathematik.uni-freiburg.de
>Release:        2.95
>Organization:
>Environment:
RedHat 6.0/i386 with gcc-2.95-4.i386.rpm and libstdc++-2.95-4.i386.rpm
from contrib.redhat.com installed. 
>Description:
I get a SIGILL from any C++ program that uses
new[] on a template class. Maybe the libstdc++-rpm
is just broken, I would have tried to verify this
by reinstalling from source, but there is no src.rpm
on contrib.redhat.com...
>How-To-Repeat:
Here is a little example program that exhibits the problem:

//START
#include <stdio.h>

template<class T>
class test {
 public:
  test() : x_(0) { printf("test::test()\n"); }
  test(T x) : x_(x) { printf("test::test(%d)\n", int(x)); }
  T value() { return x_; }
 private:
  T x_;
};
//END


Here is what I get from compiling and running it:


bash$ make test
g++     test.cc   -o test
bash$ ./test
Illegal instruction (core dumped)
bash$ gdb ./test core
GNU gdb 4.17.0.11 with Linux support
Copyright 1998 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 "i386-redhat-linux"...
Core was generated by `./test'.
Program terminated with signal 4, Ungültiger Maschinenbefehl.
Reading symbols from /usr/lib/libstdc++-libc6.1-2.so.3...done.
Reading symbols from /lib/libm.so.6...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
#0  0x4004f240 in __builtin_new (sz=20)
(gdb) bt
#0  0x4004f240 in __builtin_new (sz=20)
#1  0x4004f443 in __builtin_vec_new (sz=20)
#2  0x804866a in main ()
#3  0x40096cb3 in __libc_start_main (main=0x8048650 <main>, argc=1, 
    argv=0xbffff884, init=0x80484ac <_init>, fini=0x8048788 <_fini>, 
    rtld_fini=0x4000a350 <_dl_fini>, stack_end=0xbffff87c)
    at ../sysdeps/generic/libc-start.c:78
Current language:  auto; currently c++
(gdb) 



int main (int argc, char **argv)
{
  test<int> *u = 0;
  u = new test<int>[5];
  return 0;
}

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]