You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2019/05/21 04:16:35 UTC

[jira] [Resolved] (SPARK-22612) NullPointerException in AppendOnlyMap

     [ https://issues.apache.org/jira/browse/SPARK-22612?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hyukjin Kwon resolved SPARK-22612.
----------------------------------
    Resolution: Incomplete

> NullPointerException in AppendOnlyMap
> -------------------------------------
>
>                 Key: SPARK-22612
>                 URL: https://issues.apache.org/jira/browse/SPARK-22612
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>    Affects Versions: 2.1.1, 2.1.2
>            Reporter: Lijie Xu
>            Priority: Major
>              Labels: bulk-closed
>
> I recently encounter a NullPointerException in AppendOnlyMap while running the SparkPageRank example in the package org.apache.spark.examples.
> {code:java}
> 17/11/25 16:31:13 ERROR Executor: Exception in task 30.0 in stage 10.0 (TID 417)
> java.lang.NullPointerException
> 	at scala.Tuple2.equals(Tuple2.scala:20)
> 	at org.apache.spark.util.collection.AppendOnlyMap.changeValue(AppendOnlyMap.scala:149)
> 	at org.apache.spark.util.collection.SizeTrackingAppendOnlyMap.changeValue(SizeTrackingAppendOnlyMap.scala:32)
> 	at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:194)
> 	at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)
> 	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)
> 	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)
> 	at org.apache.spark.scheduler.Task.run(Task.scala:99)
> 	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:322)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at java.lang.Thread.run(Thread.java:745)
> 17/11/25 16:31:13 INFO Executor: Executor is trying to kill task 24.0 in stage 10.0 (TID 409)
> {code}
> The corresponding AppendOnlyMap code is as follows.
> {code:java}
>  while (true) {
>       val curKey = data(2 * pos)
>       if (curKey.eq(null)) {
>         val newValue = updateFunc(false, null.asInstanceOf[V])
>         data(2 * pos) = k
>         data(2 * pos + 1) = newValue.asInstanceOf[AnyRef]
>         incrementSize()
>         return newValue
>       } else if (k.eq(curKey) || k.equals(curKey)) {   // NullPointerException in this line (149)
>         val newValue = updateFunc(true, data(2 * pos + 1).asInstanceOf[V])
>         data(2 * pos + 1) = newValue.asInstanceOf[AnyRef]
>         return newValue
>       } else {
>         val delta = i
>         pos = (pos + delta) & mask
>         i += 1
>       }
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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