Synchronous signal behavior inconsistant?
Antonio, Yes, it *seems* weird, but it’s not. (Well, maybe it is still weird, but at least there’s some logic to it.) If a program accesses unmapped memory, it will trap into the kernel, which will say to itself something like “What a stupid programmer!” and then arrange for a SIGSEGV for that program. Basically it will pick up the program counter right then and there and move it to the signal handler (if any). That’s how synchronous signals work. If you send a signal, any signal, to the process yourself, that will be an asynchronous signal. EVEN if it’s SIGSEGV or SIGBUS. And the sigwaiter will then be able to receive it. -Bil > So, I guess things are not working quite right in that sometimes a > blocked signal is not delivered to the – only – thread which is waiting > for it. > I coded an example in which SIGBUS is blocked and a thread is on > sigwait. I arranged the code so that SIGBUS is “internally” generated, > i.e. I coded a thread that is causing it on purpose. The process goes