B
Billy Patton
If I comment out all down to the first fprintf , 6 lines. no problem
I uncommented one at a time until just the std::string* sp3 was commented out
and still everything went ok.
When I uncomment that line I get a seg fault.
Here's the core bt:
Core was generated by `Linux/32/test'.
Program terminated with signal 11, Segmentation fault.
#0 0x0811bb55 in _int_malloc ()
(gdb) bt
#0 0x0811bb55 in _int_malloc ()
#1 0x0811b58a in malloc ()
#2 0x080efd9e in operator new (sz=137509408)
at /apps/local-source/gcc/gcc-3.4.1/libstdc++-v3/libsupc++/new_op.cc:48
#3 0x080662e2 in t_String () at test.cxx:1971
#4 0x0804836d in main (argc=1, argv=0xbfff84f4) at test.cxx:87
(gdb) q
Notice #2 sz=137509408
/********************************************************************
************************* TEST OPERATOR != *************************
*******************************************************************/
{
String s1("ABC");
String s2("abc");
String* sp1 = new String("abc");
String* sp2 = new String("ABC");
std::string s3("abc");
std::string* sp3 = new std::string("abc");
fprintf(stderr,"%d\n",__LINE__);
std::string* sp4 = new std::string("ABC");
fprintf(stderr,"%d\n",__LINE__);
OK(s1 != s1);
NOK(s1 != s2);
NOK(s1 != sp1);
OK(s1 != sp2);
NOK(s1 != s3);
NOK(s1 != sp3);
OK(s1 != sp4);
delete sp1;
delete sp2;
delete sp3;
delete sp3;
s2 = 1;
NOK(s1 != (short)1);
OK(s2 != (short)1);
NOK(s1 != (long)1);
OK(s2 != (long)1);
NOK(s1 != (int)1);
OK(s2 != (int)1);
}
LEAVE;
}
___ _ ____ ___ __ __
/ _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
/ _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodology Group
Dallas, Texas, 214-480-4455, (e-mail address removed)
I uncommented one at a time until just the std::string* sp3 was commented out
and still everything went ok.
When I uncomment that line I get a seg fault.
Here's the core bt:
Core was generated by `Linux/32/test'.
Program terminated with signal 11, Segmentation fault.
#0 0x0811bb55 in _int_malloc ()
(gdb) bt
#0 0x0811bb55 in _int_malloc ()
#1 0x0811b58a in malloc ()
#2 0x080efd9e in operator new (sz=137509408)
at /apps/local-source/gcc/gcc-3.4.1/libstdc++-v3/libsupc++/new_op.cc:48
#3 0x080662e2 in t_String () at test.cxx:1971
#4 0x0804836d in main (argc=1, argv=0xbfff84f4) at test.cxx:87
(gdb) q
Notice #2 sz=137509408
/********************************************************************
************************* TEST OPERATOR != *************************
*******************************************************************/
{
String s1("ABC");
String s2("abc");
String* sp1 = new String("abc");
String* sp2 = new String("ABC");
std::string s3("abc");
std::string* sp3 = new std::string("abc");
fprintf(stderr,"%d\n",__LINE__);
std::string* sp4 = new std::string("ABC");
fprintf(stderr,"%d\n",__LINE__);
OK(s1 != s1);
NOK(s1 != s2);
NOK(s1 != sp1);
OK(s1 != sp2);
NOK(s1 != s3);
NOK(s1 != sp3);
OK(s1 != sp4);
delete sp1;
delete sp2;
delete sp3;
delete sp3;
s2 = 1;
NOK(s1 != (short)1);
OK(s2 != (short)1);
NOK(s1 != (long)1);
OK(s2 != (long)1);
NOK(s1 != (int)1);
OK(s2 != (int)1);
}
LEAVE;
}
___ _ ____ ___ __ __
/ _ )(_) / /_ __ / _ \___ _/ /_/ /____ ___
/ _ / / / / // / / ___/ _ `/ __/ __/ _ \/ _ \
/____/_/_/_/\_, / /_/ \_,_/\__/\__/\___/_//_/
/___/
Texas Instruments ASIC Circuit Design Methodology Group
Dallas, Texas, 214-480-4455, (e-mail address removed)