Re: /dev/null and KSE panic 100% reproducible

From: Julian Elischer <julian_at_elischer.org>
Date: Tue, 20 May 2003 13:01:46 -0700 (PDT)
On Tue, 20 May 2003, Julian Elischer wrote:
> Someone put the following code into kern/kern_switch.c
>         /*
>          * Only allow non system threads to run in panic
>          * if they are the one we are tracing.  (I think.. [JRE])
>          */
>         if (panicstr && ((td->td_proc->p_flag & P_SYSTEM) == 0 &&
>             (td->td_flags & TDF_INPANIC) == 0))
>                 goto retry;
> 
> 
> It has the effect of throwing away threads that it has taken off teh run
> queue if we are in a panic.
> 
> at a later time anything that goes through these threads will assume
> they are still on teh run queue and panic becasue they are not..
> 
> try the following:
> 
> change it to:
> 
>         if (panicstr && ((td->td_proc->p_flag & P_SYSTEM) == 0 &&
>             (td->td_flags & TDF_INPANIC) == 0)) {
> 		/* note that it is no longer on the run queue */
> 		TD_SET_CAN_RUN(td);
> 	         goto retry;
> 	}
> 
> 
> if it fails you may try TD_SET_SUSPENDED(td) instead, but I think this
> is better.
> 

Note, this panic can only happen if you are already panicing, as seen
below.. 
This is why I haven't seen it.

> > 
> > panic: No strategy on dev null responsible for buffer 0xc776ab90
> > 
> > syncing disks, buffers remaining... 2230 2230 2229 2229 2229 2228 2228 
> > 2228 2228 2228 2228 panic: KSE not on run queue
Received on Tue May 20 2003 - 11:01:50 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:08 UTC