[bug#77943,1/2] services: shepherd: Provide the right #:kernel-log-file on the Hurd.

Message ID OSK14Qd--F-9@tutamail.com
State New
Headers
Series [bug#77943,1/2] services: shepherd: Provide the right #:kernel-log-file on the Hurd. |

Commit Message

yelninei--- via Guix-patches via June 10, 2025, 9:50 a.m. UTC
  Hello Ludo,


Jun 2, 2025, 16:09 by ludo@gnu.org:

> Hi,
>
> Right, I started looking into it back then but then didn’t take the time
> to track it down.
>

I tried your patch that you sent to bug-hurd but I still end up with D_WOULD_BLOCK at the end. Was it working for you?

As pointed out by Samuel on bug-hurd the initial "if (err) return err" looks weird. I tried removing it and at the end of /dev/klog it died with SIGLOST.

I then tried this patch similar to yours to intercept D_WOULD_BLOCK at the beginning instead:


and my example now fails with EAGAIN.

I am not sure yet what is setting this, the joy of global variables.

However something still seems wrong when I added back the shepherd syslog. It still crashes/hangs when it reaches the initial end of /dev/klog and does not process messages further: 
there is an extra message and e.g. sshd messages to the syslog dont get processed.

root@childhurd ~# ./main
irq handler [11]: new delivery port f5e44038 entry f4f39840

errno: Resource temporarily unavailable

To be continued.

Note: I had to add the patch to the default hurd and just patching the hurd package that is used in operating-system-hurd was not enough. Dont know what is up with that.

> Thanks,
> Ludo’.
>
  

Comments

Ludovic Courtès June 10, 2025, 12:46 p.m. UTC | #1
Hi Yelninei,

yelninei@tutamail.com writes:

> I tried your patch that you sent to bug-hurd but I still end up with D_WOULD_BLOCK at the end. Was it working for you?

No no, it wasn’t, but I haven’t taken the time to dig further.

> As pointed out by Samuel on bug-hurd the initial "if (err) return err" looks weird. I tried removing it and at the end of /dev/klog it died with SIGLOST.

[...]

> and my example now fails with EAGAIN.

I’m not sure what example but EAGAIN is fine, it’s what we want.

Thanks for investigating!

Ludo’.
  

Patch

diff --git a/trans/streamio.c b/trans/streamio.c
index e42ff908..ee3cf9b4 100644
--- a/trans/streamio.c
+++ b/trans/streamio.c
@@ -1005,7 +1005,12 @@  dev_read (size_t amount, void **buf, size_t *len, int nowait)
   size_t max, avail;
 
   if (err)
-    return err;
+    {
+      if (err == D_WOULD_BLOCK)
+	  return EWOULDBLOCK;
+      else
+	  return err;
+    }
 
   while (!buffer_readable (input_buffer))
     {