Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5993

Possible intermittent test failure in registry_spec.rb

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Template:
    • Acceptance Criteria:
      • If possible, create reproduction case
      • Find and fix issue
      • If possible, add acceptance test
      • Puppet consistently passes CI
    • Epic Link:
    • Team:
      Windows
    • Story Points:
      5

      Description

      During a different PR (PUP-5991) the registry_spec test failed but then passed when the CI test was started again.

      The registry code was changed a while ago to guard against memory buffer overruns but perhaps not all of the code was corrected. Test Failure;

      [00:37:29] Failures:
      [00:37:29] 
      [00:37:29]   1) Puppet::Util::Windows::Registry#values when reading values should return REG_MULTI_SZ values
      [00:37:29]      Failure/Error: expect(written).to eq(pair[:value])
      [00:37:29] 
      [00:37:29]        expected: ["string1", "string2"]
      [00:37:29]             got: ["string1", "string2", "\u6E00"]
      [00:37:29] 
      [00:37:29]        (compared using ==)
      [00:37:29]      # ./spec/integration/util/windows/registry_spec.rb:222:in `block (6 levels) in <top (required)>'
      [00:37:29]      # ./spec/integration/util/windows/registry_spec.rb:213:in `block (5 levels) in <top (required)>'
      [00:37:29] 
      

      The failing code in question can be found at https://github.com/puppetlabs/puppet/blob/dae071984dd25025498bbf273cffa0e3e5b6ca43/spec/integration/util/windows/registry_spec.rb#L199-L226

      Particularly, round-tripping the following values through reg.write triggered a read of extraneous data:

      {:name => 'REG_MULTI_SZ', :type => Win32::Registry::REG_MULTI_SZ, :value => ['string1', 'string2']}
      

      The Unicode character http://www.fileformat.info/info/unicode/char/6e00/index.htm is not present in any of the strings, so this looks like an improperly terminated string / memory corruption issue.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              glenn.sarti Glenn Sarti
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support