Building latest Unix VM - how?

Lex Spoon lex at cc.gatech.edu
Sat Jan 19 18:05:23 UTC 2002


cg at home.cdegroot.com (Cees de Groot) wrote:
> Hi,
> 
> Because I want to look into Squeak's consuming inordinate CPU resources now
> and then (constantly calling gettimeofday()) and because I want to extent the
> socket primitives to accept an IP address to listen on (so you can run it
> besides Apache on port 80, both on their own IP address; sort of important for
> hosting Squeak), I am trying to build a recent VM under Linux. 
> 
> I've tried VMMaker and Tim's platforms zip file, but that had all sort of
> problems with paths and a broken configure; the platforms/ from SourceForge
> are much better, but the makefile is not updated for the plugins (a line
> '@auto_make@' lingers in the generated Makefile). Could someone help me in
> building My Own Hacker VM?
> 

If you want to build it Right Now, I think the best place to start is at
this page:

	http://minnow.cc.gatech.edu/squeak/2173


CVS is inconsistent right now, I'm sorry to say -- I got interrupted
halfway through, and it's not clear what will happen next.


For the particular problem you mention, there actually is a better
system in the VM based on itimers.  However, it's disabled by default! 
The problem is that signals start coming in, and on most Unices this
causes system calls to get interrupted.  In Squeak the problem manifests
as primitives failing at random times.

The way to fix it is to put a while loop around every system call, and
repeat it until it returns something other than EINTR.  For example,
instead of:

	fd = open(filename, O_RDONLY);

Do this:

	while((fd = open(filename, O_RDONLY)) < 0
	      &&  errno == EINTR)
		;


Yes, with *every* system call....  Yay Unix!  Some Unices have
improvements on this state, but I think that many do not, and so this
must be done the hard way to be portable.


-Lex



More information about the Squeak-dev mailing list