lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 23 Apr 2014 23:38:34 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	Jiri Olsa <jolsa@...hat.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...nel.org>,
	Paul Mackerras <paulus@...ba.org>,
	Namhyung Kim <namhyung.kim@....com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] perf record: Propagate exit status of a command
 line workload

Hi Stephane,

2014-04-23 (수), 14:11 +0200, Stephane Eranian:
> On Wed, Apr 23, 2014 at 8:40 AM, Namhyung Kim <namhyung@...nel.org> wrote:
> > +out_child:
> > +       if (forks) {
> > +               int exit_status;
> >
> > -       return 0;
> > +               if (!child_finished)
> > +                       kill(rec->evlist->workload.pid, SIGTERM);
> > +
> > +               wait(&exit_status);
> > +
> > +               if (err < 0)
> Not quite this. Although this works with my test case with 'false'.
> It fails when I tried the opposite test case:
> 
> $ perf record true && echo yes || echo no
>   [ perf record: Woken up 1 times to write data ]
>   [ perf record: Captured and wrote 0.013 MB perf.data (~589 samples) ]
>   no
> 
> The return code in this case is 255. I tracked it down to err being last set
> by poll() which got interrupted by SIGCHLD. So I think the err value must
> be overridden somehow in this case. Maybe something like:
> 
>                         err = poll(evsel_list->pollfd, evsel_list->nr_fds, -1);
>                         if (err < 0 &&  errno == EINTR && forks && done)
>                                 err = 0;

Hmm.. just checking "err < 0 && errno == EINTR" isn't enough?

And I guess the same problem can be occurred during record__mmap_read()
as it calls record__write() which eventually calls ion() and it seems
not to handle the above case..  I'll cook a patch for it too.

Thanks,
Namhyung



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