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:	Sun, 11 May 2014 15:30:18 +0200
From:	Jiri Olsa <jolsa@...hat.com>
To:	Namhyung Kim <namhyung@...nel.org>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	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>,
	Stephane Eranian <eranian@...gle.com>,
	David Ahern <dsahern@...il.com>
Subject: Re: [PATCH v6 1/2] perf record: Propagate exit status of a command
 line workload

On Fri, May 09, 2014 at 02:14:17PM +0900, Namhyung Kim wrote:
> Currently perf record doesn't propagate the exit status of a workload
> given by the command line.  But sometimes it'd useful if it's
> propagated so that a monitoring script can handle errors
> appropriately.
> 
> To do that, it got rid of exit handlers and run/call them directly in
> the __cmd_record().  I don't see any reason why those are in a form of
> exit handlers in the first place.  Also it cleaned up the resource
> management code in record__exit().

so in this last change we keep one exit handler, please update
the changelog

> 
> With this change, perf record returns the child exit status in case of
> normal termination and send signal to itself when terminated by signal.
> 

SNIP

>  
>  out_delete_session:
>  	perf_session__delete(session);
> -	return err;
> +	return status;

we dont set status correctly before the 'goto out_delete_session'
in the following condition:

                err = perf_evlist__prepare_workload(rec->evlist, &opts->target,
                                                    argv, file->is_pipe,
                                                    workload_exec_failed_signal);
                if (err < 0) {
                        pr_err("Couldn't run the workload!\n");
                        goto out_delete_session;
                }

so we dont propagate status correctly in case the above function fails:

[jolsa@...va perf]$ ulimit -n 6
[jolsa@...va perf]$ ./perf record sleep 100
failed to create 'go' pipe: Too many open files
Couldn't run the workload!
[jolsa@...va perf]$ echo $?
0
[jolsa@...va perf]$

thanks,
jirka
--
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