glassfish
  1. glassfish
  2. GLASSFISH-17392

System property translation loops if a=${a}

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.1
    • Fix Version/s: 4.0
    • Component/s: configuration
    • Labels:
      None

      Description

      If a system property has the value a=$

      {a}

      , then the TranslatedConfigView class will loop forever trying to resolve the value. The bug is in TranslatedConfigView at about line 100.

        Activity

        Hide
        Tom Mueller added a comment -

        Excluding from 3.1.x releases.

        Show
        Tom Mueller added a comment - Excluding from 3.1.x releases.
        Hide
        Tom Mueller added a comment - - edited

        To recreate this problem, do:

        asadmin create-system-properties 'a=$

        {a}'
        asadmin list-system-properties

        The first command succeeds, but the second command pauses for a long time eventually times-out or has to be killed. This is because the server goes into an infinite loop trying to evaluate the value of a. Also, you will note that after the create-system-properties call, the server is consuming all of a CPU because of the infinite loop.

        Also, after this system property is created, a list-system-properties after the server is restarted will also cause it to go into an infinite loop.

        Other test cases are:

        asadmin create-system-properties 'a=foo ${a}

        '
        asadmin create-system-properties 'a=foo $

        {b}

        :b=bar $

        {a}

        '

        Show
        Tom Mueller added a comment - - edited To recreate this problem, do: asadmin create-system-properties 'a=$ {a}' asadmin list-system-properties The first command succeeds, but the second command pauses for a long time eventually times-out or has to be killed. This is because the server goes into an infinite loop trying to evaluate the value of a. Also, you will note that after the create-system-properties call, the server is consuming all of a CPU because of the infinite loop. Also, after this system property is created, a list-system-properties after the server is restarted will also cause it to go into an infinite loop. Other test cases are: asadmin create-system-properties 'a=foo ${a} ' asadmin create-system-properties 'a=foo $ {b} :b=bar $ {a} '
        Hide
        Tom Mueller added a comment -

        Fixed in revision 51710.

        The solution is to impose a limit of 100 on system property substitutions. This limit is arbitrarily chosen, but I expect this is large enough.

        Show
        Tom Mueller added a comment - Fixed in revision 51710. The solution is to impose a limit of 100 on system property substitutions. This limit is arbitrarily chosen, but I expect this is large enough.

          People

          • Assignee:
            Tom Mueller
            Reporter:
            Tom Mueller
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: