You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Jerry Cwiklik (JIRA)" <de...@uima.apache.org> on 2011/01/04 19:51:46 UTC

[jira] Created: (UIMA-1986) Fix Synchronization on Long could deadlock Reported by Findbugs

Fix Synchronization on Long could deadlock Reported by Findbugs
---------------------------------------------------------------

                 Key: UIMA-1986
                 URL: https://issues.apache.org/jira/browse/UIMA-1986
             Project: UIMA
          Issue Type: Bug
          Components: Async Scaleout
    Affects Versions: 2.3.1AS
            Reporter: Jerry Cwiklik
            Assignee: Jerry Cwiklik


Local class StackDumpTimer in PrimitiveAnalysisEngineController_impl  is synchronizing a block of code using a primitive (Long) which is not a good idea.
Finbugs documentation on this bug says:

"DL: Synchronization on boxed primitive could lead to deadlock (DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE)

The code synchronizes on a boxed primitive constant, such as an Integer.

private static Integer count = 0;
...
  synchronized(count) { 
     count++;
     }
...
Since Integer objects can be cached and shared, this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness and possible deadlock"



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (UIMA-1986) Fix Synchronization on Long could deadlock Reported by Findbugs

Posted by "Jerry Cwiklik (JIRA)" <de...@uima.apache.org>.
     [ https://issues.apache.org/jira/browse/UIMA-1986?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerry Cwiklik closed UIMA-1986.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 2.3.1AS

Added a new monitor to synchronize critical region in StackDumpTimer.class:

static private Object threadDumpMonitor = new Object();



> Fix Synchronization on Long could deadlock Reported by Findbugs
> ---------------------------------------------------------------
>
>                 Key: UIMA-1986
>                 URL: https://issues.apache.org/jira/browse/UIMA-1986
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>    Affects Versions: 2.3.1AS
>            Reporter: Jerry Cwiklik
>            Assignee: Jerry Cwiklik
>             Fix For: 2.3.1AS
>
>
> Local class StackDumpTimer in PrimitiveAnalysisEngineController_impl  is synchronizing a block of code using a primitive (Long) which is not a good idea.
> Finbugs documentation on this bug says:
> "DL: Synchronization on boxed primitive could lead to deadlock (DL_SYNCHRONIZATION_ON_BOXED_PRIMITIVE)
> The code synchronizes on a boxed primitive constant, such as an Integer.
> private static Integer count = 0;
> ...
>   synchronized(count) { 
>      count++;
>      }
> ...
> Since Integer objects can be cached and shared, this code could be synchronizing on the same object as other, unrelated code, leading to unresponsiveness and possible deadlock"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.