You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2015/09/12 18:40:16 UTC

[Bug 58390] New: Data race on field org.apache.tomcat.util.net.SocketWrapper.error

https://bz.apache.org/bugzilla/show_bug.cgi?id=58390

            Bug ID: 58390
           Summary: Data race on field
                    org.apache.tomcat.util.net.SocketWrapper.error
           Product: Tomcat 8
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Util
          Assignee: dev@tomcat.apache.org
          Reporter: yilong.li@runtimeverification.com

Reported by RV-Predict (a dynamic race detector) when running the test suite:
Data race on field org.apache.tomcat.util.net.SocketWrapper.error: {{{
    Concurrent write in thread T35 (locks held: {})
 ---->  at
org.apache.tomcat.util.net.SocketWrapper.setError(SocketWrapper.java:104)
        at
org.apache.coyote.http11.upgrade.Nio2ServletOutputStream$1.failed(Nio2ServletOutputStream.java:67)
        at
org.apache.tomcat.util.net.SecureNio2Channel$4.failed(SecureNio2Channel.java:844)
        at
sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
        at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    T35 is created by T32
        at
java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)

    Concurrent write in thread T36 (locks held: {})
 ---->  at
org.apache.tomcat.util.net.SocketWrapper.setError(SocketWrapper.java:104)
        at
org.apache.coyote.http11.upgrade.Nio2ServletInputStream$1.failed(Nio2ServletInputStream.java:70)
        at
org.apache.tomcat.util.net.SecureNio2Channel$3.failed(SecureNio2Channel.java:786)
        at
sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
        at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    T36 is created by T32
        at
java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)
}}} 

In this report, both threads are writing `true` to this field so it's not a big
deal. But I am reporting it anyway in case you feel like getError and setError
can be in race.

-- 
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


[Bug 58390] Data race on field org.apache.tomcat.util.net.SocketWrapper.error

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=58390

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
The flag is only ever used by NIO2 so trunk has been refactored.

The flag is never read by NIO2 in 8.0.x so there is no issues here.

The flag was read by NIO in 8.0.x but since that read would always be false the
code has been removed. (The same code was removed from trunk).

The flag is read in trunk and it has been made volatile since it is likely to
be read and written in different threads.

-- 
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