Discussion:
[bug #49278] fprintf(stderr, ...) returns -1 (EINTR)
Brent Baccala
2016-10-06 04:44:53 UTC
Permalink
URL:
<http://savannah.gnu.org/bugs/?49278>

Summary: fprintf(stderr, ...) returns -1 (EINTR)
Project: The GNU Hurd
Submitted by: baccala
Submitted on: Thu 06 Oct 2016 04:44:51 AM GMT
Category: Hurd
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Reproducibility: Every Time
Size (loc): None
Planned Release: None
Effort: 0.00
Wiki-like text discussion box:

_______________________________________________________

Details:

Under certain circumstances, fprintf to stderr can return -1 with errno =
EINTR.

Test program attached.




_______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 06 Oct 2016 04:44:51 AM GMT Name: fprintf-test.c Size: 3kB By:
baccala

<http://savannah.gnu.org/bugs/download.php?file_id=38667>

_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?49278>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
Kalle Olavi Niemitalo
2016-10-06 06:58:11 UTC
Permalink
Follow-up Comment #1, bug #49278 (project hurd):

I suspect this is caused by a no-more-senders notification on the receive
right of the filesystem root port, to which the client sent the message. If
you add sleep(2) after the mach_msg call in the client, so that it doesn't
deallocate the send right before mach_msg times out in the server, then the
EINTR doesn't happen on the first call. (I didn't test more calls.) The
no-more-senders notification would be requested because trivfs_S_fsys_getroot
calls ports_get_right. The notification is handled in
ports_do_mach_notify_no_senders.

If the EINTR only happens on the first call, that seems wrong.


_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?49278>

_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
anonymous
2018-07-17 15:48:53 UTC
Permalink
Follow-up Comment #2, bug #49278 (project hurd):

I've just downloaded the original c file (fprint-test.c), compiled, it, and it
did produce the error. fprintf still can return -1.

_______________________________________________________

Reply to this item at:

<http://savannah.gnu.org/bugs/?49278>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Loading...