Stackoverflow on Writing Generics class

310 views
Skip to first unread message

Rahul Sharma

unread,
Aug 12, 2015, 1:44:48 AM8/12/15
to kryo-users, samee...@xebia.com, rahul...@xebia.com
Hi,

We are trying to serialize a generics class object using  Kryo 2.24. We invoke FieldSerializer write method to do the same :

void write (Kryo kryo, Output output, T object)


We are experiencing StackOverflowError error while doing so.

java.lang.StackOverflowError
at com.esotericsoftware.kryo.Generics.getConcreteClass(Generics.java:43)
at com.esotericsoftware.kryo.Generics.getConcreteClass(Generics.java:44)
at com.esotericsoftware.kryo.Generics.getConcreteClass(Generics.java:44)
at com.esotericsoftware.kryo.Generics.getConcreteClass(Generics.java:44)
at com.esotericsoftware.kryo.Generics.getConcreteClass(Generics.java:44)
at com.esotericsoftware.kryo.Generics.getConcreteClass(Generics.java:44)
at com.esotericsoftware.kryo.Generics.getConcreteClass(Generics.java:44)
at com.esotericsoftware.kryo.Generics.getConcreteClass(Generics.java:44)
at com.esotericsoftware.kryo.Generics.getConcreteClass(Generics.java:44)

We have found out that the error occurs because the FieldSerialzer calls pushGenericScope() on Kryo.  Now, if Kyro is containing the same instance of genericScope, the call would set a Generics object which is having itself as the parent i.e. a cyclic genericScope. If we call a getConcreteClass() on this Generics objects it results in java.lang.StackOverflowError error.

regards,
Rahul 

Dijkstra Gurgaon

unread,
Aug 24, 2015, 1:59:54 AM8/24/15
to kryo-users, samee...@xebia.com, rahul...@xebia.com
Hi
I am facing the same issue, were you able to resolve it??

Martin Grotzke

unread,
Aug 24, 2015, 7:04:05 PM8/24/15
to kryo-users

Looks like the issue reported here: https://github.com/EsotericSoftware/kryo/issues/341

Can you confirm this?

Cheers,
Martin

--
You received this message because you are subscribed to the "kryo-users" group.
http://groups.google.com/group/kryo-users
---
You received this message because you are subscribed to the Google Groups "kryo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kryo-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages