[jboss-jira] [JBoss JIRA] (JGRP-1400) Bad attempt to compute absolute value of signed 32-bit hashcode. Condition.await() not in loop. Field isn't final but should be.

Bela Ban (Commented) (JIRA) jira-events at lists.jboss.org
Wed Dec 14 04:01:12 EST 2011


    [ https://issues.jboss.org/browse/JGRP-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650765#comment-12650765 ] 

Bela Ban commented on JGRP-1400:
--------------------------------

Re: Condition await(): I don't think this is a problem, as this call is issued by ConditionImpl.await(). A user will need to call *that* code in a while loop.
                
> Bad attempt to compute absolute value of signed 32-bit hashcode. Condition.await() not in loop. Field isn't final but should be.
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JGRP-1400
>                 URL: https://issues.jboss.org/browse/JGRP-1400
>             Project: JGroups
>          Issue Type: Bug
>    Affects Versions: 3.0.1
>         Environment: Ubuntu 10.10
>            Reporter: David Westbrook
>            Assignee: Bela Ban
>            Priority: Minor
>              Labels: Await,, Final, Hash,
>             Fix For: 3.1
>
>
> Bad attempt to compute absolute value of signed 32-bit hashcode. If the hashcode is Integer.MIN_VALUE, then the result will be negative as well (since Math.abs(Integer.MIN_VALUE) == Integer.MIN_VALUE). Fix: Math.abs(Integer.MIN_VALUE & FFFFFFF0), removing -2^31 as a possibility. At PartitionedHashMap.java:[line 457] in method org.jgroups.blocks.PartitionedHashMap$ConsistentHashFunction.viewAccepted(View)
> Condition.await() not in loop.  If the object is used for multiple conditions, the condition the caller intended to wait for might not 
> be the one that actually occurred. Fix: Put the if statement in a while loop. At locking.java:[line 186] in method org.jgroups.protocols.Locking.down(Event)
> Field isn't final but should be. A mutable static field could be changed by malicious code or by accident from another package.
> Fix: Made the field final. At PartitionedHashMap.java:[line74] Field org.jgroups.blocks.PartitionedHashMap.methods

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list