-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StackOverflowError
in Dynamic StdKeySerializer
#1679
Comments
As usual, what would really help beyond description (which is nicely detailed, thank you) would be a simple reproduction (test). This would help a lot against regression, as well as fix verification. |
Thanks, sorry, for lack of sample, was in a rush end of day, here's the simplest code that creates the stack:
Note that while this code does not make that much sense, it was in the idea of simplifying as much as possible. It should still not create a stackOverflow |
@kpronovost Thank you! |
Interesting. Yes, that is gnarly one indeed. |
This may be due to the problem that recursive definitions are not really handled for key serializers, unlike regular value serializers -- there is special handling during serializer construction to catch this case. |
Thanks for the input. |
@kpronovost I think I can figure out this case, but it probably does make sense to use a work-around in the meantime. But I think it's good to fix this as the reproduction looks like something that would occur quite easily. |
Thanks for the quick reply. I already patched with realistic data in all test cases, I linked this issue to our Merge Request and will remove unneeded patch once this is resolved in a later version. TLDR: Thanks for the fix; not a blocker. |
StackOverflowError
in Dynamic StdKeySerializer
There seem to be a problem (checked and doesn't seem to be fixed in latest version) with the serialize method of the Dynamic static class of the StdKeySerializer.
The problem comes from the fact that when
ser
isnull
, the newser
returned by_findAndAddDynamic
is incorrectly filled.So say we are in
ser#1
,ser#1._dynamicSerializers
now has the correctPropertySerializerMap$Single
. However,result.serializer._dynamicSerializers
hasPropertySerializerMap$Empty
.Therefore, a new call with that result
ser#2
is made which ends up creating an infinite loop.Possible fix:
_dynamicSerializers = result.map;
byresult.serializer._dynamicSerializers = result.map
If I'm mistaken please let me know, but It seems obvious when debugging that something's is not working as intended
The text was updated successfully, but these errors were encountered: