Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-7378

StackOverflow at startup from LabelAtom.load

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • core
    • None

    Description

      hudson.model.Label.ConverterImpl does Hudson.getInstance().getLabel(reader.getValue()), presumably so there is a singleton instance of each Label type. However, when the Label is a LabelAtom this results in new LabelAtom() which calls load() which unmarshalls the object and returns to the getLabel call in ConverterImpl.. infinite loop, eventual StackOverflow.

      Attachments

        Activity

          mindless Alan Harder added a comment -

          Perhaps LabelAtom.getConfigFile() should use a different XStream instance instead of Hudson.XSTREAM? One that doesn't use Label.ConverterImpl.. then the LabelAtom.properties fields can save/load via RobustReflectionConverter.. is this the right approach?

          mindless Alan Harder added a comment - Perhaps LabelAtom.getConfigFile() should use a different XStream instance instead of Hudson.XSTREAM? One that doesn't use Label.ConverterImpl.. then the LabelAtom.properties fields can save/load via RobustReflectionConverter.. is this the right approach?
          mindless Alan Harder added a comment -

          OK, I now remember that when I saw the new LabelAtom stuff and that a config page existed, just playing around I tried adding "/configure" on a "/label/foo" page, and submitting the form.. so I have a $HUDSON_HOME/labels/foo.xml file.. probably most people won't see this StackOverflow as they wouldn't have any existing xml files here..

          mindless Alan Harder added a comment - OK, I now remember that when I saw the new LabelAtom stuff and that a config page existed, just playing around I tried adding "/configure" on a "/label/foo" page, and submitting the form.. so I have a $HUDSON_HOME/labels/foo.xml file.. probably most people won't see this StackOverflow as they wouldn't have any existing xml files here..
          mindless Alan Harder added a comment -

          Ok, I'm committing a fix using a separate XStream instance to avoid use of Label.ConverterImpl for LabelAtom.save/load.. feel free to refactor if there is a better way.

          mindless Alan Harder added a comment - Ok, I'm committing a fix using a separate XStream instance to avoid use of Label.ConverterImpl for LabelAtom.save/load.. feel free to refactor if there is a better way.

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/core/src/main/java/hudson/model/labels/LabelAtom.java
          http://jenkins-ci.org/commit/34476
          Log:
          [FIXED JENKINS-7378] avoid StackOverflow error in LabelAtom.load

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/java/hudson/model/labels/LabelAtom.java http://jenkins-ci.org/commit/34476 Log: [FIXED JENKINS-7378] avoid StackOverflow error in LabelAtom.load
          dogfood dogfood added a comment -

          Integrated in hudson_main_trunk #243
          [FIXED JENKINS-7378] avoid StackOverflow error in LabelAtom.load

          mindless :
          Files :

          • /trunk/hudson/main/core/src/main/java/hudson/model/labels/LabelAtom.java
          dogfood dogfood added a comment - Integrated in hudson_main_trunk #243 [FIXED JENKINS-7378] avoid StackOverflow error in LabelAtom.load mindless : Files : /trunk/hudson/main/core/src/main/java/hudson/model/labels/LabelAtom.java

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/src/main/java/hudson/model/labels/LabelAtom.java
          http://jenkins-ci.org/commit/34591
          Log:
          JENKINS-7378 LabelProperties should be able to refer to other labels, and those things should be persisted as references, not as a bean.

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/model/labels/LabelAtom.java http://jenkins-ci.org/commit/34591 Log: JENKINS-7378 LabelProperties should be able to refer to other labels, and those things should be persisted as references, not as a bean.
          dogfood dogfood added a comment -

          Integrated in hudson_main_trunk #250
          JENKINS-7378 LabelProperties should be able to refer to other labels, and those things should be persisted as references, not as a bean.

          kohsuke :
          Files :

          • /trunk/hudson/main/core/src/main/java/hudson/model/labels/LabelAtom.java
          dogfood dogfood added a comment - Integrated in hudson_main_trunk #250 JENKINS-7378 LabelProperties should be able to refer to other labels, and those things should be persisted as references, not as a bean. kohsuke : Files : /trunk/hudson/main/core/src/main/java/hudson/model/labels/LabelAtom.java

          People

            mindless Alan Harder
            mindless Alan Harder
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: