Skip to content

Conversation

@scwf
Copy link
Contributor

@scwf scwf commented Dec 9, 2015

Jira: https://issues.apache.org/jira/browse/SPARK-12222

Deserialize RoaringBitmap using Kryo serializer throw Buffer underflow exception:

com.esotericsoftware.kryo.KryoException: Buffer underflow.
    at com.esotericsoftware.kryo.io.Input.require(Input.java:156)
    at com.esotericsoftware.kryo.io.Input.skip(Input.java:131)
    at com.esotericsoftware.kryo.io.Input.skip(Input.java:264)

This is caused by a bug of kryo's Input.skip(long count)(EsotericSoftware/kryo#119) and we call this method in KryoInputDataInputBridge.

Instead of upgrade kryo's version, this pr bypass the kryo's Input.skip(long count) by directly call another skip method in kryo's Input.java(https://github.com/EsotericSoftware/kryo/blob/kryo-2.21/src/com/esotericsoftware/kryo/io/Input.java#L124), i.e. write the bug-fixed version of Input.skip(long count) in KryoInputDataInputBridge's skipBytes method.

more detail link to #9748 (comment)

@scwf
Copy link
Contributor Author

scwf commented Dec 9, 2015

/cc @davies

@SparkQA
Copy link

SparkQA commented Dec 9, 2015

Test build #47396 has finished for PR 10213 at commit 01d37b0.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@davies
Copy link
Contributor

davies commented Dec 9, 2015

LGTM, merging into master and 1.6, thanks!

asfgit pushed a commit that referenced this pull request Dec 9, 2015
…throw Buffer underflow exception

Jira: https://issues.apache.org/jira/browse/SPARK-12222

Deserialize RoaringBitmap using Kryo serializer throw Buffer underflow exception:
```
com.esotericsoftware.kryo.KryoException: Buffer underflow.
	at com.esotericsoftware.kryo.io.Input.require(Input.java:156)
	at com.esotericsoftware.kryo.io.Input.skip(Input.java:131)
	at com.esotericsoftware.kryo.io.Input.skip(Input.java:264)
```

This is caused by a bug of kryo's `Input.skip(long count)`(EsotericSoftware/kryo#119) and we call this method in `KryoInputDataInputBridge`.

Instead of upgrade kryo's version, this pr bypass the  kryo's `Input.skip(long count)` by directly call another `skip` method in kryo's Input.java(https://github.com/EsotericSoftware/kryo/blob/kryo-2.21/src/com/esotericsoftware/kryo/io/Input.java#L124), i.e. write the bug-fixed version of `Input.skip(long count)` in KryoInputDataInputBridge's `skipBytes` method.

more detail link to #9748 (comment)

Author: Fei Wang <[email protected]>

Closes #10213 from scwf/patch-1.

(cherry picked from commit 3934562)
Signed-off-by: Davies Liu <[email protected]>
@asfgit asfgit closed this in 3934562 Dec 9, 2015
@scwf scwf deleted the patch-1 branch December 9, 2015 10:34
drcrallen pushed a commit to metamx/spark that referenced this pull request Dec 16, 2015
…throw Buffer underflow exception

Jira: https://issues.apache.org/jira/browse/SPARK-12222

Deserialize RoaringBitmap using Kryo serializer throw Buffer underflow exception:
```
com.esotericsoftware.kryo.KryoException: Buffer underflow.
	at com.esotericsoftware.kryo.io.Input.require(Input.java:156)
	at com.esotericsoftware.kryo.io.Input.skip(Input.java:131)
	at com.esotericsoftware.kryo.io.Input.skip(Input.java:264)
```

This is caused by a bug of kryo's `Input.skip(long count)`(EsotericSoftware/kryo#119) and we call this method in `KryoInputDataInputBridge`.

Instead of upgrade kryo's version, this pr bypass the  kryo's `Input.skip(long count)` by directly call another `skip` method in kryo's Input.java(https://github.com/EsotericSoftware/kryo/blob/kryo-2.21/src/com/esotericsoftware/kryo/io/Input.java#L124), i.e. write the bug-fixed version of `Input.skip(long count)` in KryoInputDataInputBridge's `skipBytes` method.

more detail link to apache#9748 (comment)

Author: Fei Wang <[email protected]>

Closes apache#10213 from scwf/patch-1.
asfgit pushed a commit that referenced this pull request Dec 28, 2015
…hrow Buffer underflow exception

Since we only need to implement `def skipBytes(n: Int)`,
code in #10213 could be simplified.
davies scwf

Author: Daoyuan Wang <[email protected]>

Closes #10253 from adrian-wang/kryo.

(cherry picked from commit a6d3853)
Signed-off-by: Kousuke Saruta <[email protected]>
asfgit pushed a commit that referenced this pull request Dec 28, 2015
…hrow Buffer underflow exception

Since we only need to implement `def skipBytes(n: Int)`,
code in #10213 could be simplified.
davies scwf

Author: Daoyuan Wang <[email protected]>

Closes #10253 from adrian-wang/kryo.
@highmoutain
Copy link

does this problem have been solved in 1.6.0?
But I encoutered this problem again in 1.6.0 when I use udf.
my version is spark-1.6.0-bin-hadoop2.6.tgz.

(p.mobile_id, 'model', 'MOBILE_MODEL') as mobile_model from analytics_device_profile_zh10 p limit 1;
16/01/21 14:47:29 WARN TaskSetManager: Lost task 0.0 in stage 44.0 (TID 44, 172.30.4.216): com.esotericsoftware.kryo.KryoException: Buffer underflow.
Serialization trace:

mobileAttributeCahceMap (enterprise.hive.udfs.ConvertDeviceModel)
at com.esotericsoftware.kryo.io.Input.require(Input.java:156)
at com.esotericsoftware.kryo.io.Input.readAscii_slow(Input.java:580)
at com.esotericsoftware.kryo.io.Input.readAscii(Input.java:558)
at com.esotericsoftware.kryo.io.Input.readString(Input.java:436)

@davies
Copy link
Contributor

davies commented Jan 21, 2016

@highmoutain This patch was included in 1.6.0. Your problem looks like not related to this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants