tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49985] New: Lazy initialization without any synchronization - data race in AstInteger, AstFloatingPoint, AstString
Date Thu, 23 Sep 2010 12:55:45 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49985

           Summary: Lazy initialization without any synchronization - data
                    race in AstInteger, AstFloatingPoint, AstString
           Product: Tomcat 6
           Version: 6.0.29
          Platform: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: sergeyvorobyev@google.com


r998053
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/el/parser/AstInteger.java
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/el/parser/AstFloatingPoint.java
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/el/parser/AstString.java

Use lazy init without any synchronization in methods getInteger(),
getFloatingPoint(), getString(), respectively.

Consider AstInteger:

private Number number;

    protected Number getInteger() {
        if (this.number == null) {
            try {
                this.number = new Long(this.image);
            } catch (ArithmeticException e1) {
                this.number = new BigInteger(this.image);
            }
        }
        return number;
    }


Data races on variable number :37
in method getInteger() :39
concurrent read on line 40
concurrent write on lines 42, 44

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message