Uploaded image for project: 'Commons Sandbox'
  1. Commons Sandbox
  2. SANDBOX-477

StackOverflowError because hash code used in debug messages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • None
    • None
    • Javaflow
    • None

    Description

      JavaFlow often uses hash codes of objects in debug log messages. When the object is a map that contains a reference to itself, an infinite loop occurs which ends with a StackOverflowError exception.

      Although Java specs says that extreme caution is advised when having a map contain itself as a value, JavaFlow should not do any assumption about data it needs to work with and should be able to deal with such a situation.

      The hash code is computed in
      org.apache.commons.javaflow.utils.ReflectionUtils.getClassName(final Object o) which is called e.g. from org.apache.commons.javaflow.bytecode.Stack.pushObject(Object o).

      Possible workaround is to disable debug messages.

      Attachments

        Activity

          People

            Unassigned Unassigned
            handl.marek@centrum.cz Marek Handl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: