Subject: Re: Need help from core-knowing people
To: Daniel Widenfalk <>
From: Chris G Demetriou <Chris_G_Demetriou@LAGAVULIN.PDL.CS.CMU.EDU>
List: amiga
Date: 01/22/1995 21:05:07
> My problem is:
> st_mode_sense gives my Fastlane driver a buffer which is located on some
> process' stack (&mode_sense I think) but when my driver (which is interrupt
> driven almost always) gets to the data in phase I find that the virtual
> to physical mapping has changed! My suspicion is that a process switch
> has occured and with that, the interrupt routine runs on a diffrent stack
> => The data gets transfered to an illegal adress.
> If you know how to work around this PLEASE let me know how.

there was a similar bug like this in some of the i386 SCSI code, a
while ago.

Yes, the problem is probably that a context switch has occurred, etc.

the solution is very simple:

NEVER, EVER allocate data structures that may be accessed at interrupt
time on a per-process stack.

there's a reason that 'malloc' exists in the kernel.  8-)