*BSD News Article 14366


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!sgiblab!zaphod.mps.ohio-state.edu!howland.reston.ans.net!agate!ames!nsisrv!nasahq!mnewell
From: mnewell@nhqvax.hq.nasa.gov
Newsgroups: comp.os.386bsd.questions
Subject: Re: gcc eating up my machine
Message-ID: <1993Apr12.140748.343@nhqvax.hq.nasa.gov>
Date: 12 Apr 93 14:07:48 +0600
References: <9304120856.aa13605@gate.demon.co.uk>
Distribution: world
Organization: NASA Headquarters, Washington D. C.
Lines: 61

In article <9304120856.aa13605@gate.demon.co.uk>, damian@centrix.demon.co.uk (damian) writes:
> This is really two problems:
> 
> 1) When compiling /usr/src/usr.bin/g++/cc1plus/cplus-parse.y it gets through
> yacc ok, but when cc (gcc) compiles it gets into some sort of loop and never
> makes it through (I left my m/c overnight to make sure). Trouble is it has
> munched so much memory or cpu that if it is not a foreground task I can't
> get any cpu time to kill it. The disk light is still plinking though not
> on all the time. I have had this problem before when compiling up a bit
> of X source that contained a large initialised static string (it was a
> bit image for a logo). I presume it is happening here because the yacc
> output has some large initialised static arrays for it's state tables.
> Any ideas as to why this should be happening?

I ran into the infinite loop problem when I was compiling the XView3 stuff.
I've also run into it on other (mainly DOS) compilers.  The compilers seem
to get confused when you use the "<test>?<value1>:<value2>" in-line 
if syntax in C.  I changed lines that looked like

	func(...,<test>?x:y,...)

to

	if (<test>) func(...,x,...);
	 else func(...,y,...);

and that cleared up the problems.

> 
> 2) Should the OS allow a process to hog all the available CPU & memory
> such that there is nothing left to get in and do anything about it?
> 

Why not?  If you want something to run at a lower priority, use the
"nice" command to lower it.  Otherwise, if I'm running something that
I want to have 100% of the CPU, I want it to have 100% of the CPU.

Unfortunately, I *DO* want two processes at the same priority to get
equal share of the CPU.  And, as far as I can tell on all the Unix
type systems I've been on over the years (Ed. 6, Ed. 7, BSD 4.x, Sys V,
Ultrix, 386bsd) that ain't the case...

Mike Newell
NASA Science Internet

> My H/W & OS:-
> 
> 386/33 with 387
> 8M memory
> 300M HD
> 
> 386BSD 0.1 patch 0.2.2 (just installed, doing buildworld.sh!)
> 
> Thanks
> Damian
> -- 
> +----------------------------+------------------------------------------------+
> | Damian Ivereigh            | If you can't suss out what this is replying to |
> | damian@centrix.demon.co.uk | get a threaded news reader, like trn. :-)      |
> | Twickenham, U.K.           | This is the best way to cut wasted traffic     |
> +----------------------------+------------------------------------------------+