[jboss-jira] [JBoss JIRA] (JASSIST-259) Concurrency issue in ProxyFactory

Christian Beikov (JIRA) issues at jboss.org
Tue Jan 19 03:46:00 EST 2016


    [ https://issues.jboss.org/browse/JASSIST-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13150335#comment-13150335 ] 

Christian Beikov commented on JASSIST-259:
------------------------------------------

It doesn't affect hibernate as I just found out, because they are using the class returned directly instead of keeping the proxy factory around. I patched something that kept it around which now leads to problems, but this doesn't change the fact that ProxyFactory is not safe for concurrent usage which should at least be made explicit.

> Concurrency issue in ProxyFactory
> ---------------------------------
>
>                 Key: JASSIST-259
>                 URL: https://issues.jboss.org/browse/JASSIST-259
>             Project: Javassist
>          Issue Type: Bug
>    Affects Versions: 3.12.0.GA
>         Environment: AIX, IBM J9 VM (build 2.8, JRE 1.8.0 AIX ppc64-64 Compressed References 20150722_258693 (JIT enabled, AOT enabled)
>            Reporter: Christian Beikov
>            Assignee: Shigeru Chiba
>            Priority: Critical
>
> Look at the following line to understand the issue
> https://github.com/jboss-javassist/javassist/blob/master/src/main/javassist/util/proxy/ProxyFactory.java#L435
> If there are 2 threads T1 and T2 at this line, T1 pauses and T2 runs through, on some systems T1 may encounter thisClass to be null after it wakes up again.
> This leads to Hibernate getting a null class in JavassistProxyFactory and trying to create an instance of that which fails with a NPE.
> Can anyone please confirm this issue? Maybe there is something in the JMM that I am not aware of that makes this code safe, but as far as I can tell, this looks like a real bug that just happens to uncover itself on an environment like J9 on AIX.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list