[kprobe bug] pre-handler changes on globals lost

Lynch, Rusty rusty.lynch@intel.com
Wed Jun 15 23:38:00 GMT 2005


>While working with some kprobe unit test, I stumbled across some wacky
>behavior that the below module exposes.
>
>If you build and install this module, you can run tc1 (the working
case)
>by doing a "cat /proc/run_tc1".  You can then run the broken case by
>doing a "cat /proc/run_tc2".
>
>When the module is installed a kprobe with a pre_handler that
increments
>a global counter is registered for a target function.
>
>When the tescase is run it stores the current value of the global
counter,
>calls a simple function (the target function that has been armed with a
>kprobe) that just returns the value of the global counter, and then the
>testcase verifies that the returned value has incremented (thanks to
the
>kprobe.)
>
>By adding a simple printk("peep\n"); to the target function, the
effects
>of the pre_handler on the global counter are lost.
 
Quick correction: The bug is seen when I take AWAY the printk, not add
it. 

    --rusty



More information about the Systemtap mailing list