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

Assertion failure or bad memory access in case of early custom promise module failure

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 3.18.0
    • Fix Version/s: 3.18.0
    • Component/s: Promise types: custom
    • Labels:
      None

      Description

      There's an assertion failure (with debug builds) or a bad memory access in the custom promise module handling if the custom promise module fails very early.

      $ grep . /tmp/test.{cf,py}
      /tmp/test.cf:promise agent test
      /tmp/test.cf:{
      /tmp/test.cf:    path        => "$(this.promise_dirname)/test.py";
      /tmp/test.cf:    interpreter => "/usr/bin/python3";
      /tmp/test.cf:}
      /tmp/test.cf:bundle agent __main__
      /tmp/test.cf:{
      /tmp/test.cf:  test:
      /tmp/test.cf:    "whatever";
      /tmp/test.cf:}
      /tmp/test.py:import non_existing
      
      $ cf-agent/cf-agent -KIf /tmp/test.cf
      Traceback (most recent call last):
        File "/tmp/test.py", line 1, in <module>
          import non_existing
      ModuleNotFoundError: No module named 'non_existing'
      lt-cf-agent: mod_custom.c:372: PromiseModule_ReceiveHeader: Assertion `line[bytes - 1] == '\n'' failed.
      Aborted (core dumped)
      

        Attachments

          Activity

            People

            Assignee:
            vpodzime Vratislav Podzimek
            Reporter:
            vpodzime Vratislav Podzimek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: