Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Synchronous signal behavior inconsistant?

0
Posted

Synchronous signal behavior inconsistant?

0

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

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123