[ 
https://issues.apache.org/jira/browse/YARN-5121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15400335#comment-15400335
 ] 

Allen Wittenauer commented on YARN-5121:
----------------------------------------

bq. if ret can never be null in that case (real_fname is never null?), then the 
tenary operator is redundant. If it can be null, then the new debug stmt can 
cause a segfault before it prints? Nit-picking in any case.

IIRC, I think the only time that ret can ever be null is if the mallocs inside 
realpath/canonicalize_file_name fail. My hunch is yes, that ternary could 
probably go away and there should be some more safety.  I didn't spend much 
time digging into it though. There's a lot of code like that all over the place 
and it's definitely a much bigger project to fix those problems.

So, yes, there's definitely a risk that the debug will cause a segfault but the 
code isn't enabled by default and someone enabling it is likely trying to 
figure out what the heck is going on anyway haha.

bq. Would you please check for NULL returns from the malloc calls in 
__get_exec_readproc and the OS X implementation of get_executable?

Sure.  Good catch.  They were missing in the original, likely because realpath 
will fail and you'll exit out there instead.  But it'd definitely be better to 
have a real check with a specific error. (That also means flushing the log. We 
really should be using atexit().  This whole thing needs a rewrite.)

> fix some container-executor portability issues
> ----------------------------------------------
>
>                 Key: YARN-5121
>                 URL: https://issues.apache.org/jira/browse/YARN-5121
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: nodemanager
>    Affects Versions: 3.0.0-alpha1
>            Reporter: Allen Wittenauer
>            Assignee: Allen Wittenauer
>            Priority: Blocker
>         Attachments: YARN-5121.00.patch, YARN-5121.01.patch, 
> YARN-5121.02.patch, YARN-5121.03.patch, YARN-5121.04.patch, 
> YARN-5121.06.patch, YARN-5121.07.patch
>
>
> container-executor has some issues that are preventing it from even compiling 
> on the OS X jenkins instance.  Let's fix those.  While we're there, let's 
> also try to take care of some of the other portability problems that have 
> crept in over the years, since it used to work great on Solaris but now 
> doesn't.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to