[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jakarta-commons-dev
Subject:    [jira] [Commented] (DBCP-476) AbandonedTrace.getTrace() contains race condition
From:       "Gary Evesson (JIRA)" <jira () apache ! org>
Date:       2017-04-30 23:53:04
Message-ID: JIRA.13066942.1493185907000.89022.1493596384048 () Atlassian ! JIRA
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/DBCP-476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15990513#comment-15990513 \
] 

Gary Evesson commented on DBCP-476:
-----------------------------------

PR: https://github.com/apache/commons-dbcp/pull/7

> AbandonedTrace.getTrace() contains race condition
> -------------------------------------------------
> 
> Key: DBCP-476
> URL: https://issues.apache.org/jira/browse/DBCP-476
> Project: Commons Dbcp
> Issue Type: Bug
> Reporter: Richard Cordova
> Priority: Minor
> 
> The clean up code in AbandonedTrace is subject to the reference being cleared in \
> between the condition being checked and the referent being added to the result. \
> {code} while (iter.hasNext()) {
> WeakReference<AbandonedTrace> ref = iter.next();
> if (ref.get() == null) {
> // Clean-up since we are here anyway
> iter.remove();
> } else {
> result.add(ref.get());
> }
> }
> {code}
> This can surface as a NullPointerException, e.g.
> {noformat}
> Caused by: java.lang.NullPointerException
> 	at org.apache.tomcat.dbcp.dbcp2.DelegatingStatement.close(DelegatingStatement.java:149)
>  {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic