Subject: bin/158: ps hang
To: None <gnats-admin>
From: James Jegers <jimj@miller.cs.uwm.edu>
List: netbsd-bugs
Date: 03/07/1994 21:20:04
>Number:         158
>Category:       bin
>Synopsis:       ps hang
>Confidential:   yes
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar  7 21:20:02 1994
>Originator:     James Jegers
>Organization:
"	"
>Release:        
>Environment:
	
System: NetBSD enigma.cs.uwm.edu 0.9a ENIGMA#0 i386


>Description:
	
	If a user changes has argv[], ps locks up.
	PS. I'm not really sure if this is a bug, or just an annomoly
>How-To-Repeat:

	run the below program, and then run ps xa

#include <stdio.h>
#include <signal.h>

void domore(int);

int max;
char **gargv;

main(int argc, char *argv[])
{
	int i;
	max = 50000;

	gargv = argv;

	signal(SIGBUS, domore);

	for (i=0; i < max; i++)
		gargv[0][i] = 'd';

	printf("found at %d\n", max);

	sleep(10);
}

void
domore(int sig)
{
	int i;
	max--;

	for (i=0; i < max; i++)
		gargv[0][i] = 'd';
}

	
>Fix:
	
>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------