This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug hurd/12187] [PATCH] sysdeps/mach/hurd: critical error values get overwritten
- From: "tschwinge at sourceware dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Sat, 18 Feb 2012 09:21:08 +0000
- Subject: [Bug hurd/12187] [PATCH] sysdeps/mach/hurd: critical error values get overwritten
- Auto-submitted: auto-generated
- References: <bug-12187-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=12187
Thomas Schwinge <tschwinge at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |WAITING
CC| |tschwinge at sourceware dot
| |org
AssignedTo|roland at gnu dot org |tschwinge at sourceware dot
| |org
--- Comment #1 from Thomas Schwinge <tschwinge at sourceware dot org> 2012-02-18 09:21:08 UTC ---
Hi Nicolas!
Thanks for your report, and sorry for the delay in handling it. My I ask
how/why you found this issue?
(The same pattern is also found in sendmsg.c.)
With the change you suggest, these calls would then only continue to work
for AF_LOCAL; don't you agree? Here, that assignment to err is only to
initialize it to a non-zero value. Then, in the HURD_DPORT_USE
construct's second argument, this is used to differentiate between the
AF_LOCAL case (where aport has already been bound), and all other AF_*
(where aport will now be bound by the socket_create_address call). I
suspect that the value of EIEIO for initializing err has been chosen to
make it more obvious that it's a programming error, should this value
ever ``escape'' from the call. Do you agree with this analyis?
I would happily accept a patch to make this construct easier to grasp.
>From a quick glance, we could probably do the following: initialize aport
to MACH_PORT_NULL and err to 0 at their definition sites, remote the err
assignment in else branch (not AF_LOCAL case), and instead use aport !=
MACH_PORT_NULL to conditionalize the socket_create_address call. Would
that make it more obvious what is going on there?
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.