Why isn't my signal handler being called?
As many have already commented, you shouldn't be doing this with signals at all. When it goes wrong (and it will, like it did) trying to find out what is wrong when undefined behaviour is behind it is hard if not impossible.
Using non async-safe system calls like fprintf inside signal handlers can corrupt the data since fprintf is operating on the same stream. Same with shared variables.
Since you are using linux, signals of the same type will not be blocked, meaning that rapid delivery of the same signal can result in recursive call to the handler. Once a signal is caught, the disposition of the signal is reset to SIG_DFL and needs to be reestablished in the handler again (which can also fail if the signal is delived before it has the change to be reestablished).
That is why you can send a maximum of 1 signal of the same type before the signal gets reset to default and terminated the program with "user signal xx".
I would recommend you stop tormenting yourself with the code and grab some textbook or a tutorial and try to follow that.
Signal call should also be avoided if it goes. From the man pages:
The behavior of signal() varies across UNIX versions, and has also varied historically across different versions of Linux. Avoid its use: use sigaction(2) instead.