Re: [Interest] Connecting signal handler to Qt application - async-handler-safety

2020-06-16 Thread Giuseppe D'Angelo via Interest
Il 15/06/20 18:12, Thiago Macieira ha scritto: No, you can't, because you need to block the signal using pthread_sigmask in all threads, otherwise the kernel may prefer delivering the signal instead of using the signalfd. Qt has a few background threads (like the QHostInfo thread pool) that you

Re: [Interest] Connecting signal handler to Qt application - async-handler-safety

2020-06-15 Thread Thiago Macieira
On segunda-feira, 15 de junho de 2020 04:06:28 PDT Giuseppe D'Angelo via Interest wrote: > On Linux you can also use signalfd(2) to achieve the same without the > burden of a custom signal handler. No, you can't, because you need to block the signal using pthread_sigmask in all threads,

Re: [Interest] Connecting signal handler to Qt application - async-handler-safety

2020-06-15 Thread Thiago Macieira
On segunda-feira, 15 de junho de 2020 03:58:12 PDT Bernhard Lindner wrote: > I wrote a logging application containing a signal handler that is registered > using std::signal(). The handler receives signals like SIGFPE, SIGSEGV, > etc. > > Now I would like to connect that handler to some Qt based

Re: [Interest] Connecting signal handler to Qt application - async-handler-safety

2020-06-15 Thread Giuseppe D'Angelo via Interest
Il 15/06/20 12:58, Bernhard Lindner ha scritto: Are there any functions in Qt that are considered async-handler-safe? No, as any of them may allocate memory. See https://doc.qt.io/qt-5/unix-signals.html for the textbook solution (self pipe trick). On Linux you can also use signalfd(2) to

[Interest] Connecting signal handler to Qt application - async-handler-safety

2020-06-15 Thread Bernhard Lindner
Hi! I wrote a logging application containing a signal handler that is registered using std::signal(). The handler receives signals like SIGFPE, SIGSEGV, etc. Now I would like to connect that handler to some Qt based logging code. Unfortunately I could not find a portable solution to do that.