This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
jprobe bug?
- From: Martin Hunt <hunt at redhat dot com>
- To: systemtap at sources dot redhat dot com
- Date: Fri, 28 Jan 2005 17:00:58 -0800
- Subject: jprobe bug?
- Organization: Red Hat Inc.
I just noticed this afternoon that my poll probe example wasn't working
correctly. I can simplify it to a single empty probe and still see the
problem. The probe is
void fastcall inst_add_wait_queue (wait_queue_head_t *q, wait_queue_t
*wait)
{
jprobe_return();
}
I'll attach full source.
I compile that code into a module and load it. Then launch Firefox.
Firefox almost never launches. It usually hangs immediately. In the
rare case it launches, if I close it and try to launch it again, it
hangs. Eventually the system locks up.
This happens on an x86_64 running 2.6.10-1.753_FC3.smp and an x86
running 2.6.10-1.741_FC3.smp
Martin
#include <linux/module.h>
#include <linux/miscdevice.h>
#include <linux/init.h>
#include <linux/hash.h>
#include <linux/string.h>
#include <linux/kprobes.h>
#include <linux/proc_fs.h>
#include <linux/vmalloc.h>
#include <linux/time.h>
#include <linux/spinlock.h>
#include <asm/atomic.h>
#include <asm/uaccess.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/poll.h>
MODULE_PARM_DESC(dtr, "\n");
/* generated by genproto */
void fastcall inst_add_wait_queue (wait_queue_head_t *q, wait_queue_t *wait)
{
jprobe_return();
}
static struct jprobe dtr_probes[] = {
{
.kp.addr = (kprobe_opcode_t *)0xffffffff8014686c,
.entry = (kprobe_opcode_t *) inst_add_wait_queue
},
};
#define MAX_DTR_ROUTINE (sizeof(dtr_probes)/sizeof(struct jprobe))
static int init_dtr(void)
{
int i;
for (i = 0; i < MAX_DTR_ROUTINE; i++) {
printk("DTR: plant jprobe at %p, handler addr %p\n",
dtr_probes[i].kp.addr, dtr_probes[i].entry);
register_jprobe(&dtr_probes[i]);
}
printk("DTR: instrumentation is enabled...\n");
return 0;
}
static void cleanup_dtr(void)
{
int i;
for (i = 0; i < MAX_DTR_ROUTINE; i++)
unregister_jprobe(&dtr_probes[i]);
printk("DTR: EXIT\n");
}
module_init(init_dtr);
module_exit(cleanup_dtr);
MODULE_LICENSE("GPL");