Hey,
Samuel Thibault <[email protected]> writes:
> Ludovic Courtès, le dim. 20 avril 2025 17:40:02 +0200, a ecrit:
>> What happens here is that reading from /dev/klog (opened with
>> O_NONBLOCK) returns ED_WOULD_BLOCK. However Guile and its concurrency
>> framework (Fibers) don’t know about this error, hence the (non-fatal)
>> backtrace, but they do know about EAGAIN and EWOULDBLOCK.
>
>> diff --git a/trans/streamio.c b/trans/streamio.c
>> index e42ff908..cdc0af40 100644
>> --- a/trans/streamio.c
>> +++ b/trans/streamio.c
>> @@ -1011,7 +1011,13 @@ dev_read (size_t amount, void **buf, size_t *len, int
>> nowait)
>> {
>> err = start_input (nowait);
>> if (err)
>> - return err;
>> + {
>> + if (err == ED_WOULD_BLOCK)
>
> Is that not already tested by start_input?
Oh right, it looks like it.
Still, ED_WOULD_BLOCK somehow reaches the client on a read(2) call:
--8<---------------cut here---------------start------------->8---
98<--91(pid221)->io_read_request (-1 4096) ...62
67<--68(pid221)->io_read_request (-1 1) ...57
62... = 0x40000023 (Resource temporarily unavailable)
98<--91(pid221)->io_select_request (1) ...95
task19(pid221)-> 3205 (pn{ 43}) = 0
98<--91(pid221)->io_read_request (-1 4096) = 0x9c5 ((os/device) operation
would block)
45<--27(pid221)->io_write_request ("ice-9/boot-9.scm:1685:16: In procedure
raise-exception:\nIn procedure fport_read:" -1) = 0 115
--8<---------------cut here---------------end--------------->8---
To be continued…
Thanks,
Ludo’.