You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by bu...@apache.org on 2007/03/14 15:40:56 UTC

DO NOT REPLY [Bug 41838] New: - HashMap infinite loop

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41838>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41838

           Summary: HashMap infinite loop
           Product: Slide
           Version: 2.1
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Transaction Manager
        AssignedTo: slide-dev@jakarta.apache.org
        ReportedBy: olivier.schmitt@agriculture.gouv.fr


When many concurrent threads try to connect to slide using the same user
account, an infinite loop may occur in HashMap.put or HashMap.transfer methods.

Stack trace of some threads inside JConsole :

Name: http-8095-Processor36
State: RUNNABLE
Total blocked: 142  Total waited: 14

Stack trace: 
java.util.HashMap.put(HashMap.java:385)
org.apache.slide.store.ExtendedStore.end(ExtendedStore.java:1029)
org.apache.slide.transaction.SlideTransaction.delistResource(SlideTransaction.java:377)
org.apache.slide.store.AbstractStore.delist(AbstractStore.java:1574)
org.apache.slide.store.AbstractStore.delist(AbstractStore.java:1559)
org.apache.slide.store.ExtendedStore.retrieveObject(ExtendedStore.java:581)
org.apache.slide.structure.StructureImpl.retrieve(StructureImpl.java:178)
org.apache.slide.structure.StructureImpl.retrieve(StructureImpl.java:160)
org.apache.slide.webdav.method.AbstractWebdavMethod.run(AbstractWebdavMethod.java:387)
org.apache.slide.webdav.WebdavServlet.service(WebdavServlet.java:155)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
�

Name: http-8095-Processor46
State: RUNNABLE
Total blocked: 44  Total waited: 12

Stack trace: 
java.util.HashMap.transfer(HashMap.java:476)
java.util.HashMap.resize(HashMap.java:455)
java.util.HashMap.addEntry(HashMap.java:745)
java.util.HashMap.put(HashMap.java:395)
org.apache.slide.store.ExtendedStore.end(ExtendedStore.java:1029)


The ExtendedStore.java, line 1029 :

suspendedLocks.put(txId, locks.get());

Many threads use the same ExtendedStore instance, so the same suspendedLocks
instance.

suspendedLocks is not a synchronized Map.

The following link
http://blogs.opensymphony.com/plightbo/2005/07/hashmapget_can_cause_an_infini.html
explains clearly the behaviour of "non synchronized Map updated by concurrent
threads".

The patch is  :

private Map suspendedLocks = Collections.synchronizedMap(new HashMap());

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


DO NOT REPLY [Bug 41838] - HashMap infinite loop

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41838>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41838


antoine@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO




------- Additional Comments From antoine@apache.org  2007-03-25 14:52 -------
Hi,

the code has changed substantially since 2.1. The suspendedLocks hashMap does
not exist in the current SVN. Could you download the sources of slide from SVN,
rebuild and check whether the current version still has these issues ?

Regards,

Antoine

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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