Jira (PUP-11122) RSpec tests sometimes lead to memory access error on Windows

7 views
Skip to first unread message

Josh Cooper (Jira)

unread,
Jun 17, 2021, 3:45:02 PM6/17/21
to puppe...@googlegroups.com
Josh Cooper created an issue
 
Puppet / Improvement PUP-11122
RSpec tests sometimes lead to memory access error on Windows
Issue Type: Improvement Improvement
Assignee: Unassigned
Created: 2021/06/17 12:44 PM
Priority: Normal Normal
Reporter: Josh Cooper

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'

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Mihai Buzgau (Jira)

unread,
Jun 22, 2021, 10:12:03 AM6/22/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 22, 2021, 5:57:03 PM6/22/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jan 24, 2023, 8:53:03 PM1/24/23
to puppe...@googlegroups.com
Josh Cooper commented on Improvement PUP-11122
 
Re: RSpec tests sometimes lead to memory access error on Windows

I've seen this test fail fairly regularly https://github.com/puppetlabs/puppet/blob/f25f20da81a471a2744b843590e91e002e3ed164/spec/integration/util/windows/registry_spec.rb#L182. I'm wondering if there's a bug when reading in REG_MULTI_SZ (with the double wide null terminator)? Or if the test writes a corrupt registry key is reading it back in incorrectly.

This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages