|
From: <sv...@va...> - 2006-04-04 17:35:52
|
Author: sewardj
Date: 2006-04-04 18:35:48 +0100 (Tue, 04 Apr 2006)
New Revision: 5826
Log:
Test program which uses templates to generate very long stabs (debug
info) strings. This crashes 3.1.1 when the test is compiled with
-gstabs.
Added:
trunk/memcheck/tests/deep_templates.cpp
trunk/memcheck/tests/deep_templates.stderr.exp
trunk/memcheck/tests/deep_templates.stdout.exp
trunk/memcheck/tests/deep_templates.vgtest
Modified:
trunk/memcheck/tests/Makefile.am
Modified: trunk/memcheck/tests/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/Makefile.am 2006-04-04 16:57:15 UTC (rev 5825)
+++ trunk/memcheck/tests/Makefile.am 2006-04-04 17:35:48 UTC (rev 5826)
@@ -38,6 +38,8 @@
clientperm.stderr.exp \
clientperm.stdout.exp clientperm.vgtest \
custom_alloc.stderr.exp custom_alloc.vgtest \
+ deep_templates.vgtest \
+ deep_templates.stdout.exp deep_templates.stderr.exp \
describe-block.stderr.exp describe-block.vgtest \
doublefree.stderr.exp doublefree.vgtest \
erringfds.stderr.exp erringfds.stdout.exp erringfds.vgtest \
@@ -137,6 +139,7 @@
badaddrvalue badfree badjump badjump2 \
badloop badpoll badrw brk brk2 buflen_check \
clientperm custom_alloc \
+ deep_templates \
describe-block \
doublefree error_counts errs1 exitprog execve execve2 erringfds \
fprw fwrite hello inits inline \
@@ -192,6 +195,8 @@
mismatches_SOURCES =3D mismatches.cpp
new_nothrow_SOURCES =3D new_nothrow.cpp
new_override_SOURCES =3D new_override.cpp
+deep_templates_SOURCES =3D deep_templates.cpp
+deep_templates_CXXFLAGS =3D $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -O -gstabs
=20
# Build shared object for wrap7
wrap7_SOURCES =3D wrap7.c
Added: trunk/memcheck/tests/deep_templates.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/deep_templates.cpp (rev =
0)
+++ trunk/memcheck/tests/deep_templates.cpp 2006-04-04 17:35:48 UTC (rev =
5826)
@@ -0,0 +1,49 @@
+
+/* Point of this test is to generate some very long 'stabs' debug
+ strings, via the use of these exponentially large template types.
+ When compiled with -gstabs, this causes 3.1.1 to segfault at
+ startup.
+*/
+
+#include <stdio.h>
+
+template <class T, class U>
+class Stack
+{
+ public:
+ Stack(int =3D 10) { size=3D5; top=3D6; stackPtr=3D(T*)6; };=20
+ ~Stack() { }
+ int push(const T&, const U&);=20
+ int popT(T&);
+ int popU(U&);
+ int isEmpty() const { return top =3D=3D -1; }=20
+ int isFull() const { return top =3D=3D size - 1; }=20
+ private:
+ int size;
+ int top; =20
+ T* stackPtr; =20
+} ;
+
+typedef Stack<int,char> Foo;
+typedef Stack<Foo,Foo> Foo2;
+typedef Stack<Foo2,Foo2> Foo3;
+typedef Stack<Foo3,Foo3> Foo4;
+typedef Stack<Foo4,Foo4> Foo5;
+typedef Stack<Foo5,Foo5> Foo6;
+typedef Stack<Foo6,Foo6> Foo7;
+typedef Stack<Foo7,Foo7> Foo8;
+typedef Stack<Foo8,Foo8> Foo9;
+typedef Stack<Foo9,Foo9> Foo10;
+typedef Stack<Foo10,Foo10> Foo11;
+typedef Stack<Foo11,Foo11> Foo12;
+
+int main ( char* argc, char** argv )
+{
+ Stack<Foo12,Foo12> * x =3D new Stack<Foo12,Foo12>(3);
+ if (x =3D=3D NULL)
+ printf("It's NULL (?!)\n");
+ else
+ printf("It's not NULL. How DULL.\n");
+ delete x;
+ return 0;
+}
Added: trunk/memcheck/tests/deep_templates.stderr.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Added: trunk/memcheck/tests/deep_templates.stdout.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/deep_templates.stdout.exp =
(rev 0)
+++ trunk/memcheck/tests/deep_templates.stdout.exp 2006-04-04 17:35:48 UT=
C (rev 5826)
@@ -0,0 +1 @@
+It's not NULL. How DULL.
Added: trunk/memcheck/tests/deep_templates.vgtest
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/deep_templates.vgtest (r=
ev 0)
+++ trunk/memcheck/tests/deep_templates.vgtest 2006-04-04 17:35:48 UTC (r=
ev 5826)
@@ -0,0 +1,2 @@
+prog: deep_templates
+vgopts: -q
|