You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2021/02/22 09:05:07 UTC

[GitHub] [hadoop] smengcl edited a comment on pull request #2710: HDFS-15843. Make write cross-platform

smengcl edited a comment 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 on purpose. 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/blob/8783461e2ec3aff2630ea3574a69beb1d5c61e84/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/c/connect_cancel/connect_cancel.c#L43
   
   https://github.com/apache/hadoop/blob/869317be0a1fdff23be5fc500dcd9ae4ecd7bc29/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/examples/cc/connect_cancel/connect_cancel.cc#L47-L48
   
   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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org