-
-
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
Call to TypeVariable.getBounds()
without synchronization unsafe on some platforms
#1408
Comments
From caller perspective this does not make much sense: there is no multi-threaded access aside from possibility that same But if the developers at javasoft have managed to create such a flaw I would be interested in seeing failure stack trace stemming from this. I see that in theory this could be problematic, given that private variable is not volatile, nor access synchronized. However.... the fact that implementation itself does not do syncing, nor warn in javadocs about need to, suggests that perhaps there is no actual problem? If it was possible to get an actual exception showing the problem (not just theoretical issue a tool suggests), that'd be great. |
Can not reproduce, closing. |
TypeVariable isn't thread safe. |
@stipundzya thank you for providing that link. That looks... unfortunate. I'll see how easy it'd be to add simple locking, given this, even if it's not something easily reproduced. |
TypeVariable.getBounds()
without synchronization unsafe on some platforms
The method com/fasterxml/jackson/databind/type/TypeFactory._fromVariable calls TypeVariable.getBounds() from multiple threads. TypeVariable.getBounds() is in the current implementation not thread
safe: sun/reflect/generics/reflectiveObjects/TypeVariableImpl.getBounds.
Here is the stack trace found by vmlens, a tool to test multithreaded java:
sun/reflect/generics/reflectiveObjects/TypeVariableImpl.getBounds
com/fasterxml/jackson/databind/type/TypeFactory._fromVariable
com/fasterxml/jackson/databind/type/TypeFactory._fromAny
com/fasterxml/jackson/databind/type/TypeFactory._fromParamType
com/fasterxml/jackson/databind/type/TypeFactory._fromAny
com/fasterxml/jackson/databind/type/TypeFactory._resolveSuperClass
com/fasterxml/jackson/databind/type/TypeFactory._fromClass
com/fasterxml/jackson/databind/type/TypeFactory._fromAny
com/fasterxml/jackson/databind/type/TypeFactory.constructType
com/fasterxml/jackson/databind/ObjectMapper.readValue
com/vmlens/testMultithreadedJson/jackson/JacksonLocalVariable.testRead
I used version 2.8.3
The text was updated successfully, but these errors were encountered: