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 2010/10/12 07:10:05 UTC

DO NOT REPLY [Bug 50078] New: Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

https://issues.apache.org/bugzilla/show_bug.cgi?id=50078

           Summary: Concurrent access to WeakHashMap in ConcurrentCache
                    causes infinite loop, 100% CPU usage
           Product: Tomcat 6
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: takayoshi@gmail.com


Created an attachment (id=26163)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26163)
Proposed patch for tc6 trunk

There is a WeakHashMap instance that is accessed concurrently and sometimes
causes infinite loop. It's extremely hard to reproduce but you can refer to
similar concurrent access looping problem by the following search keywords:

* weakhashmap infinite loop 100% cpu stuck synchronized concurrent
* java.util.WeakHashMap.put(WeakHashMap.java:405)
* java.util.WeakHashMap.get(WeakHashMap.java:355)

The org.apache.el.util.ConcurrentCache and
javax.el.BeanELResolver.ConcurrentCache classes have this problem.

There are 20 threads get stuck at the following thread stack:

"ajp-146.215.106.42-8009-38" daemon prio=10 tid=0x00002aab6425d800 nid=0x135b
runnable [0x0000000048c14000]
   java.lang.Thread.State: RUNNABLE
    at java.util.WeakHashMap.get(WeakHashMap.java:355)
    at org.apache.el.util.ConcurrentCache.get(ConcurrentCache.java:24)
    at
org.apache.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:90)

"ajp-146.215.106.42-8009-18" daemon prio=10 tid=0x00002aab643ea000 nid=0x538d
runnable [0x00000000458fd000]
   java.lang.Thread.State: RUNNABLE
    at java.util.WeakHashMap.put(WeakHashMap.java:405)
    at java.util.WeakHashMap.putAll(WeakHashMap.java:518)
    at org.apache.el.util.ConcurrentCache.put(ConcurrentCache.java:34)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

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

--- Comment #4 from Jackie Rosen <ja...@hushmail.com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.

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


