[ 
https://issues.apache.org/jira/browse/HDFS-15843?focusedWorklogId=555703&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-555703
 ]

ASF GitHub Bot logged work on HDFS-15843:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Feb/21 09:03
            Start Date: 22/Feb/21 09:03
    Worklog Time Spent: 10m 
      Work Description: smengcl commented on pull request #2710:
URL: https://github.com/apache/hadoop/pull/2710#issuecomment-783214670


   Thanks @GauthamBanasandra for the patch.
   
   I'm wondering if the 
[author](https://issues.apache.org/jira/browse/HDFS-11028) uses syscall write 
for a reason. According to the comment, heap could be corrupted if the `printf` 
call uses `malloc` or equivalent (depending on C/C++ library's implementation):
   
   
https://github.com/apache/hadoop/pull/2710/files#diff-d2644a26b4354d1adbaacb60a244b47dbbebcef5cb4223ee52542d253f9a32a8R42
   
   
https://github.com/apache/hadoop/pull/2710/files#diff-e91e8d0a790404522dd7fc26faa7a89336b6171262f5ebdc18b6c43ec84adbb5L48
   
   How about wrapping the `<unistd.h>` header import line and the existing 
approach in `#ifndef WINDOWS`? And use `#else` to wrap the new approach. 
Assuming Windows is the platform you are aiming for.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 555703)
    Time Spent: 50m  (was: 40m)

> [libhdfs++] Make write cross platform
> -------------------------------------
>
>                 Key: HDFS-15843
>                 URL: https://issues.apache.org/jira/browse/HDFS-15843
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: libhdfs++
>    Affects Versions: 3.2.2
>            Reporter: Gautham Banasandra
>            Assignee: Gautham Banasandra
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> We're currently using the *write* function from unistd.h which isn't 
> cross-platform. We need to replace this with *std::cout.write* instead.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to