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

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.

People

Dates

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