DO NOT REPLY [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

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

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

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

--- Comment #3 from Mark Thomas <ma...@apache.org> 2010-10-25 12:38:14 EDT ---
This has been fixed in 6.0.x and will be included in 6.0.30 onwards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

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

Jay S <js...@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jsartoris@hotmail.com

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


DO NOT REPLY [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

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

--- Comment #2 from Mark Thomas <ma...@apache.org> 2010-10-14 13:40:24 EDT ---
Thanks for the patch. I have fixed in this in trunk and that fix will be in
7.0.4 onwards. I added the ability to control the cache sizes.
The patches have also been proposed for 6.0.x.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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


Re: [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

Posted by sebb <se...@gmail.com>.
On 16 April 2014 11:04, Mark Thomas <ma...@apache.org> wrote:
> On 16/04/2014 10:56, Konstantin Kolinko wrote:
>> 2014-04-16 13:48 GMT+04:00 Mark Thomas <ma...@apache.org>:
>>> On 16/04/2014 10:36, bugzilla@apache.org wrote:
>>>> https://issues.apache.org/bugzilla/show_bug.cgi?id=50078
>>>>
>>>> --- Comment #4 from Andrea Wilson <an...@aol.com> ---
>>>
>>> This idiot has had their account locked. I also deleted the spam comment.
>>>
>>
>> There is also a spam comment here (#25)
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=43327
>
> I'll delete that in a sec - after I have done a global search for
> comments with that text.

The same happened on Feb 17, with the same text (different e-mail):

https://issues.apache.org/bugzilla/show_bug.cgi?id=53969

--- Comment #3 from Jackie Rosen <ja...@hushmail.com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain <redacted>
Page where seen: <redacted>
Marked for reference. Resolved as fixed @bugzilla.

Just wondering: does Bugzilla support any form of BadContent checking?

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

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


Re: [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

Posted by Mark Thomas <ma...@apache.org>.
On 16/04/2014 10:56, Konstantin Kolinko wrote:
> 2014-04-16 13:48 GMT+04:00 Mark Thomas <ma...@apache.org>:
>> On 16/04/2014 10:36, bugzilla@apache.org wrote:
>>> https://issues.apache.org/bugzilla/show_bug.cgi?id=50078
>>>
>>> --- Comment #4 from Andrea Wilson <an...@aol.com> ---
>>
>> This idiot has had their account locked. I also deleted the spam comment.
>>
> 
> There is also a spam comment here (#25)
> https://issues.apache.org/bugzilla/show_bug.cgi?id=43327

I'll delete that in a sec - after I have done a global search for
comments with that text.

Mark


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


Re: [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

Posted by Konstantin Kolinko <kn...@gmail.com>.
2014-04-16 13:48 GMT+04:00 Mark Thomas <ma...@apache.org>:
> On 16/04/2014 10:36, bugzilla@apache.org wrote:
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=50078
>>
>> --- Comment #4 from Andrea Wilson <an...@aol.com> ---
>
> This idiot has had their account locked. I also deleted the spam comment.
>

There is also a spam comment here (#25)
https://issues.apache.org/bugzilla/show_bug.cgi?id=43327

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


Re: [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

Posted by Mark Thomas <ma...@apache.org>.
On 16/04/2014 10:36, bugzilla@apache.org wrote:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=50078
> 
> --- Comment #4 from Andrea Wilson <an...@aol.com> ---

This idiot has had their account locked. I also deleted the spam comment.

Mark

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


[Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

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

--- Comment #4 from Andrea Wilson <an...@aol.com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.

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


Re: DO NOT REPLY [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

Posted by Mark Thomas <ma...@apache.org>.
On 14/10/2010 09:44, Tim Whittington wrote:
> I can have a look at this.
> Is there a preferred way of making this configurable?
> Given the caches are static, it's either going to be system property,
> or changing to using an instance cache retained somewhere appropriate
> (at the moment the builders appear to be instantiated in a lot of
> places).

I'd been thinking system property (maybe two since there are two caches
but I wanted to look into that more)

> Just out of interest, does anyone have any data/experience on the
> behaviour of the eden/pull to eden/weak overflow style of caching vs a
> conventional LRU cache? (not one I've seen used a lot before).

Not here. The current impl looks reasonable though.

Mark

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


Re: DO NOT REPLY [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

Posted by Tim Whittington <ti...@apache.org>.
No worries, I got to take a tour of the EL implementation anyway :)

I was in the middle of replying to you when my loaner laptop died, so
I called it a night.
New laptop arrived today (after a 3 week 'incident at sea' hiatus) so
should be back to full speed soon.

cheers
tim

On Fri, Oct 15, 2010 at 6:36 AM, Mark Thomas <ma...@apache.org> wrote:
> On 14/10/2010 16:08, Mark Thomas wrote:
>> On 14/10/2010 09:44, Tim Whittington wrote:
>>> I can have a look at this.
>>
>> Tim,
>>
>> Any progress on this? I'd like to get something into Tomcat 7 before I
>> tag 7.0.4 later today. I'm happy to look at it if that doesn't fit your
>> schedule.
>
> As will soon be apparent from the commit logs, I went ahead and took a
> look at this so I could tag 7.0.4.
>
> Sorry if I stepped on your toes in the process.
>
> Mark
>
>>
>> Mark
>>
>>
>>
>>> Is there a preferred way of making this configurable?
>>> Given the caches are static, it's either going to be system property,
>>> or changing to using an instance cache retained somewhere appropriate
>>> (at the moment the builders appear to be instantiated in a lot of
>>> places).
>>>
>>> Just out of interest, does anyone have any data/experience on the
>>> behaviour of the eden/pull to eden/weak overflow style of caching vs a
>>> conventional LRU cache? (not one I've seen used a lot before).
>>>
>>> cheers
>>> tim
>>>
>>> On Wed, Oct 13, 2010 at 4:46 AM,  <bu...@apache.org> wrote:
>>>> https://issues.apache.org/bugzilla/show_bug.cgi?id=50078
>>>>
>>>> --- Comment #1 from Remy Maucherat <re...@apache.org> 2010-10-12 11:46:18 EDT ---
>>>> Ooops, this needs to be fixed ASAP.
>>>>
>>>> The map sizes need to be made configurable I think (with the sync, 5000 might
>>>> be too low for big setups and would result in a lot of syncs).
>>>>
>>>> --
>>>> Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
>>>> ------- 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
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

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


Re: DO NOT REPLY [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

Posted by Mark Thomas <ma...@apache.org>.
On 14/10/2010 16:08, Mark Thomas wrote:
> On 14/10/2010 09:44, Tim Whittington wrote:
>> I can have a look at this.
> 
> Tim,
> 
> Any progress on this? I'd like to get something into Tomcat 7 before I
> tag 7.0.4 later today. I'm happy to look at it if that doesn't fit your
> schedule.

As will soon be apparent from the commit logs, I went ahead and took a
look at this so I could tag 7.0.4.

Sorry if I stepped on your toes in the process.

Mark

> 
> Mark
> 
> 
> 
>> Is there a preferred way of making this configurable?
>> Given the caches are static, it's either going to be system property,
>> or changing to using an instance cache retained somewhere appropriate
>> (at the moment the builders appear to be instantiated in a lot of
>> places).
>>
>> Just out of interest, does anyone have any data/experience on the
>> behaviour of the eden/pull to eden/weak overflow style of caching vs a
>> conventional LRU cache? (not one I've seen used a lot before).
>>
>> cheers
>> tim
>>
>> On Wed, Oct 13, 2010 at 4:46 AM,  <bu...@apache.org> wrote:
>>> https://issues.apache.org/bugzilla/show_bug.cgi?id=50078
>>>
>>> --- Comment #1 from Remy Maucherat <re...@apache.org> 2010-10-12 11:46:18 EDT ---
>>> Ooops, this needs to be fixed ASAP.
>>>
>>> The map sizes need to be made configurable I think (with the sync, 5000 might
>>> be too low for big setups and would result in a lot of syncs).
>>>
>>> --
>>> Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
>>> ------- 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
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 


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


Re: DO NOT REPLY [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

Posted by Mark Thomas <ma...@apache.org>.
On 14/10/2010 09:44, Tim Whittington wrote:
> I can have a look at this.

Tim,

Any progress on this? I'd like to get something into Tomcat 7 before I
tag 7.0.4 later today. I'm happy to look at it if that doesn't fit your
schedule.

Mark



> Is there a preferred way of making this configurable?
> Given the caches are static, it's either going to be system property,
> or changing to using an instance cache retained somewhere appropriate
> (at the moment the builders appear to be instantiated in a lot of
> places).
> 
> Just out of interest, does anyone have any data/experience on the
> behaviour of the eden/pull to eden/weak overflow style of caching vs a
> conventional LRU cache? (not one I've seen used a lot before).
> 
> cheers
> tim
> 
> On Wed, Oct 13, 2010 at 4:46 AM,  <bu...@apache.org> wrote:
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=50078
>>
>> --- Comment #1 from Remy Maucherat <re...@apache.org> 2010-10-12 11:46:18 EDT ---
>> Ooops, this needs to be fixed ASAP.
>>
>> The map sizes need to be made configurable I think (with the sync, 5000 might
>> be too low for big setups and would result in a lot of syncs).
>>
>> --
>> Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
>> ------- 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
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
> 


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


Re: DO NOT REPLY [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

Posted by Remy Maucherat <re...@apache.org>.
On Thu, 2010-10-14 at 21:44 +1300, Tim Whittington wrote:
> I can have a look at this.
> Is there a preferred way of making this configurable?
> Given the caches are static, it's either going to be system property,
> or changing to using an instance cache retained somewhere appropriate
> (at the moment the builders appear to be instantiated in a lot of
> places).
> 
> Just out of interest, does anyone have any data/experience on the
> behaviour of the eden/pull to eden/weak overflow style of caching vs a
> conventional LRU cache? (not one I've seen used a lot before).

No idea what cache scheme would have top efficiency.

Rémy



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


Re: DO NOT REPLY [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

Posted by Tim Whittington <ti...@apache.org>.
I can have a look at this.
Is there a preferred way of making this configurable?
Given the caches are static, it's either going to be system property,
or changing to using an instance cache retained somewhere appropriate
(at the moment the builders appear to be instantiated in a lot of
places).

Just out of interest, does anyone have any data/experience on the
behaviour of the eden/pull to eden/weak overflow style of caching vs a
conventional LRU cache? (not one I've seen used a lot before).

cheers
tim

On Wed, Oct 13, 2010 at 4:46 AM,  <bu...@apache.org> wrote:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=50078
>
> --- Comment #1 from Remy Maucherat <re...@apache.org> 2010-10-12 11:46:18 EDT ---
> Ooops, this needs to be fixed ASAP.
>
> The map sizes need to be made configurable I think (with the sync, 5000 might
> be too low for big setups and would result in a lot of syncs).
>
> --
> Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
> ------- 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
>
>

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


DO NOT REPLY [Bug 50078] Concurrent access to WeakHashMap in ConcurrentCache causes infinite loop, 100% CPU usage

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

--- Comment #1 from Remy Maucherat <re...@apache.org> 2010-10-12 11:46:18 EDT ---
Ooops, this needs to be fixed ASAP.

The map sizes need to be made configurable I think (with the sync, 5000 might
be too low for big setups and would result in a lot of syncs).

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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