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

Hadoop QA commented on HDFS-9265:
---------------------------------

\\
\\
| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | pre-patch |   5m 48s | Pre-patch HDFS-8707 compilation 
is healthy. |
| {color:green}+1{color} | @author |   0m  0s | The patch does not contain any 
@author tags. |
| {color:red}-1{color} | tests included |   0m  0s | The patch doesn't appear 
to include any new or modified tests.  Please justify why no new tests are 
needed for this patch. Also please list what manual steps were performed to 
verify this patch. |
| {color:red}-1{color} | javac |   1m 25s | The patch appears to cause the 
build to fail. |
\\
\\
|| Subsystem || Report/Notes ||
| Patch URL | 
http://issues.apache.org/jira/secure/attachment/12767678/HDFS-9265.HDFS-8707.000.patch
 |
| Optional Tests | javac unit |
| git revision | HDFS-8707 / ea310d7 |
| Console output | 
https://builds.apache.org/job/PreCommit-HDFS-Build/13092/console |


This message was automatically generated.

> Use of undefined behavior in remote_block_reader causing deterministic 
> crashes.
> -------------------------------------------------------------------------------
>
>                 Key: HDFS-9265
>                 URL: https://issues.apache.org/jira/browse/HDFS-9265
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: hdfs-client
>            Reporter: James Clampffer
>            Assignee: James Clampffer
>            Priority: Blocker
>         Attachments: HDFS-9265.HDFS-8707.000.patch
>
>
> The remote block reader relies on undefined behavior in how it uses 
> enable_shared_from_this.
> http://en.cppreference.com/w/cpp/memory/enable_shared_from_this
> The spec states a shared_ptr to an object inheriting from 
> enable_shared_from_this must be live before calling make_shared_from_this.  
> Calling make_shared_from_this without an existing shared_ptr is undefined 
> behavior and causes deterministic crashes when the code is built with GCC.
> example:
> class foo : public enable_shared_from_this {/*bar*/};
> safe:
> auto ptr1 = std::make_shared<foo>();
> auto ptr2 = foo->make_shared_from_this();
> broken:
> foo *ptr = new foo();
> auto ptr2 = foo->make_shared_from_this(); //no existing live shared_ptr
> In order to fix the input stream should call std::make_shared and hang onto a 
> shared_ptr to the block reader.  The block reader will then be free to call 
> make_shared_from this as much as it wants without issue.  



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

Reply via email to