public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: SHASHANK BILGI <shashank192@gmail.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [mtest01w] mtest01w test hangs
Date: Tue, 16 Jul 2013 14:29:24 +0200	[thread overview]
Message-ID: <20130716122924.GA21078@rei> (raw)
In-Reply-To: <CADyrn+t16kR9FAfQSYUB2aYJej1BEFFZcLwUzDi0nKAjHyZ6Rw@mail.gmail.com>

Hi!
> <<<test_start>>>
> tag=mtest01w stime=2336
> cmdline="mtest01 -p80 -w"
> contacts=""
> analysis=exit
> <<<test_output>>>
> [ 2351.111281] rmon:L
> mtest01     0  TINFO  :  Total memory already used on system = 22796 kbytes
> mtest01     0  TINFO  :  Total memory used needed to reach maximum =
> 1750246 kbytes
> mtest01     0  TINFO  :  Filling up 80% of ram which is 1727450 kbytes
> mtest01     1  TBROK  :  stopped at 716177408 bytes: errno=ENOMEM(12):
> Cannot allocate memory
> 
> 
> * When the malloc fails the child process seems to be calling tst_exit().
> mtest01.c
> .....
> .....
>         if (pid == 0) {
>                 bytecount = chunksize;
>                 while (1) {
>                         if ((mem = malloc(chunksize)) == NULL) {
>                                 tst_resm(TBROK | TERRNO,
>                                          "stopped at %lu bytes", bytecount);
>                                 free(pid_list);
>                                 tst_exit();
>                         }
> 
> .....
> .....
> 
> * but in this case i can see the child process in the process list(ps -ax)
> in sleep state.
> 
>  333 ttyAM0   S      0:00 mtest01 -p80 -w
>  334 ttyAM0   Z      0:14 [mtest01] <defunct>
>  335 ttyAM0   S      0:13 mtest01 -p80 -w
> 
> Here is my query , why tst_exit() isn't ending the child process?

Using tst_exit() and any other tst interface from child is a mistake but
tst_exit() should end the child process.

However there may be other childrens still running as tst_exit() is just
equivalent to exit() (it does flush output buffers and exits the process
with result as return value but nothing more).

So my guess is that the rest of the childrens continue to fill the
chunks and then waits to be reaped by the parent. Which may hang the
machine if there is not enough memory.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2013-07-16 12:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-16 10:57 [LTP] [mtest01w] mtest01w test hangs SHASHANK BILGI
2013-07-16 12:29 ` chrubis [this message]
     [not found]   ` <CADyrn+vPD7d4o4F4r7HayBJ-Q9iKL4HefbUxkcJVik8yb80o7w@mail.gmail.com>
2013-07-17 13:57     ` chrubis
     [not found]       ` <CADyrn+sgQJL+0NOFp3GW78LoqmKG1szFbu+C14Dk8SZgu=fe2Q@mail.gmail.com>
     [not found]         ` <CADyrn+s2BjHFhT5BnHSHOzQmyqyEf=bofjj+6E-oKhp9OyGohA@mail.gmail.com>
2013-07-30 15:56           ` chrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130716122924.GA21078@rei \
    --to=chrubis@suse.cz \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=shashank192@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox