* Resource leak or dead lock in the function task_dentry_path?
@ 2017-01-26 15:32 Arkady
2017-01-26 17:12 ` Arkady
0 siblings, 1 reply; 4+ messages in thread
From: Arkady @ 2017-01-26 15:32 UTC (permalink / raw)
To: systemtap
Hi,
I have the following script
function task_cwd_full_path(pid)
{
task = task_current()
path = task_cwd_path(task)
s = fullpath_struct_path(path)
return s
}
global PATHS%;
probe kernel.function("do_execve")
{
s = task_cwd_full_path(pid())
PATHS[tid()] = s
}
probe syscall.fchdir.return
{
s = task_cwd_full_path(pid())
PATHS[tid()] = s
}
global Tick;
probe begin
{
Tick = 0;
}
probe timer.sec(1)
{
Tick = Tick + 1
printf("Time=%4u\n", Tick)
}
I run the following loop in the shell
sudo find / -name '*' -type f -exec stat {} \;
I am getting "find: cannot fork: Resource temporarily unavailable" in
~60s on ubuntu 4.4.0-59
What am I missing?
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Resource leak or dead lock in the function task_dentry_path?
2017-01-26 15:32 Resource leak or dead lock in the function task_dentry_path? Arkady
@ 2017-01-26 17:12 ` Arkady
2017-01-26 17:47 ` David Smith
0 siblings, 1 reply; 4+ messages in thread
From: Arkady @ 2017-01-26 17:12 UTC (permalink / raw)
To: systemtap
Update.
Apparently task_cwd_path() is an evil. This modification also causes the failure
function task_cwd_full_path(pid)
{
task = task_current()
path = task_cwd_path(task)
return path
}
On Thu, Jan 26, 2017 at 5:31 PM, Arkady <larytet@gmail.com> wrote:
> Hi,
>
> I have the following script
>
> function task_cwd_full_path(pid)
> {
> task = task_current()
> path = task_cwd_path(task)
> s = fullpath_struct_path(path)
> return s
> }
>
> global PATHS%;
>
> probe kernel.function("do_execve")
> {
> s = task_cwd_full_path(pid())
> PATHS[tid()] = s
> }
>
> probe syscall.fchdir.return
> {
> s = task_cwd_full_path(pid())
> PATHS[tid()] = s
> }
>
> global Tick;
>
> probe begin
> {
> Tick = 0;
> }
>
> probe timer.sec(1)
> {
> Tick = Tick + 1
> printf("Time=%4u\n", Tick)
> }
>
> I run the following loop in the shell
>
> sudo find / -name '*' -type f -exec stat {} \;
>
> I am getting "find: cannot fork: Resource temporarily unavailable" in
> ~60s on ubuntu 4.4.0-59
>
> What am I missing?
>
> Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Resource leak or dead lock in the function task_dentry_path?
2017-01-26 17:12 ` Arkady
@ 2017-01-26 17:47 ` David Smith
2017-01-26 19:52 ` Arkady
0 siblings, 1 reply; 4+ messages in thread
From: David Smith @ 2017-01-26 17:47 UTC (permalink / raw)
To: Arkady, systemtap
On 01/26/2017 11:11 AM, Arkady wrote:
> Update.
>
> Apparently task_cwd_path() is an evil. This modification also causes the failure
That's <https://bugzilla.redhat.com/show_bug.cgi?id=1412691>, fixed by
the following commit:
====
commit e519829cd133be935ca9e3cc8e7251b0e74b20f4
Author: Kyle Walker <kwalker@redhat.com>
Date: Thu Jan 12 10:11:39 2017 -0500
RHBZ1412691 - fix kernel mem leak during tapset task_cwd_path()
====
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Resource leak or dead lock in the function task_dentry_path?
2017-01-26 17:47 ` David Smith
@ 2017-01-26 19:52 ` Arkady
0 siblings, 0 replies; 4+ messages in thread
From: Arkady @ 2017-01-26 19:52 UTC (permalink / raw)
To: David Smith; +Cc: systemtap
Problem solved.
Great tip! Thanks!
On Thu, Jan 26, 2017 at 7:47 PM, David Smith <dsmith@redhat.com> wrote:
> On 01/26/2017 11:11 AM, Arkady wrote:
>> Update.
>>
>> Apparently task_cwd_path() is an evil. This modification also causes the failure
>
> That's <https://bugzilla.redhat.com/show_bug.cgi?id=1412691>, fixed by
> the following commit:
>
> ====
> commit e519829cd133be935ca9e3cc8e7251b0e74b20f4
> Author: Kyle Walker <kwalker@redhat.com>
> Date: Thu Jan 12 10:11:39 2017 -0500
>
> RHBZ1412691 - fix kernel mem leak during tapset task_cwd_path()
> ====
>
> --
> David Smith
> dsmith@redhat.com
> Red Hat
> http://www.redhat.com
> 256.217.0141 (direct)
> 256.837.0057 (fax)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-26 19:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-26 15:32 Resource leak or dead lock in the function task_dentry_path? Arkady
2017-01-26 17:12 ` Arkady
2017-01-26 17:47 ` David Smith
2017-01-26 19:52 ` Arkady
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).