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

StackOverflow at startup from LabelAtom.load

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      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

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

          Show
          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?
          Hide
          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..

          Show
          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..
          Hide
          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.

          Show
          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.
          Hide
          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

          Show
          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
          Hide
          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
          Show
          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
          Hide
          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.

          Show
          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.
          Hide
          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
          Show
          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

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

              Dates

              Created:
              Updated:
              Resolved: