grpc/src/ruby/end2end
Alan Wu b85ebb9bba [ruby] Fix use-after-free for post-fork channel recreation (#35488)
The `grpc_channel_args` is retained on the Ruby object and used for recreating the channel after forking in
grpc_rb_channel_maybe_recreate_channel_after_fork(). Previously, the key for each argument was taken from a Ruby string directly, which could be invalidated if the Ruby string is modified or moved by the GC. Duplicate the string for the key instead, so we own it.

Reproducer in https://github.com/grpc/grpc/issues/35489

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #35488

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35488 from Shopify:key-uaf c1813cee01
PiperOrigin-RevId: 599304551
2024-01-17 15:19:45 -08:00
..
lib Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
protos Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
README.md add copyright header to fix failing sanity tests 2017-03-15 17:32:40 -07:00
bad_usage_fork_test.rb [ruby] experimental client side fork support (#33430) 2023-07-10 13:34:10 -07:00
call_credentials_returning_bad_metadata_doesnt_kill_background_thread_test.rb [ruby] raise RPC deadline in a flakey test (#33713) 2023-07-20 10:07:24 -07:00
call_credentials_timeout_test.rb Don't perform unnecessary RPCs in call creds timeout test 2021-02-11 20:02:08 -08:00
channel_closing_client.rb Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
channel_closing_test.rb Bump timeouts in ruby end2end tests (#31266) 2022-10-06 13:54:54 -07:00
channel_state_client.rb Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
channel_state_test.rb Bump timeouts in ruby end2end tests (#31266) 2022-10-06 13:54:54 -07:00
client_memory_usage_client.rb Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
client_memory_usage_test.rb Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
echo_server.rb [ruby] experimental client side fork support (#33430) 2023-07-10 13:34:10 -07:00
end2end_common.rb [ruby] experimental client side fork support (#33430) 2023-07-10 13:34:10 -07:00
errors_load_before_grpc_lib_test.rb Split up run_ruby_end2end_tests.sh into more granular test targets 2020-07-27 15:07:23 -07:00
fork_test.rb [ruby] experimental client side fork support (#33430) 2023-07-10 13:34:10 -07:00
fork_test_repro_35489.rb [ruby] Fix use-after-free for post-fork channel recreation (#35488) 2024-01-17 15:19:45 -08:00
forking_client_client.rb Bump timeouts in ruby end2end tests (#31266) 2022-10-06 13:54:54 -07:00
forking_client_test.rb Bump timeouts in ruby end2end tests (#31266) 2022-10-06 13:54:54 -07:00
gen_protos.sh auto-fix most of licenses 2017-06-08 11:22:41 +02:00
graceful_sig_handling_client.rb Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
graceful_sig_handling_test.rb Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
graceful_sig_stop_client.rb Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
graceful_sig_stop_test.rb Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
grpc_class_init_client.rb [ruby testing]: experimental change to grpc_class_init_test (#32337) 2023-02-14 14:49:11 -08:00
grpc_class_init_test.rb [ruby testing]: experimental change to grpc_class_init_test (#32337) 2023-02-14 14:49:11 -08:00
killed_client_thread_client.rb Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
killed_client_thread_test.rb Bump timeouts in ruby end2end tests (#31266) 2022-10-06 13:54:54 -07:00
load_grpc_with_gc_stress_test.rb Replace disrespectful term 2021-02-08 15:29:53 -08:00
logger_load_before_grpc_lib_test.rb Split up run_ruby_end2end_tests.sh into more granular test targets 2020-07-27 15:07:23 -07:00
multiple_killed_watching_threads_test.rb Replace disrespectful term 2021-02-08 15:29:53 -08:00
package_with_underscore_test.rb build protoc artifacts with cmake 2020-12-09 11:54:44 +01:00
prefork_postfork_loop_test.rb [ruby] remove unnecessary background thread startup wait logic that interferes with forking (#33805) 2023-07-24 15:17:54 -07:00
prefork_without_using_grpc_test.rb [ruby] fix crash when prefork/postfork is used without previously using grpc (#33788) 2023-07-20 11:26:02 -07:00
secure_fork_test.rb [ruby] experimental client side fork support (#33430) 2023-07-10 13:34:10 -07:00
sig_handling_client.rb Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
sig_handling_test.rb Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
sig_int_during_channel_watch_client.rb Fix child process port selection in ruby end-to-end tests 2021-02-12 13:45:42 -08:00
sig_int_during_channel_watch_test.rb Bump timeouts in ruby end2end tests (#31266) 2022-10-06 13:54:54 -07:00
simple_fork_test.rb [ruby] experimental client side fork support (#33430) 2023-07-10 13:34:10 -07:00
status_codes_load_before_grpc_lib_test.rb Split up run_ruby_end2end_tests.sh into more granular test targets 2020-07-27 15:07:23 -07:00

README.md

This directory contains some grpc-ruby end to end tests.

Each test here involves two files: a "driver" and a "client". For example, the "channel_closing" test involves channel_closing_driver.rb and channel_closing_client.rb.

Typically, the "driver" will start up a simple "echo" server, and then spawn a client. It gives the client the address of the "echo" server as well as an address to listen on for control rpcs. Depending on the test, the client usually starts up a "ClientControl" grpc server for the driver to interact with (the driver can tell the client process to do strange things at different times, depending on the test).

So far these tests are mostly useful for testing process-shutdown related situations, since the client's run in separate processes.

These tests are invoked through the "tools/run_tests/run_tests.py" script (the Rakefile doesn't start these).