1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/-test-
nagachika 949af69408 merge revision(s) 5680c38c75aeb5cbd219aafa8eb48c315f287d97,f5d20411386ff2552ff27661387ddc4bae1ebc30: [Backport #17573]
Use valid `ec` for postponed job.

	Postponed job can be registered from non-Ruby thread, which means
	`ec` in TLS can be NULL. In this case, use main thread's `ec` instead.

	See https://github.com/ruby/ruby/pull/4108
	and https://github.com/ruby/ruby/pull/4336
	---
	 vm_trace.c | 16 ++++++++++++----
	 1 file changed, 12 insertions(+), 4 deletions(-)

	Avoid assert failure when NULL EC is expected

	After 5680c38c75, postponed job APIs now
	expect to be called on native threads not managed by Ruby and handles
	getting a NULL execution context. However, in debug builds the change
	runs into an assertion failure with GET_EC() which asserts that EC is
	non-NULL. Avoid the assertion failure by passing `false` for `expect_ec`
	instead as the intention is to handle when there is no EC.

	Add a test from John Crepezzi and John Hawthorn to exercise this
	situation.

	See GH-4108
	See GH-5094

	[Bug #17573]

	Co-authored-by: John Hawthorn <john@hawthorn.email>
	Co-authored-by: John Crepezzi <john.crepezzi@gmail.com>
	---
	 ext/-test-/postponed_job/postponed_job.c       | 31 ++++++++++++++++++++++++++
	 test/-ext-/postponed_job/test_postponed_job.rb |  7 ++++++
	 vm_trace.c                                     |  2 +-
	 3 files changed, 39 insertions(+), 1 deletion(-)
2021-11-23 14:52:30 +09:00
..
arith_seq/extract sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
array add dependency for ext/-test-/array/concat/to_ary_conact.c 2021-09-05 13:49:07 +09:00
bignum sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
bug-3571 sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
bug-5832 sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
bug-14834 sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
bug_reporter sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
class sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
cxxanyargs ext/-test-/cxxanyargs: suppress SunPro warning 2020-08-21 11:04:54 +09:00
debug sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
dln/empty
enumerator_kw sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
exception sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
fatal sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
file sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
float sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
funcall sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
gvl/call_without_gvl sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
hash sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
integer sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
iseq_load sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
iter sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
load sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
marshal sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
memory_status Update dependencies for macOS 2020-10-21 12:31:45 +09:00
memory_view [memory_view] Make some rb_memroy_view_t members const 2020-12-23 09:24:55 +09:00
method sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
notimplement sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
num2int sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
path_to_class sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
popen_deadlock sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
postponed_job merge revision(s) 5680c38c75aeb5cbd219aafa8eb48c315f287d97,f5d20411386ff2552ff27661387ddc4bae1ebc30: [Backport #17573] 2021-11-23 14:52:30 +09:00
printf sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
proc sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
random Add FALLTHROUGH 2020-09-08 10:30:07 +09:00
rational sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
rb_call_super_kw sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
recursion sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
regexp sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
RUBY_ALIGNOF Protoized old pre-ANSI K&R style definitions 2020-12-05 14:57:31 +09:00
scan_args sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
st Removed rb_cData entity 2020-12-22 02:51:49 +09:00
string merge revision(s) 391abc543cea118a9cd7d6310acadbfa352668ef,e86c1f6fc53433ef5c82ed2b7a4cc9a12c153e4c,f6539202c52a051a4e6946a318a1d9cd29002990: [Backport #12052] 2021-07-18 11:19:13 +09:00
struct sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
symbol sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
thread_fd_close sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
time sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
tracepoint keep proc on the stack so it does not move 2020-10-16 11:28:52 -07:00
typeddata Removed rb_cData entity 2020-12-22 02:51:49 +09:00
vm sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
wait_for_single_fd sed -i '/rmodule.h/d' 2020-08-27 16:42:06 +09:00
win32 test_console_attr.rb: fix test 2018-01-15 12:25:24 +00:00
auto_ext.rb