Mike Hommey: signal() doubly considered harmful
When you want to set signal handlers on UNIX systems, the typical choice is to use
signal (specified in C89, C99 and POSIX.1-2001) or sigaction (specified in POSIX.1-2001 and System V r4).
Quoting the signal manual page:
The only portable use ofThen it goes on about the UNIX vs BSD semantics, and how they affect signal delivery, which essentially is the main reason why one would want to stop usingsignal()is to set a signal s disposition toSIG_DFL or SIG_IGN. The semantics when usingsignal()to establish a signal handler vary across systems (and POSIX.1 explicitly permits this variation); do not use it for this purpose. POSIX.1 solved the portability mess by specifyingsigaction(2), which provides explicit control of the semantics when a signal handler is invoked; use that interface instead ofsignal().
signal and use sigaction instead, with specifically chosen flags.
But this is not really what I wanted to talk about here.
One of the uses of signal or sigaction is to temporarily set a signal handler and restore the old signal handler once the job is done. Notwithstanding the fact that it s a pretty horrible thing to do in a multi-threaded program, it s also a horrible thing to do at all with signal if sigaction is used.
The core of the problem is the following: the information you get from signal() about the old signal handler is missing all the important pieces about it if it was originally set with sigaction(), namely, flags, masks and restorer.
So if you do use signal() to temporarily set a signal handler and then restore the previous signal handler, you risk resetting flags, masks and restorer. The first awful thing this means is the previous signal handler might be expecting three arguments, only one of which will be valid when it s invoked. Unexpected things can also happen with the lack of expected flags or masks. This is why you ll see horrible workarounds like this or that.
In short, if you do use signal() to temporarily set a signal handler and then restore the previous signal handler, you re doing it wrong. And if you do that in a system library or driver, thank you for screwing things up. I m looking at you libsc-a3xx.so.
My new employer sponsors me a phone of my choice (up to a certain cost) and I'm very inclined to order a
This is an update on the
I want a CLI WebDAV client that's better than cadaver or hdav.
I want a program that can sync an .ics file with a CalDAV
server, by dividing it up into events and individually
synchronizing each of those. I don't have a clue how
deletions would be handled, but that would be nice too.
Then I want a program that can synchronize the .ics file
with org-mode files.
I want a SIP client that works as well as Twinkle but has
the architecture of SFLphone or is a library upon which
an arbitrary UI can be constructed.
I want an HTML-rendering library that has callbacks or hooks
for security- and privacy-relevant things like cookies and
SSL certificates. I want at least one browser built on this
library. I want it to support vi-like keybindings.
I want an HTTP(S) proxy that can be dynamically-configured
per-client or per-connection through a standardized protocol
that web browsers or their plugins can speak. I want it to
be able to handle all the relevant things covered by AdBlock
Plus, RequestPolicy, and NoScript.
I want HTTPS authentication through Monkeysphere and
mod_gnutls.
I want a git-annex backend for Ogg Vorbis files that treat
the audio streams independently of the metadata yet stores
them together in the same file so that everything behaves
as usual but the annex doesn't bloat by 400Go after I run
beets.
I want a file transfer queuing system that can work over
any sort of transport mechanism, direct or asynchronous,
that handles partial transfers and throttling, and is
generally magical.
I want all kinds of accounting software improvements.
I want sane PBX software.
I want an OpenStack that doesn't use libvirt for KVM.
I want backup software that behaves some weird hybrid of
BoxBackup and Dirvish.
I want a peer-to-peer card- and board-game platform that
uses cryptographic assurance.
I want everyone to use YAML instead of XML.
I want a phone that's not running a doomed operating system.
I want lots of other stuff.
Not so long ago I read
AltOS 1.2.1 TeleBT support, bug fixes and new AltosUI features
Bdale and I are pleased to announce the release of

Keith and I are pleased to announce the immediate availability of
Occasionally, someone asks me whether we should encourage use of the --ask-cert-level option when certifying OpenPGP keys with gpg. I see no good reason to use this option, and i think we should discourage people from trying to use it. I don't think there is a satisfactory answer to the question "how will specifying the level of identity certification concretely benefit anyone involved?", and i don't see why we should want one. gpg gets it absolutely right by not asking users this question by default. People should not be enabling this option. Some background: gpg's --ask-cert-level option allows the user who is making an OpenPGP identity certification to indicate just how sure they are of the identity they are certifying. The user's choice is then mapped into four levels of OpenPGP certification of a User ID and Public-Key packet, which i'll refer to by
You may not know this, but I am a huge PowerDNS fan. This may be because it is so simple to use, supports different databases as backends or maybe just because I do not like BIND, pick one.
I also happen to live in Germany where ISPs usually do not give static IP-addresses to private customers. Unless you pay extra or limit yourself to a bunch of providers that do good service but rely on old (DSL) technology, limiting you to some 16MBit/s down and 1MBit/s up. Luckily my ISP does not force the IP-address change, but it does happen from time to time (once in a couple of month usually). To access the machine(s) at home while on a non-IPv6-capable connection, I have been using my old (old, old, old) DynDNS.com account and pointing a CNAME from under die-welt.net to it.
Some time ago, DynDNS.com started supporting AAAA records in their zones and I was happy: no need to type hostname.ipv6.kerker.die-welt.net to connect via v6 just let the application decide. Well, yes, almost. It s just DynDNS.com resets the AAAA record when you update the A record with ddclient and there is currently no IPv6 support in any of the DynDNS.com clients for Linux. So I end up with no AAAA record and am not as happy as I should be.
Last Friday I got a mail from DynDNS: