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

Bikas Saha commented on MAPREDUCE-4368:
---------------------------------------

1) I think spaces are allowed on Unix paths too. So this bug is not Windows 
specific. The fix need not be under Shell.WINDOWS. Also it does not seem 
specific to just the library path.
2) I think the refactoring ended up being incorrect because 
if(javaOptsSplit[i].startsWith("-Djava.library.path=")) then the new code will 
a) break and forget to add subsequent javaOptsSplit[i] and b) add only the 
system library path to vargs and forget to include the values in 
javaOptsSplit[i].
3) Also, the split on ' ' is done before appending the library path. So I fail 
to see how that affects spaces in the library path. It looks like when the 
library path with '"' is appended to "-Djava.library.path=" then the resulting 
string (when written to the batch script) does not end up being a valid command 
line argument. So the issue is not about splitting on the blank but about not 
escaping/handling the '"' already present in the path.

Would you mind spending some time and seeing if you can fix the generic 
problem? If its not worth a significant refactor then we could add some 
documentation around this instead of a fix.
                
> TaskRunner fails to start jars when the java.library.path contains a quoted 
> path with embedded spaces
> -----------------------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-4368
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-4368
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: tasktracker
>    Affects Versions: 1-win
>         Environment: on Windows: 
> set PATH=%PATH%;"C:\this memorable place".
>            Reporter: John Gordon
>              Labels: newbie, patch
>         Attachments: TaskRunner.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> TaskRunner splits arguments by space before it adds them back to the vargs 
> list, so it loses all context of quote escaped strings with embedded spaces.  
> This gets fixed up later by wrapping all arguments with " -- so you get 
> something like java "-D<opt>=<value>".  This is problematic for paths with 
> embedded spaces, where we end up creating "-D<opt>=<first part" "last part>". 
>  To java, the jar being run is last part.  So with the environment above, you 
> will see "ClassNoDefFoundError: memorable" and the jar will fail to start.  
> In this particular case, we know that java.libarary.path contains paths and 
> the tests often use %PATH% to seed this, so the fix is to remove embedded 
> quotes in listed path elements because we know the aggregate will be quoted 
> when the JVM is started.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to