[
https://issues.apache.org/jira/browse/HDFS-727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769355#action_12769355
]
Eli Collins commented on HDFS-727:
----------------------------------
I saw this bug on 64-bit linux, but you could see it on any 64-bit system.
{code}
invokeMethod(env, &jVal, &jExc, INSTANCE, jConfiguration,
HADOOP_CONF, "getLong", "(Ljava/lang/String;J)J",
jStrBlockSize, 67108864)) {
{code}
In the above code the value 67108864 will be passed as an int since the literal
fits in an int (the compiler won't do type promotion here because it doesn't
know argument types for variadic functions). Meanwhile invokeMethod passes the
va_list to CallObjectMethodV which expects a jlong (8 bytes). The behavior is
undefined, in practice it read 8 bytes when accessing this parameter, which
ends up being the 4 byte value plus 4 bytes of whatever was passed next to it.
> bug setting block size hdfsOpenFile
> ------------------------------------
>
> Key: HDFS-727
> URL: https://issues.apache.org/jira/browse/HDFS-727
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: Eli Collins
> Assignee: Eli Collins
> Attachments: hdfs727.patch
>
>
> In hdfsOpenFile in libhdfs invokeMethod needs to cast the block size argument
> to a jlong so a full 8 bytes are passed (rather than 4 plus some garbage
> which causes writes to fail due to a bogus block size).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.