git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Fix a signal handler

From
MEMarkus Elfring <markus.elfring@web.de>
Date
Feb 23, 2010, 08:55 UTC
Message-ID
<4B839811.6040109@web.de>
In-Reply-To
<7v1vgdgm02.fsf@alter.siamese.dyndns.org>
>     Subject: [PATCH] log --early-output: signal handler pedantic fix
I would prefer a correct and portable approach here instead of a "pedantic" one.
  ;-)
> I'd phrase the above like this:
It might be that the suggested commit message was too terse.
>     The behavior is undefined if the signal handler refers to any object
>     other than errno with static storage duration other than by assigning
>     a value to a static storage duration variable

I would not repeat the specification of undefined behaviour if a reference to a standard like POSIX will be sufficient.

> and that would be sufficiently clear without saying anything else.
It seems that we have got different opinions about the clarity of signal handling.
Show 5 quoted lines
> Your proposed log message also needs to make a good counter-argument why
> the above "we purposely avoid using sigatomic_t --- it is not worth the
> hassle of having to deal with systems that lack this type in practice" is
> worried too much, and it now is sensible to assume that everybody has
> sigatomic_t these days to allow us do "the right thing".

This data type is actually not used (because an underscore is missing in the name). ;-)

> It can be just as simple as 'Output from "git grep sigatomic_t" indicates
> that we are already using it.' but you need to say something, as this
> comment you are removing makes it clear that it was not a bug by mistake
> or ignorance, but instead was a deliberate choice.

Should I really add to the log message that there is another user for it like the source file "progress.c"?

> According to POSIX, "s-e-o" has to be "volatile sig_atomic_t".

How do you think about informations from a discussion on a topic like 'Is "volatile sig_atomic_t" redundant'? http://groups.google.de/group/comp.lang.c/browse_frm/thread/da3118a2d2c0737c/718dc093b83e03f8?#718dc093b83e03f8

> Also we do not explicitly initialize bss variables to zero or NULL.

If we would like to insist on the implementation of a strictly conforming program, the source code should be restructured even more. https://www.securecoding.cert.org/confluence/display/seccode/SIG31-C.+Do+not+access+or+modify+shared+objects+in+signal+handlers

The variable "show_early_output" should be moved to the source file "builtin-log.c" where it will become "static". Other means would be needed to transfer corresponding state changes to the function "path_name".

Regards, Markus

Previous: Junio C HamanoNext: Markus Elfring
Message 31 of 36 in “Fix signal handler”
  1. Markus ElfringFeb 2, 2010
  2. Jeff KingFeb 2, 2010
  3. Markus ElfringFeb 2, 2010
  4. Jeff KingFeb 2, 2010
  5. Markus ElfringFeb 3, 2010
  6. Jeff KingFeb 3, 2010
  7. Markus ElfringFeb 3, 2010
  8. Thomas RastFeb 3, 2010
  9. Markus ElfringFeb 3, 2010
  10. Shawn O. PearceFeb 3, 2010
  11. Andreas EricssonFeb 3, 2010
  12. Markus ElfringFeb 3, 2010
  13. Andreas EricssonFeb 4, 2010
  14. Jeff KingFeb 3, 2010
  15. Markus ElfringFeb 3, 2010
  16. Bill LearFeb 3, 2010
  17. Markus ElfringFeb 9, 2010
  18. Daniel BarkalowFeb 9, 2010
  19. Markus ElfringFeb 10, 2010
  20. Shawn O. PearceFeb 10, 2010
  21. Jeff KingFeb 10, 2010
  22. Jeff KingFeb 10, 2010
  23. Markus ElfringFeb 13, 2010
  24. Jeff KingFeb 14, 2010
  25. Junio C HamanoFeb 14, 2010
  26. Markus ElfringFeb 18, 2010
  27. Junio C HamanoFeb 18, 2010
  28. Markus ElfringFeb 19, 2010
  29. Markus ElfringFeb 22, 2010
  30. Junio C HamanoFeb 22, 2010
  31. Markus ElfringFeb 23, 2010
  32. Markus ElfringFeb 23, 2010
  33. Junio C HamanoFeb 23, 2010
  34. Markus ElfringFeb 24, 2010
  35. Andreas EricssonFeb 24, 2010
  36. Markus ElfringFeb 24, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.