On Fri, Aug 19, 2011 at 05:38:19PM +0200, Denys Vlasenko wrote:
> On Fri, 2011-08-19 at 00:02 +0400, Dmitry V. Levin wrote:
> > On Thu, Aug 18, 2011 at 12:47:38PM +0200, Denys Vlasenko wrote:
[...]
> > > > Alternative solution is to make sys_sigreturn print mask
> > > > on entry, not on exit. What is the reson it doesn't do that now?
> >
> > Can sys_sigreturn be interrupted somehow?
>
> Does it matter?
>
> Currently, sigreturn in strace looks like this:
>
> wait4(-1, 0xbfa81764, WSTOPPED, NULL) = ? ERESTARTSYS (To be restarted)
> --- {si_signo=SIGINT, si_code=SI_USER, si_pid=13194, si_uid=0} (Interrupt) ---
> sigreturn() = ? (mask now [])
> --- {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=13194, si_status=0,
> si_utime=0, si_stime=0} (Child exited) ---
> sigreturn() = ? (mask now [])
> wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WSTOPPED, NULL) = 13194
>
>
> I propose to change it into something like this:
>
> wait4(-1, 0xbfa81764, WSTOPPED, NULL) = ? ERESTARTSYS (To be restarted)
> --- {si_signo=SIGINT, si_code=SI_USER, si_pid=13194, si_uid=0} (Interrupt) ---
> sigreturn([]) = 0
> --- {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=13194, si_status=0,
> si_utime=0, si_stime=0} (Child exited) ---
> sigreturn([]) = 0
> wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WSTOPPED, NULL) = 13194
>
> because that's how it _really_ happens: the signal mask is actually known
> BEFORE sigreturn is executed, so why are we printing it AFTER it returns?
> (And in the process, torture ourselves with stupid saving/restoring of
> sigmask for that). Look at sys_sigreturn() in strace source to see it.
If the signal mask is known on enter, lets print it also on enter.
> (The only wart here is that sigmask is not a sigreturn's parameter, so
> printing it as "sigreturn([])" is slightly wrong/misleading. Any ideas
> how to show it better? With curly braces maybe - {[mask]}?)
>
> Do you like this idea?
Curly braces usually mean a pointer to a structure, but I see no better
way to express the signal mask on enter.
--
ldv
pgpDqnMwB1TUj.pgp
Description: PGP signature
------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________ Strace-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/strace-devel
