Bug 978603 - Possible race in jboss-invocation proxies resulting in NPE in initializer
Possible race in jboss-invocation proxies resulting in NPE in initializer
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: EE (Show other bugs)
6.0.0,6.0.1,6.1.0,6.0.2 (SOA)
Unspecified Unspecified
unspecified Severity unspecified
: ER3
: EAP 6.1.1
Assigned To: Stuart Douglas
:
: 982083 (view as bug list)
Depends On:
Blocks: 981846
  Show dependency treegraph
 
Reported: 2013-06-26 18:27 EDT by Stuart Douglas
Modified: 2013-09-16 16:26 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In previous versions of Red Hat JBoss Enterprise Application Platform 6 the jboss-invocation was using a ThreadLocal to pass information into the proxies static initializer. As a result, there was a very short window where if a second thread attempted to use the proxy immediately after it had been defined this second thread would call the static initializer, and the ThreadLocal data that the initializer was expecting would not be present, resulting in a NullPointerException. This behavior has been corrected in this release of the product and the NPE will no longer be encountered.
Story Points: ---
Clone Of:
: 981846 (view as bug list)
Environment:
Last Closed: 2013-09-16 16:26:36 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-1595 Major Resolved Possible race in jboss-invocation proxies resulting in NPE in initializer 2014-04-25 03:30:22 EDT

  None (edit)
Description Stuart Douglas 2013-06-26 18:27:35 EDT
jboss-invocation proxies use a thread local to pass information into the initializer, in most cases this works fine as long as only a single thread is attempting to define the class. It is possible for a different thread to load the class that the one that defines it.

As far as I can tell this will only affect CMP, as most other proxies are created at deployment time in a single thread.
Comment 3 Stuart Douglas 2013-06-26 20:28:49 EDT
The patch for this issue is only a few lines of code and is already completed, and has passed CI runs against Wildfly upstream, EAP 6.x and EAP 6.1 repositories.
Comment 7 JBoss JIRA Server 2013-06-30 20:03:06 EDT
Stuart Douglas <stuart.w.douglas@gmail.com> updated the status of jira WFLY-1595 to Resolved
Comment 8 Carlo de Wolf 2013-07-23 10:23:48 EDT
*** Bug 982083 has been marked as a duplicate of this bug. ***
Comment 9 Ondrej Chaloupka 2013-08-08 10:26:45 EDT
Verified on EAP 6.1.1.ER4.
The jboss-invocation is under version 1.1.2.
Checked the decompiled code as well.
Comment 10 Scott Mumford 2013-08-20 00:35:01 EDT
Stuart, is it possible to get an outline of this issue for a release note. 
I read that there was a possible race condition, but unfortunately, the details pertaining to the initializer, threads and defining classes is a bit beyond me.

We ideally need a cause (the underlying problem in the code), the consequence (how this problem manifested in the products behavior), the fix (what what changed in the code) and the result (how the product behaves after the change).

Any info you can offer will be appreciated and will help to make the Release Notes the best document it can be.
Comment 11 Stuart Douglas 2013-08-20 02:44:08 EDT
Because jboss-invocation was using a ThreadLocal to pass information into the proxies static initializer, there was a very short window where if a second thread attempted to use the proxy immediately after it had been defined this second thread would call the static initializer, and the ThreadLocal data that the initializer was expecting would not be present, resulting in a NullPointerException.

Note You need to log in before you can comment on or make changes to this bug.