Discussion:
Unexpected Interrupt When Returning From Signal Handler
(too old to reply)
cs412017
2005-09-28 02:42:38 UTC
Permalink
I am getting an unexpected interrupt when I am returning from my signal
handler. This obviously means that I have not set up my user stack properly.

The interrupt dump looks like this:

*** Unexpected interrupt! ***
eax=00000000 ebx=00000007 ecx=00000000 edx=00003828
esi=00000000 edi=00005f6b ebp=00005e18
eip=00005f88 cs=00000007 eflags=00010246
Interrupt number=6, error code=0
index=0, TI=0, IDT=0, EXT=0
user esp=00005dd4, user ss=0000000f
cs: index=0, ti=1, rpl=3
ds: index=1, ti=1, rpl=3
es: index=1, ti=1, rpl=3
fs: index=1, ti=1, rpl=3
gs: index=1, ti=1, rpl=3

A few things of note:
a. The user stack pointer in the interrupt dump points 4 bytes ahead of
where I had set it to in Setup_Frame (0x5dd0, whereas here its 0x5dd4).
b. I am using the passed in interrupt state esp and not kthread->esp in
order to get the user stack pointer. I am wondering why there are 2
parameters...

Anyone else get this error? I am not able to access the signal return
trampoline.
cs412017
2005-09-28 05:12:16 UTC
Permalink
Well, Saurabh's response to Sys_ReturnSignal cleared this one up for
me...I've just spent a lot of time trying to debug this error and so if
anyone else is getting this error, the problem was that I was trying to
copy stuff using memcpy to user memory. You should instead use
Copy_To_User as he pointed out.

That's the only thing...everything works fine now!

Continue reading on narkive:
Loading...