qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (QPID-6510) [0.8/0.9.x/0.10 JMS Client] An instance initializer in org.apache.qpid.filter.PropertyExpression may cause an indefinite loop in HashMap.put() when instances of PropertyExpression are created from different threads at the same time
Date Fri, 24 Apr 2015 15:35:38 GMT

    [ https://issues.apache.org/jira/browse/QPID-6510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14511237#comment-14511237
] 

ASF subversion and git services commented on QPID-6510:
-------------------------------------------------------

Commit 1675889 from orudyy@apache.org in branch 'java/trunk'
[ https://svn.apache.org/r1675889 ]

QPID-6510: Initialize static field PropertyExpression.JMS_PROPERTY_EXPRESSIONS in static initializer

> [0.8/0.9.x/0.10 JMS Client] An instance initializer in org.apache.qpid.filter.PropertyExpression
may cause an indefinite loop in HashMap.put() when instances of PropertyExpression are created
from different threads at the same time
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-6510
>                 URL: https://issues.apache.org/jira/browse/QPID-6510
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.8, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.24, 0.26, 0.28,
0.30, 0.32
>            Reporter: Alex Rudyy
>             Fix For: 6.0 [Java]
>
>
> Static field org.apache.qpid.filter.PropertyExpression.JMS_PROPERTY_EXPRESSIONS is modified
in instance initialization block of PropertyExpression. Instance initializer is called on
each instance creation causing unnecessary modification of JMS_PROPERTY_EXPRESSIONS and in
some causes it might result in indefinite loops in HashMap.put as  HashMap is not thread safe.
> Replacing instance initializer with static initializer should solve the problem.
> Here is a sample stack traces demonstrating the issue
> {noformat}
> "cancelConsumer-1" prio=6 tid=0x00000000114ea000 nid=0x2b10 runnable [0x00000000135ee000]
>    java.lang.Thread.State: RUNNABLE
> 	at java.util.HashMap.put(HashMap.java:494)
> 	at org.apache.qpid.filter.PropertyExpression.<init>(PropertyExpression.java:67)
> 	at org.apache.qpid.filter.selector.SelectorParser.variable(SelectorParser.java:537)
> 	at org.apache.qpid.filter.selector.SelectorParser.primaryExpr(SelectorParser.java:451)
> 	at org.apache.qpid.filter.selector.SelectorParser.unaryExpr(SelectorParser.java:425)
> 	at org.apache.qpid.filter.selector.SelectorParser.multExpr(SelectorParser.java:359)
> 	at org.apache.qpid.filter.selector.SelectorParser.addExpression(SelectorParser.java:328)
> 	at org.apache.qpid.filter.selector.SelectorParser.comparisonExpression(SelectorParser.java:180)
> 	at org.apache.qpid.filter.selector.SelectorParser.equalityExpression(SelectorParser.java:125)
> 	at org.apache.qpid.filter.selector.SelectorParser.andExpression(SelectorParser.java:104)
> 	at org.apache.qpid.filter.selector.SelectorParser.orExpression(SelectorParser.java:83)
> 	at org.apache.qpid.filter.selector.SelectorParser.JmsSelector(SelectorParser.java:75)
> 	at org.apache.qpid.filter.selector.SelectorParser.parse(SelectorParser.java:53)
> 	at org.apache.qpid.client.filter.JMSSelectorFilter.<init>(JMSSelectorFilter.java:56)
> 	at org.apache.qpid.client.BasicMessageConsumer.<init>(BasicMessageConsumer.java:166)
> 	at org.apache.qpid.client.BasicMessageConsumer_0_8.<init>(BasicMessageConsumer_0_8.java:57)
> 	at org.apache.qpid.client.AMQSession_0_8.createMessageConsumer(AMQSession_0_8.java:471)
> 	at org.apache.qpid.client.AMQSession_0_8.createMessageConsumer(AMQSession_0_8.java:57)
> 	at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:2009)
> 	at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1999)
> 	at org.apache.qpid.client.AMQConnectionDelegate_8_0.executeRetrySupport(AMQConnectionDelegate_8_0.java:331)
> 	- locked <0x00000007c3ebd1d0> (a java.lang.Object)
> 	at org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:608)
> 	at org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102)
> 	at org.apache.qpid.client.AMQSession.createConsumerImpl(AMQSession.java:1997)
> 	at org.apache.qpid.client.AMQSession.createConsumer(AMQSession.java:980)
> 	at org.springframework.jms.listener.AbstractMessageListenerContainer.createConsumer(AbstractMessageListenerContainer.java:820)
> 	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createListenerConsumer(AbstractPollingMessageListenerContainer.java:206)
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.initResourcesIfNecessary(DefaultMessageListenerContainer.java:1165)
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1141)
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1134)
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1031)
> 	at java.lang.Thread.run(Thread.java:745)
> "requestConsumer-1" prio=6 tid=0x0000000011279000 nid=0x2498 runnable [0x000000001304d000]
>    java.lang.Thread.State: RUNNABLE
> 	at java.util.HashMap.put(HashMap.java:494)
> 	at org.apache.qpid.filter.PropertyExpression.<init>(PropertyExpression.java:67)
> 	at org.apache.qpid.filter.selector.SelectorParser.variable(SelectorParser.java:537)
> 	at org.apache.qpid.filter.selector.SelectorParser.primaryExpr(SelectorParser.java:451)
> 	at org.apache.qpid.filter.selector.SelectorParser.unaryExpr(SelectorParser.java:425)
> 	at org.apache.qpid.filter.selector.SelectorParser.multExpr(SelectorParser.java:359)
> 	at org.apache.qpid.filter.selector.SelectorParser.addExpression(SelectorParser.java:328)
> 	at org.apache.qpid.filter.selector.SelectorParser.comparisonExpression(SelectorParser.java:180)
> 	at org.apache.qpid.filter.selector.SelectorParser.equalityExpression(SelectorParser.java:125)
> 	at org.apache.qpid.filter.selector.SelectorParser.andExpression(SelectorParser.java:104)
> 	at org.apache.qpid.filter.selector.SelectorParser.orExpression(SelectorParser.java:83)
> 	at org.apache.qpid.filter.selector.SelectorParser.JmsSelector(SelectorParser.java:75)
> 	at org.apache.qpid.filter.selector.SelectorParser.parse(SelectorParser.java:53)
> 	at org.apache.qpid.client.filter.JMSSelectorFilter.<init>(JMSSelectorFilter.java:56)
> 	at org.apache.qpid.client.BasicMessageConsumer.<init>(BasicMessageConsumer.java:166)
> 	at org.apache.qpid.client.BasicMessageConsumer_0_8.<init>(BasicMessageConsumer_0_8.java:57)
> 	at org.apache.qpid.client.AMQSession_0_8.createMessageConsumer(AMQSession_0_8.java:471)
> 	at org.apache.qpid.client.AMQSession_0_8.createMessageConsumer(AMQSession_0_8.java:57)
> 	at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:2009)
> 	at org.apache.qpid.client.AMQSession$4.execute(AMQSession.java:1999)
> 	at org.apache.qpid.client.AMQConnectionDelegate_8_0.executeRetrySupport(AMQConnectionDelegate_8_0.java:331)
> 	- locked <0x00000007c2821ff0> (a java.lang.Object)
> 	at org.apache.qpid.client.AMQConnection.executeRetrySupport(AMQConnection.java:608)
> 	at org.apache.qpid.client.failover.FailoverRetrySupport.execute(FailoverRetrySupport.java:102)
> 	at org.apache.qpid.client.AMQSession.createConsumerImpl(AMQSession.java:1997)
> 	at org.apache.qpid.client.AMQSession.createConsumer(AMQSession.java:980)
> 	at org.springframework.jms.listener.AbstractMessageListenerContainer.createConsumer(AbstractMessageListenerContainer.java:820)
> 	at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createListenerConsumer(AbstractPollingMessageListenerContainer.java:206)
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.initResourcesIfNecessary(DefaultMessageListenerContainer.java:1165)
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1141)
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1134)
> 	at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1031)
> 	at java.lang.Thread.run(Thread.java:745)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message