[PATCH] uprobes: fix SMP multithreading race

Jim Keniston jkenisto@us.ibm.com
Sat Jun 9 22:04:00 GMT 2007


The enclosed patch fixes a problem seen on SMP systems when multiple
threads of a multithreaded app are pounding the probed instruction
when the uprobe is registered.  This patch applies atop the most recent
uprobes patch set, which I posted May 25 (May 26 UTC):
http://sources.redhat.com/ml/systemtap/2007-q2/msg00399.html

The problem was intermittent, but I was able to tickle it pretty
reliably using the enclosed script.  In the test suite, run
$ probe7-thread 1000000000		# 1 billion
and after that's started, run the script
# ./poundt
The bug causes probe7-thread to die with a SIGSEGV.  The fix allows
probe7-thread to run to completion.

Jim Keniston
----- poundt -----
#!/bin/bash
vaddr=`objdump -d probe7-thread | awk '$2=="<add>:" {print $1}'`
pid=`ps -e -o fname,pid | awk '$1=="probe7-t" {print $2}'`

kill -cont $pid

# While probed process runs...
while (ps -p $pid > /dev/null)
do
	sleep 0.2
	insmod probe5.ko verbose=0 vaddr=0x$vaddr pid=$pid
	if [ $? -ne 0 ]
	then
		exit 1
	fi
	sleep 0.2
	rmmod probe5
done
exit 0
-----

-------------- next part --------------
A non-text attachment was scrubbed...
Name: uprobes-smp-pounder-fix.patch
Type: text/x-patch
Size: 2297 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/systemtap/attachments/20070609/63ffa434/attachment.bin>


More information about the Systemtap mailing list