public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Re: sys_write and system tap
       [not found] <20060608064430.AFI03706@mailstore2.fiu.edu>
@ 2006-06-08 11:59 ` Frank Ch. Eigler
  2006-06-08 17:41   ` Martin Hunt
  0 siblings, 1 reply; 2+ messages in thread
From: Frank Ch. Eigler @ 2006-06-08 11:59 UTC (permalink / raw)
  To: ihern009; +Cc: systemtap

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sys_write and system tap
  2006-06-08 11:59 ` sys_write and system tap Frank Ch. Eigler
@ 2006-06-08 17:41   ` Martin Hunt
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Hunt @ 2006-06-08 17:41 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: ihern009, systemtap

On Thu, 2006-06-08 at 07:59 -0400, Frank Ch. Eigler wrote:
> 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");

You need to use snprintf() here. vsnprintf() takes a va_list instead of
a variable number of args.

Martin


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-08 17:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20060608064430.AFI03706@mailstore2.fiu.edu>
2006-06-08 11:59 ` sys_write and system tap Frank Ch. Eigler
2006-06-08 17:41   ` Martin Hunt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).