public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: lock_kernel check...
@ 2002-07-09 17:27 dan carpenter
  2002-07-09 17:41 ` Dave Hansen
  0 siblings, 1 reply; 6+ messages in thread
From: dan carpenter @ 2002-07-09 17:27 UTC (permalink / raw)
  To: haveblue; +Cc: kernel-janitor-discuss, linux-kernel

----- Original Message -----
From: Dave Hansen <haveblue@us.ibm.com>
Date: Tue, 09 Jul 2002 02:08:18 -0700 
To: dan carpenter <error27@email.com>
Subject: Re: lock_kernel check...

> cc'ing LKML 'cause this is interesting...
> 
> dan carpenter wrote:
>  > As you can see, the attached script is dead simple.  It prints an
>  > error every time you call return while lock_kernel is held.  On
>  > your computer you will want to comment out print_url() and
>  > uncomment the regular print statement.
> 
> I am continually amazed at all the simple, useful, cool stuff that 
> people come up with.  I like!
> 

Glad you liked it.  :) 

Smatch.pm is from the smatch.sf.net scripts page.  Smatch is a really unfinished code checker that I've been working on.  It is based on reading the papers about the Stanford checker.   

Unfortunately, after a night of sleep I realize that my script is broken for 2 reasons.  
1)  Smatch.pm is meant to track state changes down different code paths.  But unfortunately it wasn't doing that in this case; it was just going down the code without taking into consideration any if_stmts  etc.  I'm extremely embarassed about that.  Sorry.  
2)  What the Stanford checker does is print an error if one return_stmt is called while the kernel is locked and one is called while the kernel is unlocked.  This seems reasonable.

I will fix both mistakes later on this week.  Unfortunately I'm in the process of moving and looking for a job etc so I might not get to it for a bit.

regards,
dan carpenter

PS.  If you liked this script, try out my kmalloc script.  I don't think anyone besides me has successfully installed it yet, so if you have any questions I'd be glad to help.  :P  My phone number until tomorrow evening is (510) 835-7695.

-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Save up to $160 by signing up for NetZero Platinum Internet service.
http://www.netzero.net/?refcd=N2P0602NEP8


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: lock_kernel check...
@ 2002-07-09 18:22 dan carpenter
  0 siblings, 0 replies; 6+ messages in thread
From: dan carpenter @ 2002-07-09 18:22 UTC (permalink / raw)
  To: haveblue; +Cc: kernel-janitor-discuss, linux-kernel

----- Original Message -----
From: Dave Hansen <haveblue@us.ibm.com>
Date: Tue, 09 Jul 2002 10:41:01 -0700 
To: dan carpenter <error27@email.com>
Subject: Re: lock_kernel check...

> dan carpenter wrote:
>  > Smatch.pm is from the smatch.sf.net scripts page.  Smatch is a
>  > really unfinished code checker that I've been working on.  It is
>  > based on reading the papers about the Stanford checker.
> 
> There was a time when I was thinking about the same thing.  It kept 
> scaring me the more I thought about it.
> 

True.  But someone is going to write a checker at some point.  It's only a couple days work if you know what you are doing.  There doesn't seem to be much advantage in waiting a year or two.

>  > Unfortunately, after a night of sleep I realize that my script is
>  > broken for 2 reasons. 1)  Smatch.pm is meant to track state changes
>  > down different code paths.  But unfortunately it wasn't doing that
>  > in this case; it was just going down the code without taking into
>  > consideration any if_stmts  etc.  I'm extremely embarassed about
>  > that.  Sorry.
> 
> Don't be sorry.  The script is smarter than the people who caused the 
> errors.  (once again, probably me)
> 
>  > 2)  What the Stanford checker does is print an error
>  > if one return_stmt is called while the kernel is locked and one is
>  > called while the kernel is unlocked.  This seems reasonable.
> 
> Could you clarify that a bit?
> 

If someone made a mistake where they always returned under a kernel_lock() they would find the mistake themselves.  

Why would they return under kernel_lock() on error, for example, but not on success?  That would be confusing.  There would still be some false positives but the number of cases is really small.

regards,
dan carpenter


-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

Save up to $160 by signing up for NetZero Platinum Internet service.
http://www.netzero.net/?refcd=N2P0602NEP8


^ permalink raw reply	[flat|nested] 6+ messages in thread
[parent not found: <20020709081059.17951.qmail@email.com>]

end of thread, other threads:[~2002-07-09 18:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-09 17:27 lock_kernel check dan carpenter
2002-07-09 17:41 ` Dave Hansen
  -- strict thread matches above, loose matches on Subject: below --
2002-07-09 18:22 dan carpenter
     [not found] <20020709081059.17951.qmail@email.com>
2002-07-09  9:08 ` Dave Hansen
2002-07-09 10:31   ` Zwane Mwaikambo
2002-07-09 17:04     ` Dave Hansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox