Sergei Shtylyov wrote:
> Hello.
>
> Jason Wessel wrote:
>
>> I finally came across the case where CONFIG_DEBUG_PREEMPT crashes 
>> user space processes on i386 and x86_64.   When debugging a syscall, 
>> if gdb reads any invalid memory and triggers the may_fault path, the 
>> preempt count is not restored when doing the context restore.
>
>   Hm, I wonder how CONFIG_DEBUG_PREEMPT influences this...
>
It seems that you are right and it has to be generic to just 
CONFIG_PREEMPT.  I just looked at the header file and can see that it is 
generic and I should call dec_preempt_count() instead.


>
>    Don't we need similar change on IA64?
>

It would appear that it does and perhaps mips too.   Basically anything 
that uses the die chain notify as the primary mechanism to enter kgdb 
needs this because the die chain will increment the preempt count by 
one.  And to prevent the  scheduling while atomic from killing off the 
process you have to decrement the preempt count before doing a long jump 
(IE restore it to what it was before the fault).

I know it is pretty darn ugly, but KGDB should not kill off threads.

Jason.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to