MMBase

If you call a few thousand times <mm:list orderby=".." path="..,..," then you get StackOverflowExceptions.

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.9.0
  • Fix Version/s: 1.9.1
  • Component/s: Core, Taglib
  • Description:
    Hide
    If you execute the following jsp, about 4000 times:
      <mm:listcontainer path="people,classrel,classes">
            <mm:maxnumber value="1" />
            <mm:sortorder field="classrel.lastlogin" />
            <mm:list />
          </mm:listcontainer>

    The sorteorder is essential.

    Then your mmbase ends up in a unusable state because very many things fail because of a stackoverflow exceptions
    at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$1.(Collections.java:1340)
    at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet.iterator(Collections.java:1339)
    at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$1.(Collections.java:1340)
    at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet.iterator(Collections.java:1339)
    at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$1.(Collections.java:1340)
    Show
    If you execute the following jsp, about 4000 times:   <mm:listcontainer path="people,classrel,classes">         <mm:maxnumber value="1" />         <mm:sortorder field="classrel.lastlogin" />         <mm:list />       </mm:listcontainer> The sorteorder is essential. Then your mmbase ends up in a unusable state because very many things fail because of a stackoverflow exceptions at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$1.(Collections.java:1340) at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet.iterator(Collections.java:1339) at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$1.(Collections.java:1340) at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet.iterator(Collections.java:1339) at java.util.Collections$UnmodifiableMap$UnmodifiableEntrySet$1.(Collections.java:1340)

Activity

Repository Revision Date User Message
MMBase SVN #31740 Thu Nov 06 14:44:29 CET 2008 michiel MMB-1738. Disallow using an already finished datatype
Files Changed
MODIFY /mmbase/trunk/src/org/mmbase/core/CoreField.java
Repository Revision Date User Message
MMBase SVN #31741 Thu Nov 06 14:45:46 CET 2008 michiel MMB-1738. createField will 'take' the datatype. This virtual field cannot of course become the 'owner' of the 'node' datatype. Therefore, the datatype must be cloned first.
Files Changed
MODIFY /mmbase/trunk/src/org/mmbase/bridge/implementation/VirtualNodeManager.java
Hide
Michiel Meeuwissen added a comment - 2008-11-06 14:49
The StackOverflow exception was caused by code in BasicDataType:

   public void finish(Object owner) {
        this.owner = owner;
            handlers = Collections.unmodifiableMap(handlers);
     
    }

So, the 'handlers' map is rewrapped in a new unmodifiableMap very often.

This should not happen, and was fixed.

But the actual cause of the problem was that the 'finish' method was called very often on the same DataType.

This is caused by VirtualNodeManager, which creates VirtualFields using the 'node' datatype without cloning it first.

Changed AbstractField that it does not accept already finished datatypes.
Show
Michiel Meeuwissen added a comment - 2008-11-06 14:49 The StackOverflow exception was caused by code in BasicDataType:    public void finish(Object owner) {         this.owner = owner;             handlers = Collections.unmodifiableMap(handlers);           } So, the 'handlers' map is rewrapped in a new unmodifiableMap very often. This should not happen, and was fixed. But the actual cause of the problem was that the 'finish' method was called very often on the same DataType. This is caused by VirtualNodeManager, which creates VirtualFields using the 'node' datatype without cloning it first. Changed AbstractField that it does not accept already finished datatypes.
Michiel Meeuwissen made changes - 2008-11-06 14:53
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Michiel Meeuwissen made changes - 2008-11-06 15:15
Component/s Core [ 10005 ]
Repository Revision Date User Message
MMBase SVN #31750 Thu Nov 06 17:29:39 CET 2008 michiel since CoreField.finish only calls finish on datatype, MMB-1738 can be solved cheaper, by both not cloning and not finishing.
Files Changed
MODIFY /mmbase/trunk/src/org/mmbase/bridge/implementation/VirtualNodeManager.java

People

Dates

  • Created:
    2008-11-06 14:42
    Updated:
    2008-11-06 15:15
    Resolved:
    2008-11-06 14:53