[PATCH v3 2/3] The -z and -Z options print only successful and failing syscalls respectively. However, failure of syscall is only known after syscall return. Thus, we end up with something like this on, e.g., ENOENT:

Dmitry V. Levin ldv at altlinux.org
Wed May 22 02:23:32 UTC 2019


On Thu, Apr 25, 2019 at 04:22:36PM +0200, burkhard.kohl at intel.com wrote:
[...]
> @@ -753,6 +757,15 @@ syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res)
>  	if (raw(tcp)) {
>  		/* sys_res = printargs(tcp); - but it's nop on sysexit */
>  	} else {

This doesn't look correct: -z/-Z should apply to raw(tcp) case as well.

> +#if HAVE_OPEN_MEMSTREAM
> +		if ((not_failing_only && syserror(tcp)) ||
> +			(failing_only && !syserror(tcp))) {
> +			line_ended();
> +			strace_close_memstream(tcp, true);
> +			return 0;   /* ignore failed/successful
> +						 * syscalls */
> +		}
> +#else
>  	/* FIXME: not_failing_only (IOW, option -z) is broken:
>  	 * failure of syscall is known only after syscall return.
>  	 * Thus we end up with something like this on, say, ENOENT:

I suggest to reject -z/-Z options when open_memstream is not available
and remove all !HAVE_OPEN_MEMSTREAM code.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20190522/de03c361/attachment.bin>


More information about the Strace-devel mailing list