https://issues.apache.org/bugzilla/show_bug.cgi?id=48791
Summary: Race condition in class javax.el.BeanELResolver$BeanProperty field read/write Product: Tomcat 6 Version: 6.0.18 Platform: Other OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Servlet & JSP API AssignedTo: dev@tomcat.apache.org ReportedBy: qiyao...@gmail.com In java/javax/el/BeanELResolver.java, 255 private Method read(ELContext ctx) { 256 if (this.read == null) { 257 this.read = getMethod(this.owner, descriptor.getReadMethod()); 258 if (this.read == null) { 259 throw new PropertyNotFoundException(message(ctx, 260 "propertyNotReadable", new Object[] { 261 type.getName(), descriptor.getName() })); 262 } 263 } 264 return this.read; 265 } If two threads execute method write in parallel, the value of this.read is non-determined. The output below is what we got from race detector (http://www.alphaworks.ibm.com/tech/msdk), and this result shows that threads http-8080-x may access this field in parallel. One possible fix to this problem is to move line 256-257 to synchronization block. --------------------------------------------------------------------------- Data Race 1 : javax.el.BeanELResolver$BeanProperty : read Thread "http-8080-5" : Tid 36 : WRITE Lock Set : [ ] [javax.el.BeanELResolver$BeanProperty : read(Ljavax/el/ELContext;)Ljava/lang/reflect/Method; : : 257] [javax.el.BeanELResolver$BeanProperty : access$000(Ljavax/el/BeanELResolver$BeanProperty;Ljavax/el/ELContext;)Ljava/lang/reflect/Method; : : 209] [javax.el.BeanELResolver : getValue(Ljavax/el/ELContext;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; : : 60] [javax.el.CompositeELResolver : getValue(Ljavax/el/ELContext;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; : : 54] [org.apache.el.parser.AstValue : getValue(Lorg/apache/el/lang/EvaluationContext;)Ljava/lang/Object; : : 118] ........ Thread "http-8080-1" : Tid 32 : WRITE Lock Set : [ ] [javax.el.BeanELResolver$BeanProperty : read(Ljavax/el/ELContext;)Ljava/lang/reflect/Method; : : 257] [javax.el.BeanELResolver$BeanProperty : access$000(Ljavax/el/BeanELResolver$BeanProperty;Ljavax/el/ELContext;)Ljava/lang/reflect/Method; : : 209] [javax.el.BeanELResolver : getValue(Ljavax/el/ELContext;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; : : 60] [javax.el.CompositeELResolver : getValue(Ljavax/el/ELContext;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; : : 54] [org.apache.el.parser.AstValue : getValue(Lorg/apache/el/lang/EvaluationContext;)Ljava/lang/Object; : : 118] -- 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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org