Re: Fix signal handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 02, 2010 at 05:14:23PM +0100, Markus Elfring wrote:

> The function "early_output" that is set as a signal handler by the
> function "setup_early_output" contains a simple looking instruction.
> [...]
> A global variable gets a function pointer assigned.
> [...]
> I find that this approach does not fit to standard rules because the
> data type "sig_atomic_t" is the only type that can be safely used for
> global write access in signal handlers.

No, it's not a sig_atomic_t, but it is assignment of a single function
pointer that is properly declared as volatile. Is this actually a
problem on any known system?

If you want to nit-pick, there are much worse cases. For example, in
diff.c, we do quite a bit of work in remove_tempfile_on_signal. It
assumes that char* assignment is atomic, but nothing is even marked as
volatile. But again, is this actually a problem on any system?

You will find that most git developers care about real problems that can
be demonstrated on real systems. Standards can be a useful guide, but
they can be too loose (e.g., we run on some non-POSIX systems) as well
as too restrictive. What matters is what actually runs in practice.

If you can demonstrate a practical problem and provide a patch, then I
am sure people would be happy to read it.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]