summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
authorJonathan Haslam <Jonathan.Haslam@Sun.COM>2009-10-14 11:25:23 +0100
committerJonathan Haslam <Jonathan.Haslam@Sun.COM>2009-10-14 11:25:23 +0100
commit96400bb6b8e1e66106f3b1de3cf1dbd8268e581c (patch)
treec4e04b339f9673c7e0341f03eb56f161ce2a595c /usr/src/cmd
parent9ac6ef62191e25b5446a896d0cfb9955c4f48de6 (diff)
downloadillumos-joyent-96400bb6b8e1e66106f3b1de3cf1dbd8268e581c.tar.gz
6886953 large symbols lead to stack exhaustion
6886862 DTrace dumps core with dtrace -n 'pid<pid>:::*read*{}
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh83
1 files changed, 83 insertions, 0 deletions
diff --git a/usr/src/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh b/usr/src/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh
new file mode 100644
index 0000000000..ed375fdbf9
--- /dev/null
+++ b/usr/src/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh
@@ -0,0 +1,83 @@
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+#
+
+if [ $# != 1 ]; then
+ echo expected one argument: '<'dtrace-path'>'
+ exit 2
+fi
+
+dtrace=$1
+DIR=/var/tmp/dtest.$$
+
+mkdir $DIR
+cd $DIR
+
+cat > test.c <<EOF
+void
+thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog(void)
+{
+ while (1)
+ ;
+}
+
+int
+main(int argc, char *argv[])
+{
+ thequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydogthequickbrownfoxjumpsoverthelazydog();
+}
+EOF
+
+cc -o test test.c
+if [ $? -ne 0 ]; then
+ print -u2 "failed to compile test.c"
+ exit 1
+fi
+
+script()
+{
+ $dtrace -c ./test -qs /dev/stdin <<EOF
+ profile:::profile-1001hz
+ /pid == \$target/
+ {
+ @[arg1] = count();
+ }
+
+ tick-1s
+ /n++ > 10/
+ {
+ printa("%A %@d\n", @);
+ exit(0);
+ }
+EOF
+}
+
+script
+status=$?
+
+cd /
+/usr/bin/rm -rf $DIR
+
+exit $status