Created attachment 160781 [details] correcting the endless loop bug Hi, Bug ID 200429 (endless loop when started at boot time), that had been corrected on FreeBSD 10.1, came back with FreeBSD 10.2, due to kernel behaviour changes. When the /dev/console device is revoked, writing to the device sets errno to: - ENXIO with FreeBSD 10.1 kernel - EIO with FreeBSD 10.2 kernel The following program can be used to see this behaviour change: ------------------------------------------------------------------ #include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <fcntl.h> extern int errno; int main() { int id = open("/dev/console", O_RDWR); revoke("/dev/console"); int ret = write(id, "X", 1); if (ret < 0) printf("errno=%d\n", errno); return 0; } ------------------------------------------------------------------ It returns 6 (ENXIO) on FreeBSD 10.1 and 5 (EIO) on FreeBSD 10.2. To make rsyslog8 work correctly, here is a new version of sysutils/rsyslog8/files/patch-runtime_stream.c, in which I've added modifications to correct the bug. Note that the bug had been previously corrected in the main stream, in the rsyslog8 original sources, not by a FreeBSD patch. But I've not sent a patch proposal to the main stream this time because I suspect that the new behaviour of the kernel is unwanted. So, I will open a bug report for this new behaviour, and depending on the result, I may, or not, send back a bug report to the main stream. Sincerely,
I've created bug ID 202933 to inform about the kernel source code that changed and that finally breaks the rsyslog8 port. This kernel change, that has modified the error number returned by a syscall trying to write to a revoked console, seems to be wanted, according to the associated svn log. But this seems to me to be an ABI change in the 10-Release major branch. So I've asked if such a change is really wanted. Depending on the response to bug ID 202933 by FreeBSD kernel maintainers, I will report here the way to make the port work correctly.
Thank you for working with upstream to get this fixed!