Mitchell Schoenbrun wrote:
Brandon Fosdick <> bfoz@glue.umd.edu> > wrote:
QNX4, Ampro 486Dxi PC104 processor, SanDisk HDD
I’m writing a program that services interrupts from a card and kicks a
proxy, then writes the data to a file which is on the SanDisk. When I
use fwrite the program segfaults after about 1000 interrupts, if I use
write it segfaults randomly. So I think its a problem with interrupts
occuring during disk writes, i.e. when fwrite flushes the buffer or
during write. Has anybody seen this? or have a way to fix it?
How do you store the data in your interrupt handler? Do
you have a large buffer that you fill up? Do you handle
overflow properly?
Since it is your program that sigsegsv’s it should have
nothing to do with when the disk is being written to.
Fsys is a separate protected process which gets your
data message passed to it.
Actually, I don’t store the data in the handler. The handler does
nothing more than kick a proxy, which then handles all of the
read/writing.
pid_t far irq_handler()
{
return proxy;
}
main()
{
…
while(1)
{
Receive(proxy,0,0);
//Read from port
//Write to file
}
}
And thats all it does.
-Brandon