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

RSpec tests sometimes lead to memory access error on Windows

    XMLWordPrintable

Details

    • Improvement
    • Status: Accepted
    • Normal
    • Resolution: Unresolved
    • None
    • None
    • None
    • Needs Assessment

    Description

      Sometimes pull requests fail on Windows. The error occurs in "after :each", which causes a cascading effect due to the Puppet.context being left in a bad state. It happens in PRs targeting 6.x (definitely) and main (I think):

        1) Puppet::Util::Windows::Process when reading environment variables will ignore only keys or values with corrupt byte sequences
           Failure/Error: get_uint32(i * 2) == 0
           IndexError:
             Memory access offset=32 size=4 is out of bounds
           # ./lib/puppet/util/windows/api_types.rb:82:in `get_uint32'
           # ./lib/puppet/util/windows/api_types.rb:82:in `block in read_arbitrary_wide_string_up_to'
           # ./lib/puppet/util/windows/api_types.rb:81:in `each'
           # ./lib/puppet/util/windows/api_types.rb:81:in `find'
           # ./lib/puppet/util/windows/api_types.rb:81:in `read_arbitrary_wide_string_up_to'
           # ./lib/puppet/util/windows/process.rb:309:in `get_environment_strings'
           # ./lib/puppet/util.rb:77:in `clear_environment'
           # ./lib/puppet/test/test_helper.rb:202:in `after_each_test'
           # ./spec/spec_helper.rb:192:in `block (2 levels) in <top (required)>'
           # ./spec/spec_helper.rb:187:in `block (2 levels) in <top (required)>'
           # util/rspec_runner:44:in `run'
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              josh Josh Cooper
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Zendesk Support