This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sys_write and system tap


Hi -

On Thu, Jun 08, 2006 at 06:44:30AM -0400, ihern009@fiu.edu wrote:

> I've been doing some work with jprobes for some academic research
> and everything is fine until I attempt to probe sys_write as
> follows:
>
> asmlinkage ssize_t jsys_write(unsigned int fd, const char __user * buf, size_t count)
> {
>       char * args_temp;
>       args_temp = kmalloc(15, GFP_ATOMIC); 
>       vsnprintf(args_temp, 10, "%s", "hello\n");
>       jprobe_return();
>       return 0;
> }

I can't think of any particular reason this should fail, but I am not
a jprobes expert.  It could be that kmalloc vsnprintf is somehow
incompatible with the restricted environment (limited stack space?)
set up by jprobes.  Or kmalloc may have failed (and you don't check
for null args_temp).

> Which causes a kernel oops, crashing somewhere in
> vsnprintf. Unfortunately enough I have just found out about System
> tap as I was googling for information about this oops. No one has
> been able to provide me with any leads towards why this could be
> happening and with an upcomming deadline in a week I can't really
> port my system to use system tap for the time being.

OK.

> I was wondering how you guys handle this in system tap, is there
> anything odd going on that I should look into?
>
> Thanks in advance,
> 
> Igor. 

We did use vsnprintf for formatting messages, and it worked all right
from a variety of probed contexts.  There is now an private
reimplementation in the systemtap runtime library.

- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]