Closed paulfloyd closed 4 years ago
This reduced example is quite interesting (not that I'm 100% certain that this is the same problem).
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
void on_sigusr1(int sig)
{
printf("SIGUSR1 received!\n");
}
int main(void)
{
signal(SIGUSR1, &on_sigusr1);
raise(SIGUSR1);
}
It seems to work OK with GCC but with clang it crashed but only if debug (-g) was specified.
The fix for issue #117 also resolves the SIGSEGV here.
Now only have the issue of test3 generating SIGSEGV rather than SIGBUS.
Fixed with commit commit 8002159ac1d600e5521392f08e30b57d7897e533
There's an issue with the testcase not working correctly standalone. Test 3 is supposed to generate a SIGBUS but instead it is generating a SIGSEGV. Under Valgrind it isn't getting that far, and terminates after Test 1.
I did have some false hopes based on the sigaction manpage that there was an issue related to struct sigaction. But it seems as though the manpage is wrong and in fact the two function pointers are in a union.