* [ruby-core:101952] [Ruby master Bug#17516] forking in a ractor causes Ruby to crash
@ 2021-01-06 10:56 pkmuldoon
2021-01-06 11:10 ` [ruby-core:101953] " pkmuldoon
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: pkmuldoon @ 2021-01-06 10:56 UTC (permalink / raw)
To: ruby-core
Issue #17516 has been reported by pkmuldoon (Phil Muldoon).
----------------------------------------
Bug #17516: forking in a ractor causes Ruby to crash
https://bugs.ruby-lang.org/issues/17516
* Author: pkmuldoon (Phil Muldoon)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
I just want to point out, there's absolutely no reason to do this, but
r = Ractor.new do
Process.fork()
end
Will cause:
<internal:ractor>:267: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
[BUG] rb_thread_terminate_all: called by child thread (0x0000700004ddca40, 0x00007f981b567ee0)
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0001 p:---- s:0003 e:000002 (none) [FINISH]
-- C level backtrace information -------------------------------------------
=> #<Ractor:#3 (pry):5 terminated>
[4] pry(main)> /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_vm_bugreport+0x6cf) [0x103084d1f]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug_without_die+0x206) [0x102e9e2b6]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug+0x71) [0x103091e6b]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_thread_terminate_all+0x329) [0x10301e5b9]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ractor_terminate_all+0xa3) [0x102f8acc3]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ec_cleanup+0x229) [0x102ea9299]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(ruby_stop+0x9) [0x102ea9509]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_2+0x8ce) [0x103027fce]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_1+0x10d) [0x10302753d]
/usr/lib/system/libsystem_pthread.dylib(_pthread_start+0xe0) [0x7fff20382950]
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:101953] [Ruby master Bug#17516] forking in a ractor causes Ruby to crash
2021-01-06 10:56 [ruby-core:101952] [Ruby master Bug#17516] forking in a ractor causes Ruby to crash pkmuldoon
@ 2021-01-06 11:10 ` pkmuldoon
2021-01-06 14:51 ` [ruby-core:101958] " shyouhei
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pkmuldoon @ 2021-01-06 11:10 UTC (permalink / raw)
To: ruby-core
Issue #17516 has been updated by pkmuldoon (Phil Muldoon).
ruby --version
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
----------------------------------------
Bug #17516: forking in a ractor causes Ruby to crash
https://bugs.ruby-lang.org/issues/17516#change-89805
* Author: pkmuldoon (Phil Muldoon)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
I just want to point out, there's absolutely no reason to do this, but
r = Ractor.new do
Process.fork()
end
Will cause:
<internal:ractor>:267: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
[BUG] rb_thread_terminate_all: called by child thread (0x0000700004ddca40, 0x00007f981b567ee0)
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0001 p:---- s:0003 e:000002 (none) [FINISH]
-- C level backtrace information -------------------------------------------
=> #<Ractor:#3 (pry):5 terminated>
[4] pry(main)> /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_vm_bugreport+0x6cf) [0x103084d1f]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug_without_die+0x206) [0x102e9e2b6]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug+0x71) [0x103091e6b]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_thread_terminate_all+0x329) [0x10301e5b9]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ractor_terminate_all+0xa3) [0x102f8acc3]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ec_cleanup+0x229) [0x102ea9299]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(ruby_stop+0x9) [0x102ea9509]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_2+0x8ce) [0x103027fce]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_1+0x10d) [0x10302753d]
/usr/lib/system/libsystem_pthread.dylib(_pthread_start+0xe0) [0x7fff20382950]
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:101958] [Ruby master Bug#17516] forking in a ractor causes Ruby to crash
2021-01-06 10:56 [ruby-core:101952] [Ruby master Bug#17516] forking in a ractor causes Ruby to crash pkmuldoon
2021-01-06 11:10 ` [ruby-core:101953] " pkmuldoon
@ 2021-01-06 14:51 ` shyouhei
2021-01-07 16:27 ` [ruby-core:101975] " pkmuldoon
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: shyouhei @ 2021-01-06 14:51 UTC (permalink / raw)
To: ruby-core
Issue #17516 has been updated by shyouhei (Shyouhei Urabe).
This must be a bug.
Besides there is a technical difficulty to fork a multi-Ractor program (or, there is a technical difficulty to combine pthread and fork in general). I didn’t think we should allow such operation.
Further reading: this looong rationale written in https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_atfork.html
----------------------------------------
Bug #17516: forking in a ractor causes Ruby to crash
https://bugs.ruby-lang.org/issues/17516#change-89811
* Author: pkmuldoon (Phil Muldoon)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
I just want to point out, there's absolutely no reason to do this, but
r = Ractor.new do
Process.fork()
end
Will cause:
<internal:ractor>:267: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
[BUG] rb_thread_terminate_all: called by child thread (0x0000700004ddca40, 0x00007f981b567ee0)
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0001 p:---- s:0003 e:000002 (none) [FINISH]
-- C level backtrace information -------------------------------------------
=> #<Ractor:#3 (pry):5 terminated>
[4] pry(main)> /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_vm_bugreport+0x6cf) [0x103084d1f]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug_without_die+0x206) [0x102e9e2b6]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug+0x71) [0x103091e6b]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_thread_terminate_all+0x329) [0x10301e5b9]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ractor_terminate_all+0xa3) [0x102f8acc3]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ec_cleanup+0x229) [0x102ea9299]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(ruby_stop+0x9) [0x102ea9509]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_2+0x8ce) [0x103027fce]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_1+0x10d) [0x10302753d]
/usr/lib/system/libsystem_pthread.dylib(_pthread_start+0xe0) [0x7fff20382950]
---Files--------------------------------
ruby_2021-01-06-104315_phillip-muldoon-FA588.crash (31.8 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:101975] [Ruby master Bug#17516] forking in a ractor causes Ruby to crash
2021-01-06 10:56 [ruby-core:101952] [Ruby master Bug#17516] forking in a ractor causes Ruby to crash pkmuldoon
2021-01-06 11:10 ` [ruby-core:101953] " pkmuldoon
2021-01-06 14:51 ` [ruby-core:101958] " shyouhei
@ 2021-01-07 16:27 ` pkmuldoon
2021-11-30 5:26 ` [ruby-core:106325] " hsbt (Hiroshi SHIBATA)
2023-08-25 14:33 ` [ruby-core:114536] " jeremyevans0 (Jeremy Evans) via ruby-core
4 siblings, 0 replies; 6+ messages in thread
From: pkmuldoon @ 2021-01-07 16:27 UTC (permalink / raw)
To: ruby-core
Issue #17516 has been updated by pkmuldoon (Phil Muldoon).
I'm wondering if we can limit Process calls in the ractor as we do for accessing out of band variables? I've not had a chance to attach GDB to the Ruby VM yet (I have to compile Ruby with -O0 -g3 for things to be clear).
BTW I'm not suggesting anyone every do that code snippet in the original post! It's somewhat of a theoretical testcase. But the Ruby interpreter shouldn't crash either :thinking face:
----------------------------------------
Bug #17516: forking in a ractor causes Ruby to crash
https://bugs.ruby-lang.org/issues/17516#change-89827
* Author: pkmuldoon (Phil Muldoon)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
I just want to point out, there's absolutely no reason to do this, but
r = Ractor.new do
Process.fork()
end
Will cause:
<internal:ractor>:267: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
[BUG] rb_thread_terminate_all: called by child thread (0x0000700004ddca40, 0x00007f981b567ee0)
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0001 p:---- s:0003 e:000002 (none) [FINISH]
-- C level backtrace information -------------------------------------------
=> #<Ractor:#3 (pry):5 terminated>
[4] pry(main)> /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_vm_bugreport+0x6cf) [0x103084d1f]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug_without_die+0x206) [0x102e9e2b6]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug+0x71) [0x103091e6b]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_thread_terminate_all+0x329) [0x10301e5b9]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ractor_terminate_all+0xa3) [0x102f8acc3]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ec_cleanup+0x229) [0x102ea9299]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(ruby_stop+0x9) [0x102ea9509]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_2+0x8ce) [0x103027fce]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_1+0x10d) [0x10302753d]
/usr/lib/system/libsystem_pthread.dylib(_pthread_start+0xe0) [0x7fff20382950]
---Files--------------------------------
ruby_2021-01-06-104315_phillip-muldoon-FA588.crash (31.8 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:106325] [Ruby master Bug#17516] forking in a ractor causes Ruby to crash
2021-01-06 10:56 [ruby-core:101952] [Ruby master Bug#17516] forking in a ractor causes Ruby to crash pkmuldoon
` (2 preceding siblings ...)
2021-01-07 16:27 ` [ruby-core:101975] " pkmuldoon
@ 2021-11-30 5:26 ` hsbt (Hiroshi SHIBATA)
2023-08-25 14:33 ` [ruby-core:114536] " jeremyevans0 (Jeremy Evans) via ruby-core
4 siblings, 0 replies; 6+ messages in thread
From: hsbt (Hiroshi SHIBATA) @ 2021-11-30 5:26 UTC (permalink / raw)
To: ruby-core
Issue #17516 has been updated by hsbt (Hiroshi SHIBATA).
Assignee set to ko1 (Koichi Sasada)
Status changed from Open to Assigned
----------------------------------------
Bug #17516: forking in a ractor causes Ruby to crash
https://bugs.ruby-lang.org/issues/17516#change-94960
* Author: pkmuldoon (Phil Muldoon)
* Status: Assigned
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
I just want to point out, there's absolutely no reason to do this, but
r = Ractor.new do
Process.fork()
end
Will cause:
<internal:ractor>:267: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
[BUG] rb_thread_terminate_all: called by child thread (0x0000700004ddca40, 0x00007f981b567ee0)
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0001 p:---- s:0003 e:000002 (none) [FINISH]
-- C level backtrace information -------------------------------------------
=> #<Ractor:#3 (pry):5 terminated>
[4] pry(main)> /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_vm_bugreport+0x6cf) [0x103084d1f]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug_without_die+0x206) [0x102e9e2b6]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug+0x71) [0x103091e6b]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_thread_terminate_all+0x329) [0x10301e5b9]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ractor_terminate_all+0xa3) [0x102f8acc3]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ec_cleanup+0x229) [0x102ea9299]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(ruby_stop+0x9) [0x102ea9509]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_2+0x8ce) [0x103027fce]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_1+0x10d) [0x10302753d]
/usr/lib/system/libsystem_pthread.dylib(_pthread_start+0xe0) [0x7fff20382950]
---Files--------------------------------
ruby_2021-01-06-104315_phillip-muldoon-FA588.crash (31.8 KB)
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ruby-core:114536] [Ruby master Bug#17516] forking in a ractor causes Ruby to crash
2021-01-06 10:56 [ruby-core:101952] [Ruby master Bug#17516] forking in a ractor causes Ruby to crash pkmuldoon
` (3 preceding siblings ...)
2021-11-30 5:26 ` [ruby-core:106325] " hsbt (Hiroshi SHIBATA)
@ 2023-08-25 14:33 ` jeremyevans0 (Jeremy Evans) via ruby-core
4 siblings, 0 replies; 6+ messages in thread
From: jeremyevans0 (Jeremy Evans) via ruby-core @ 2023-08-25 14:33 UTC (permalink / raw)
To: ruby-core; +Cc: jeremyevans0 (Jeremy Evans)
Issue #17516 has been updated by jeremyevans0 (Jeremy Evans).
I submitted a pull request to disallow fork from inside a ractor: https://github.com/ruby/ruby/pull/8283
----------------------------------------
Bug #17516: forking in a ractor causes Ruby to crash
https://bugs.ruby-lang.org/issues/17516#change-104338
* Author: pkmuldoon (Phil Muldoon)
* Status: Assigned
* Priority: Normal
* Assignee: ko1 (Koichi Sasada)
* ruby -v: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
I just want to point out, there's absolutely no reason to do this, but
r = Ractor.new do
Process.fork()
end
Will cause:
<internal:ractor>:267: warning: Ractor is experimental, and the behavior may change in future versions of Ruby! Also there are many implementation issues.
[BUG] rb_thread_terminate_all: called by child thread (0x0000700004ddca40, 0x00007f981b567ee0)
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]
-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
for more details.
Don't forget to include the above Crash Report log file in bug reports.
-- Control frame information -----------------------------------------------
c:0001 p:---- s:0003 e:000002 (none) [FINISH]
-- C level backtrace information -------------------------------------------
=> #<Ractor:#3 (pry):5 terminated>
[4] pry(main)> /Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_vm_bugreport+0x6cf) [0x103084d1f]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug_without_die+0x206) [0x102e9e2b6]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_bug+0x71) [0x103091e6b]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_thread_terminate_all+0x329) [0x10301e5b9]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ractor_terminate_all+0xa3) [0x102f8acc3]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(rb_ec_cleanup+0x229) [0x102ea9299]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(ruby_stop+0x9) [0x102ea9509]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_2+0x8ce) [0x103027fce]
/Users/phillipmuldoon/.rubies/ruby-3.0.0/bin/ruby(thread_start_func_1+0x10d) [0x10302753d]
/usr/lib/system/libsystem_pthread.dylib(_pthread_start+0xe0) [0x7fff20382950]
---Files--------------------------------
ruby_2021-01-06-104315_phillip-muldoon-FA588.crash (31.8 KB)
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-08-25 14:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-06 10:56 [ruby-core:101952] [Ruby master Bug#17516] forking in a ractor causes Ruby to crash pkmuldoon
2021-01-06 11:10 ` [ruby-core:101953] " pkmuldoon
2021-01-06 14:51 ` [ruby-core:101958] " shyouhei
2021-01-07 16:27 ` [ruby-core:101975] " pkmuldoon
2021-11-30 5:26 ` [ruby-core:106325] " hsbt (Hiroshi SHIBATA)
2023-08-25 14:33 ` [ruby-core:114536] " jeremyevans0 (Jeremy Evans) via ruby-core
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).