9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Booting on slow CPUs
@ 2002-03-15 18:10 Lucio De Re
  0 siblings, 0 replies; 5+ messages in thread
From: Lucio De Re @ 2002-03-15 18:10 UTC (permalink / raw)
  To: 9fans mailing list

I seem to have isolated the problem to a race (almost literally)
condition between init0() terminating and whatever may be happening
behind the scenes that seems to beat init0() and cause it to stall.

If I empty init0()'s inner core (the bit controlled by !waserror()),
the booting procedure procceds, however crippled.  Various
strategically placed "print" calls give different degrees of progress.

If anybody can save me much further searching to find out which
operation is trashing init0(), I would appreciate the help greatly.

A question I have to ask, is whether poperror() within a section
controlled by !waserror() isn't in the wrong place.  But I don't for
one moment think this has any bearing on my quest.

++L


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Booting on slow CPUs
  2002-03-16 18:55 Russ Cox
@ 2002-03-17  7:26 ` Lucio De Re
  0 siblings, 0 replies; 5+ messages in thread
From: Lucio De Re @ 2002-03-17  7:26 UTC (permalink / raw)
  To: 9fans

On Sat, Mar 16, 2002 at 01:55:12PM -0500, Russ Cox wrote:
> 
> Sorry, I thought you'd looked at waserror() before
> and had just missed this one case.  It's not a normal
> function.  It's used to implement exceptions via
> a setjmp/longjmp-equivalent and a stack of jmpbufs.  
> 
It's a reasonable assumption, I have to confess.  It's a difficult bad
habit to break, this shooting from the hip.  I forget that in this
forum I'm in the lower echelons, unlike my daily surroundings :-)

> See http://www.vitanuova.com/inferno/man/10/error.html.
> 
Thank you, I hope that will help.

++L


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Booting on slow CPUs
@ 2002-03-16 18:55 Russ Cox
  2002-03-17  7:26 ` Lucio De Re
  0 siblings, 1 reply; 5+ messages in thread
From: Russ Cox @ 2002-03-16 18:55 UTC (permalink / raw)
  To: 9fans

Sorry, I thought you'd looked at waserror() before
and had just missed this one case.  It's not a normal
function.  It's used to implement exceptions via
a setjmp/longjmp-equivalent and a stack of jmpbufs.  

See http://www.vitanuova.com/inferno/man/10/error.html.

Russ


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Booting on slow CPUs
  2002-03-15 20:07 Russ Cox
@ 2002-03-16 18:31 ` Lucio De Re
  0 siblings, 0 replies; 5+ messages in thread
From: Lucio De Re @ 2002-03-16 18:31 UTC (permalink / raw)
  To: 9fans

On Fri, Mar 15, 2002 at 03:07:49PM -0500, Russ Cox wrote:
> 
> You need to poperror() on the path where there's no error, thus:
> 
> 	if(waserror()){
> 		/* no poperror on this path ... */
> 		return nil;
> 	}
> 	poperror();
> 
I guess I ought to look at waserror(), but surely the above is totally
counter-intuitive?  Maybe a poor selection of function names?

> but
> 
> 	if(!waserror()){
> 		/* do some stuff... */
> 		poperror();
> 	}
> 	/* more stuff */
> 
> The second is idiomatic for ``do some stuff, stopping early
> if you encounter an error; either way, then do more stuff.''
> 
Sorry, I'm being obtuse here, but perhaps you want to rephrase your
description: would

"if no error, do some stuff; irrespective, thereafter do more stuff"

be more accurate (if slightly mangled English)?

++L


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Booting on slow CPUs
@ 2002-03-15 20:07 Russ Cox
  2002-03-16 18:31 ` Lucio De Re
  0 siblings, 1 reply; 5+ messages in thread
From: Russ Cox @ 2002-03-15 20:07 UTC (permalink / raw)
  To: 9fans

You need to poperror() on the path where there's no error, thus:

	if(waserror()){
		/* no poperror on this path ... */
		return nil;
	}
	poperror();

but

	if(!waserror()){
		/* do some stuff... */
		poperror();
	}
	/* more stuff */

The second is idiomatic for ``do some stuff, stopping early
if you encounter an error; either way, then do more stuff.''

Russ



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-03-17  7:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-15 18:10 [9fans] Booting on slow CPUs Lucio De Re
2002-03-15 20:07 Russ Cox
2002-03-16 18:31 ` Lucio De Re
2002-03-16 18:55 Russ Cox
2002-03-17  7:26 ` Lucio De Re

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).