* minor nits picked up by valgrind
@ 2002-07-31 7:15 Jeremy Fitzhardinge
2002-08-15 16:28 ` Tim Goodwin
0 siblings, 1 reply; 2+ messages in thread
From: Jeremy Fitzhardinge @ 2002-07-31 7:15 UTC (permalink / raw)
To: rc list
Since valgrind[1] came out, I've been applying it to everything I can
think of. rc was pretty clean, with one actual (but minor) problem and
one non-problem.
The actual problem is that it doesn't clear out the sa_mask when calling
sigaction, which presumably means that there's a random set of signals
masked when calling the signal handler. I'm assuming this isn't a big
problem. Maybe it should be sigfillset instead?
The non-problem is that it tries to call sigaction on SIGKILL and
SIGSTOP. This is ignored by the kernel, but it makes valgrind complain.
Here's a patch for both of these:
--- rc-1.7/signal.c Thu Nov 1 03:29:10 2001
+++ rc-1.7.jsgf/signal.c Tue Jul 30 23:08:39 2002
@@ -14,6 +14,7 @@
new.sa_handler = handler;
new.sa_flags = SA_INTERRUPT;
+ sigemptyset(&new.sa_mask);
sigaction(signum, &new, &old);
return old.sa_handler;
}
@@ -96,6 +97,8 @@
#endif
for (i = 1; i < NUMOFSIGNALS; i++) {
+ if (i == SIGSTOP || i == SIGKILL)
+ continue;
h = sys_signal(i, SIG_IGN);
if (h != SIG_IGN && h != SIG_ERR)
sys_signal(i, h);
J
1: http://developer.kde.org/~sewardj/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: minor nits picked up by valgrind
2002-07-31 7:15 minor nits picked up by valgrind Jeremy Fitzhardinge
@ 2002-08-15 16:28 ` Tim Goodwin
0 siblings, 0 replies; 2+ messages in thread
From: Tim Goodwin @ 2002-08-15 16:28 UTC (permalink / raw)
To: jeremy; +Cc: rc
> Since valgrind[1] came out, I've been applying it to everything I can
> think of. rc was pretty clean, with one actual (but minor) problem and
> one non-problem.
OK, I'll buy both of these. Thanks!
And looking again at the signal code, I found a major booboo (of my
own making), which pulled in the horrid longjmp() code on systems
where it was needed.
With this, and some other problems I've fixed, there have been a few
changes since rc-1.7. A summary is appended, and please see my
hacking page for further details.
http://www.star.le.ac.uk/~tjg/rc/misc/notes
So, time for a new snapshot. Here it is:
http://www.star.le.ac.uk/~tjg/rc/snap/rc-1.7s20020815.tar.gz
Tim.
2002-07-25
Bug: fix globbing of broken symlinks.
2002-07-31
Bug: readline doesn't handle EIO either.
2002-08-15
Bug: variables that are sometimes exported (i.e. $prompt and
$version) need to be made exportable if they are inherited from the
environment.
Portability: don't call sigaction() for SIGKILL or SIGSTOP; don't
hand a garbage signal mask to sigaction() (thanks Jeremy
Fitzhardinge). Also, remove use of SA_INTERRUPT (SUSv3, BSD,
etc. have SA_RESTART with the inverted meaning).
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-08-15 21:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-31 7:15 minor nits picked up by valgrind Jeremy Fitzhardinge
2002-08-15 16:28 ` Tim Goodwin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).