[
https://issues.apache.org/jira/browse/HADOOP-10522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13974719#comment-13974719
]
Chris Nauroth commented on HADOOP-10522:
----------------------------------------
Hi, [~kihwal]. Thank you for putting this patch together.
The changes look good to me for handling the other error codes in
{{hadoop_user_info_fetch}} and limiting retries. I didn't understand the part
about {{errno}} though. According to POSIX, mutation of {{errno}} on one
thread is not visible in other threads:
http://www.unix.org/whitepapers/reentrant.html
The Linux man page specifically says that it's in thread-local storage:
http://linux.die.net/man/3/errno
Additionally, the POSIX docs say that both {{getgrgid_r}} and {{getpwnam_r}}
are supposed to be thread-safe:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/getgrgid.html
http://pubs.opengroup.org/onlinepubs/009695399/functions/getpwnam.html
Have you observed something different in practice?
> JniBasedUnixGroupMapping mishandles errors
> ------------------------------------------
>
> Key: HADOOP-10522
> URL: https://issues.apache.org/jira/browse/HADOOP-10522
> Project: Hadoop Common
> Issue Type: Bug
> Reporter: Kihwal Lee
> Assignee: Kihwal Lee
> Priority: Critical
> Attachments: hadoop-10522.patch
>
>
> The mishandling of errors in the jni user-to-groups mapping modules can cause
> segmentation faults in subsequent calls. Here are the bugs:
> 1) If {{hadoop_user_info_fetch()}} returns an error code that is not ENOENT,
> the error may not be handled at all. This bug was found by [~cnauroth].
> 2) In {{hadoop_user_info_fetch()}} and {{hadoop_group_info_fetch()}}, the
> global {{errno}} is directly used. This is not thread-safe and could be the
> cause of some failures that disappeared after enabling the big lookup lock.
> 3) In the above methods, there is no limit on retries.
--
This message was sent by Atlassian JIRA
(v6.2#6252)