lock_kernel check...
----- Original Message -----
From: Dave Hansen <[email protected]>
Date: Tue, 09 Jul 2002 02:08:18 -0700
To: dan carpenter <[email protected]>
Subject: Re: lock_kernel check...
Quoted 11 lines
cc'ing LKML 'cause this is interesting...
Quoted 4 lines · dan carpenter
As you can see, the attached script is dead simple. It prints an error every time you call return while
lock_kernelis held. On your computer you will want to comment outprint_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.
Signature · 6 lines
__________________________________________________________ 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
Quoted 3 lines · dan carpenter
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.
Quoted 6 lines
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_stmtsetc. 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)
Quoted 3 lines
2) What the Stanford checker does is print an error
if onereturn_stmtis called while the kernel is locked and one is called while the kernel is unlocked. This seems reasonable.
Could you clarify that a bit?
Quoted 3 lines
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.
Signature · 2 lines
Dave Hansen [email protected]