1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Pass ASAN options to child environments

I want to work with ASAN, but some child environments are not inheriting
the ASAN options I'm using.  This commit passes them to child
environments if specified
This commit is contained in:
Aaron Patterson 2020-09-28 08:28:10 -07:00
parent 346301e232
commit 0767d387ec
No known key found for this signature in database
GPG key ID: 953170BCB4FFAFC6
2 changed files with 2 additions and 0 deletions

View file

@ -18,6 +18,7 @@ class TestStack < Test::Unit::TestCase
env = {}
env['RUBY_FIBER_VM_STACK_SIZE'] = vm_stack_size.to_s if vm_stack_size
env['RUBY_FIBER_MACHINE_STACK_SIZE'] = machine_stack_size.to_s if machine_stack_size
env['ASAN_OPTIONS'] = ENV['ASAN_OPTIONS'] if ENV['ASAN_OPTIONS']
stdout, stderr, status = EnvUtil.invoke_ruby([env, '-e', script], '', true, true, timeout: 30)
assert(!status.signaled?, FailDesc[status, nil, stderr])

View file

@ -150,6 +150,7 @@ module EnvUtil
if RUBYLIB and lib = child_env["RUBYLIB"]
child_env["RUBYLIB"] = [lib, RUBYLIB].join(File::PATH_SEPARATOR)
end
child_env['ASAN_OPTIONS'] = ENV['ASAN_OPTIONS'] if ENV['ASAN_OPTIONS']
args = [args] if args.kind_of?(String)
pid = spawn(child_env, *precommand, rubybin, *args, **opt)
in_c.close