Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1306

cf-promises segfault when canonifying list as string

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0
    • Component/s: cf-promises
    • Labels:
      None
    • Platform:
      Any
    • Found in version (details):
      Enterprise build 2018

      Description

      The following policy generates a segfault:

      <pre>
      bundle agent test
      {
      vars:

      "mylist" slist =>

      { "a", "b" }

      ;

      "canonified_$(mylist)" slist => canonify("$(mylist)");

      1. "canonified_$(mylist)" slist => { canonify("$(mylist)") }

        ; # this doesn't segfault

      }
      </pre>

      <pre>

      1. cf-promises test.cf
        Segmentation fault (core dumped)
        </pre>

      <pre>
      (gdb) where
      #0 IsVariableSelfReferential (ctx=0x6050f0, ref=0x694250, value=0x694290, type=CF_DATA_TYPE_STRING_LIST, tags=0x7ffff7da42c1 "source=promise")
      at eval_context.c:1739
      #1 EvalContextVariablePut (ctx=0x6050f0, ref=0x694250, value=0x694290, type=CF_DATA_TYPE_STRING_LIST, tags=0x7ffff7da42c1 "source=promise")
      at eval_context.c:1819
      #2 0x00007ffff7d80a48 in VerifyVarPromise (ctx=0x6050f0, pp=0x691860, allow_duplicates=<value optimized out>) at verify_vars.c:336
      #3 0x00007ffff7d5ee0f in ExpandPromiseAndDo (ctx=0x6050f0, pp=<value optimized out>, ActOnPromise=0x7ffff7d800f0 <VerifyVarPromise>, param=0x0)
      at expand.c:207
      #4 ExpandPromise (ctx=0x6050f0, pp=<value optimized out>, ActOnPromise=0x7ffff7d800f0 <VerifyVarPromise>, param=0x0) at expand.c:161
      #5 0x00007ffff7d5f140 in BundleResolve (ctx=0x6050f0, bundle=0x68aff0) at expand.c:913
      #6 0x00007ffff7d5f266 in PolicyResolve (ctx=0x6050f0, policy=0x9756c0, config=0x605010) at expand.c:1082
      #7 0x00007ffff7d69227 in LoadPolicyFile (ctx=0x6050f0, config=0x605010, policy_file=0x6050b0 "test.cf", parsed_files_and_checksums=0x676410,
      failed_files=0x676540) at loading.c:323
      #8 0x00007ffff7d69670 in LoadPolicy (ctx=0x6050f0, config=0x605010) at loading.c:446
      #9 0x00000000004023df in main (argc=<value optimized out>, argv=0x7fffffffe688) at cf-promises.c:129
      </pre>

      Somewhat of a corner case, as we're trying to assign a string to an slist.

        Attachments

          Activity

            People

            • Assignee:
              a10025 Volker Hilsheimer (Inactive)
              Reporter:
              a10003 Eystein Maloy Stenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel