Subject: Re: Progress on this bug ?
To: None <tim@cst.com.au>
From: Mike Long <mike.long@analog.com>
List: port-i386
Date: 04/02/1996 10:48:03
>From: Tim Liddelow <tim@cst.com.au>
>Date: Tue, 2 Apr 1996 12:49:07 +1000 (EST)
>
>Has any progress been made on this stack bug in -current ?  From
>a recently built kernel it doesn't seem so.  I still get
>a core dump when trying to run it.  It works fine under FreeBSD.

I seem to remember seeing you asking about this before.  Does it still
coredump if you issue an "unlimit stacksize" command first?  I'm
assuming you use csh; under sh the equivalent command is "ulimit -s
unlimited".

>#include <stdio.h>
>
>#define BAD_NODE_ID (-1)
>#define MAX_NODE 256
>
>typedef struct Graph {
>	int nodes;
>	int edges;
>	int node[MAX_NODE];
>	int edge[MAX_NODE][MAX_NODE];
>	void *node_label[MAX_NODE];
>	void *edge_label[MAX_NODE][MAX_NODE];
>} Graph;
>
>int main() {
>	int i, j;
> 	Graph g;
>
>	puts("Starting..."); fflush(stdout);
>
>	for (i = 0; i < MAX_NODE; i++) {
>		g.node[i] = BAD_NODE_ID;
>		g.node_label[i] = NULL;
>		for (j = 0; j < MAX_NODE; j++) {
>			g.edge[i][j] = 0;
>			g.edge_label[i][j] = NULL;
> 		}
>	}
>	g.nodes = 0;
>	g.edges = 0;
>	return 0;
>}

I don't understand this program, anyway.  Why are you putting this
humongous structure on the stack, instead of using a global or a
pointer to memory allocated by malloc()?  Why is the entire graph
encapsulated into one structure?  Why do you use arrays for the nodes
and edges, instead of linked lists?  Why are the labels void*, instead
of char*?  It all looks very odd to me.

(Mike forces his CS TA personality back into the grave, where it
belongs.)
-- 
Mike Long <mike.long@analog.com>     <URL:http://www.shore.net/~mikel>
VLSI Design Engineer         finger mikel@shore.net for PGP public key
Analog Devices, CPD Division          CCBF225E7D3F7ECB2C8F7ABB15D9BE7B
Norwood, MA 02062 USA       (eq (opinion 'ADI) (opinion 'mike)) -> nil