1b8fac8e1Sjhaslam /* 2b8fac8e1Sjhaslam * CDDL HEADER START 3b8fac8e1Sjhaslam * 4b8fac8e1Sjhaslam * The contents of this file are subject to the terms of the 5b8fac8e1Sjhaslam * Common Development and Distribution License (the "License"). 6b8fac8e1Sjhaslam * You may not use this file except in compliance with the License. 7b8fac8e1Sjhaslam * 8b8fac8e1Sjhaslam * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9b8fac8e1Sjhaslam * or http://www.opensolaris.org/os/licensing. 10b8fac8e1Sjhaslam * See the License for the specific language governing permissions 11b8fac8e1Sjhaslam * and limitations under the License. 12b8fac8e1Sjhaslam * 13b8fac8e1Sjhaslam * When distributing Covered Code, include this CDDL HEADER in each 14b8fac8e1Sjhaslam * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15b8fac8e1Sjhaslam * If applicable, add the following below this CDDL HEADER, with the 16b8fac8e1Sjhaslam * fields enclosed by brackets "[]" replaced with your own identifying 17b8fac8e1Sjhaslam * information: Portions Copyright [yyyy] [name of copyright owner] 18b8fac8e1Sjhaslam * 19b8fac8e1Sjhaslam * CDDL HEADER END 20b8fac8e1Sjhaslam */ 21b8fac8e1Sjhaslam 22b8fac8e1Sjhaslam /* 23b8fac8e1Sjhaslam * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 24b8fac8e1Sjhaslam * Use is subject to license terms. 25b8fac8e1Sjhaslam */ 26b8fac8e1Sjhaslam 27b8fac8e1Sjhaslam #include <stdio.h> 28b8fac8e1Sjhaslam #include <stdlib.h> 29b8fac8e1Sjhaslam #include <unistd.h> 30b8fac8e1Sjhaslam 31b8fac8e1Sjhaslam void grow1(int); 32b8fac8e1Sjhaslam 33b8fac8e1Sjhaslam void grow(int frame)34b8fac8e1Sjhaslamgrow(int frame) 35b8fac8e1Sjhaslam { 36b8fac8e1Sjhaslam /* 37b8fac8e1Sjhaslam * Create a ridiculously large stack - enough to push us over 38b8fac8e1Sjhaslam * the default setting of 'dtrace_ustackdepth_max' (2048). 39b8fac8e1Sjhaslam */ 40b8fac8e1Sjhaslam if (frame >= 2048) 41b8fac8e1Sjhaslam for (;;) 42b8fac8e1Sjhaslam getpid(); 43b8fac8e1Sjhaslam 44b8fac8e1Sjhaslam grow1(++frame); 45b8fac8e1Sjhaslam } 46b8fac8e1Sjhaslam 47b8fac8e1Sjhaslam void grow1(int frame)48b8fac8e1Sjhaslamgrow1(int frame) 49b8fac8e1Sjhaslam { 50b8fac8e1Sjhaslam grow(++frame); 51b8fac8e1Sjhaslam } 52b8fac8e1Sjhaslam 53b8fac8e1Sjhaslam int main(int argc,char * argv[])54b8fac8e1Sjhaslammain(int argc, char *argv[]) 55b8fac8e1Sjhaslam { 56b8fac8e1Sjhaslam grow(1); 57*73427c57Sahl 58*73427c57Sahl return (0); 59b8fac8e1Sjhaslam } 60