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 "Junping Du (JIRA)" <ji...@apache.org> on 2016/01/05 02:03:40 UTC

[jira] [Commented] (HADOOP-12630) Misuse of sun.misc.Unsafe causes misaligned memory access coredumps

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

Junping Du commented on HADOOP-12630:
-------------------------------------

Thanks for comments, [~drankye]. I haven't got clear idea to fix/verify exactly issues reported in core file above. However, I think we are discussing the misuse of sun.misc.Unsafe issue for JVMs on specific platforms, then I think the unsafe instance accessing is a related topic. 
Actually, our code {{Field f = Unsafe.class.getDeclaredField("theUnsafe");}} get copied from Guava is quite JVM specific. Some other JVMs could name the instance for something else (like JVM on Android are naming something like "THE_ONE", see: https://android.googlesource.com/platform/libcore/+/9edf43dfcc35c761d97eb9156ac4254152ddbc55/libdvm/src/main/java/sun/misc/Unsafe.java), so I think we'd better to fix it here as well?
Back to specific issue in the core, I suspect theUnsafe.getLong() could expect something else (like 4 bytes instead of 8 bytes) in some platform like Solaris. However, I am not the expect of Solaris native and I will leave it to the experts, like Alan, to fix it.
[~drankye], does it make sense?

> Misuse of sun.misc.Unsafe causes misaligned memory access coredumps
> -------------------------------------------------------------------
>
>                 Key: HADOOP-12630
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12630
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: native
>    Affects Versions: 2.6.0, 2.7.0, 3.0.0
>         Environment: Solaris SPARC
>            Reporter: Alan Burlison
>            Assignee: Alan Burlison
>
> Misuse of sun.misc.unsafe by {{org.apache.hadoop.io.FastByteComparisons}} causes misaligned memory accesses and results in coredumps. Stack traces below:
> {code}
> hadoop-tools/hadoop-gridmix/core
>  --- called from signal handler with signal 10 (SIGBUS) ---
>  ffffffff7717fa40 Unsafe_GetLong (18c000, ffffffff7e2fd6d8, 0, 19, ffffffff775d4be0, 10018c000) + 158
>  ffffffff70810dcc * sun/misc/Unsafe.getLong(Ljava/lang/Object;J)J+-30004
>  ffffffff70810d70 * sun/misc/Unsafe.getLong(Ljava/lang/Object;J)J+0
>  ffffffff70806d58 * org/apache/hadoop/io/FastByteComparisons$LexicographicalComparerHolder$UnsafeComparer.compareTo([BII[BII)I+91 (line 405)
>  ffffffff70806cb4 * org/apache/hadoop/io/FastByteComparisons$LexicographicalComparerHolder$UnsafeComparer.compareTo(Ljava/lang/Object;IILjava/lang/Object;II)I+16 (line 264)
>  ffffffff7080783c * org/apache/hadoop/io/FastByteComparisons.compareTo([BII[BII)I+11 (line 92)
>  ffffffff70806cb4 * org/apache/hadoop/io/WritableComparator.compareBytes([BII[BII)I+8 (line 376)
>  ffffffff70806cb4 * org/apache/hadoop/mapred/gridmix/GridmixRecord$Comparator.compare([BII[BII)I+61 (line 522)
>  ffffffff70806cb4 * org/apache/hadoop/mapred/gridmix/TestGridmixRecord.binSortTest(Lorg/apache/hadoop/mapred/gridmix/GridmixRecord;Lorg/apache/hadoop/mapred/gridmix/GridmixRecord;IILorg/apache/hadoop/io/WritableComparator;)V+280 (line 268)
>  ffffffff70806f44 * org/apache/hadoop/mapred/gridmix/TestGridmixRecord.testBaseRecord()V+57 (line 482)
> {code}
> This also causes {{hadoop-mapreduce-project/hadoop-mapreduce-examples/core}}



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