Hi all,
When running Genode on Linux as PID 1 I get the warning `blocking canceled in entrypoint constructor`. This seems to happen only when running as init process. When I run the same configuration on Linux with the usual user land this doesn't happen. I have also applied the patch to [1] (I have tested this on 17.11 where it is applied anyway). Changing the underlying Linux kernel did not help.
I could trace the issue to repos/base-linux/src/lib/base/ipc.cc:421 [2] where lx_recvmsg returns -EINTR. The proposed way to handle this error according to the GNU reference [3] is to retry the syscall. Yet Genode does not and throws an exception.
Is there any signal that only the init process receives that isn't handled properly in Genode (sorry if this is slightly off-topic)?
Why does Genode handle -EINTR with an exception and not the way proposed in the GNU manual?
Regards, Johannes Kliemann
[1]: https://github.com/genodelabs/genode/issues/2521 [2]: https://github.com/genodelabs/genode/blob/f44edd407bf674bfad11accad8319d5f66... [3]: https://www.gnu.org/software/libc/manual/html_node/Interrupted-Primitives.ht...
Hello Johannes,
On Fri, Jan 12, 2018 at 01:09:25PM +0100, Johannes Kliemann wrote:
Why does Genode handle -EINTR with an exception and not the way proposed in the GNU manual?
We use the Linux signal mechanism with signal SIGUSR1 to implement our cancelable lock. So, if a thread is unblocked with the EINTR error it reflects the cancellation by throwing this exception. Core's initial thread is unblocked only once by this mechanism and then blocks in
./base/src/core/signal_receiver.cc:41:void Signal_receiver::block_for_signal()
Did you find out which signal occurred in core? We setup several signal handlers for fatal signals (e.g., SIGSEGV) that log diagnostic info and also
src/core/thread_linux.cc:45 SIGUSR1 ./src/core/platform.cc:95 SIGINT ./src/core/platform.cc:98 SIGCHLD
You could try to setup more handlers this way and log signal occurrence.
Cheers
Hi Christian,
thanks for these hints. I have logged the signals and SIGCHLD is received directly before the occurrence of the warning so I suspect that this is the problematic signal. I also set up a signal handler to catch all other signals and it only logged the according signal number.
Regards, Johannes
Am 12.01.2018 um 16:32 schrieb Christian Helmuth:
Hello Johannes,
On Fri, Jan 12, 2018 at 01:09:25PM +0100, Johannes Kliemann wrote:
Why does Genode handle -EINTR with an exception and not the way proposed in the GNU manual?
We use the Linux signal mechanism with signal SIGUSR1 to implement our cancelable lock. So, if a thread is unblocked with the EINTR error it reflects the cancellation by throwing this exception. Core's initial thread is unblocked only once by this mechanism and then blocks in
./base/src/core/signal_receiver.cc:41:void Signal_receiver::block_for_signal()
Did you find out which signal occurred in core? We setup several signal handlers for fatal signals (e.g., SIGSEGV) that log diagnostic info and also
src/core/thread_linux.cc:45 SIGUSR1 ./src/core/platform.cc:95 SIGINT ./src/core/platform.cc:98 SIGCHLD
You could try to setup more handlers this way and log signal occurrence.
Cheers