[ruby-core:114568] [Ruby master Bug#19853] Segfault when calling `system` from a non-blocking fiber

Issue #19853 has been reported by rmosolgo (Robert Mosolgo). ---------------------------------------- Bug #19853: Segfault when calling `system` from a non-blocking fiber https://bugs.ruby-lang.org/issues/19853 * Author: rmosolgo (Robert Mosolgo) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin22] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Hi! I'm trying to improve my Ruby library to support transfer-based fibers (https://github.com/rmosolgo/graphql-ruby/pull/4322). To test parallel I/O, I'm using `system("sleep #{duration}")`, but this causes a segfault sometimes. I'd love to find a way to keep developing this feature but I'm not sure where to go next. I have attached a script which replicates the bug and I have attached the full segfault error dump. I encountered this error by running: ``` ruby fiber_bug.rb 2>out.txt ``` Does that help debug? Please let me know if I can provide anything else that'd be helpful. ---Files-------------------------------- out.txt (121 KB) fiber_bug.rb (624 Bytes) -- https://bugs.ruby-lang.org/

Issue #19853 has been updated by ioquatix (Samuel Williams). Assignee set to ioquatix (Samuel Williams) Thanks, I'll take a look. ---------------------------------------- Bug #19853: Segfault when calling `system` from a non-blocking fiber https://bugs.ruby-lang.org/issues/19853#change-104382 * Author: rmosolgo (Robert Mosolgo) * Status: Open * Priority: Normal * Assignee: ioquatix (Samuel Williams) * ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin22] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Hi! I'm trying to improve my Ruby library to support transfer-based fibers (https://github.com/rmosolgo/graphql-ruby/pull/4322). To test parallel I/O, I'm using `system("sleep #{duration}")`, but this causes a segfault sometimes. I'd love to find a way to keep developing this feature but I'm not sure where to go next. I have attached a script which replicates the bug and I have attached the full segfault error dump. I encountered this error by running: ``` ruby fiber_bug.rb 2>out.txt ``` Does that help debug? Please let me know if I can provide anything else that'd be helpful. ---Files-------------------------------- out.txt (121 KB) fiber_bug.rb (624 Bytes) -- https://bugs.ruby-lang.org/

Issue #19853 has been updated by ioquatix (Samuel Williams). I could reproduce the error with the native backends, but not the pure Ruby backend. That means it's a bug with `io-event` gem. I'll probably move the issue there once I have time to investigate fully. ```
IO_EVENT_SELECTOR=Select ./test.rb Starting... {"data"=>{"v1"=>0.5, "v2"=>0.5}} Ended [:duration, 0.603101918]
Using a native selector fails with a segfault.
----------------------------------------
Bug #19853: Segfault when calling `system` from a non-blocking fiber
https://bugs.ruby-lang.org/issues/19853#change-104385
* Author: rmosolgo (Robert Mosolgo)
* Status: Open
* Priority: Normal
* Assignee: ioquatix (Samuel Williams)
* ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin22]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
Hi! I'm trying to improve my Ruby library to support transfer-based fibers (https://github.com/rmosolgo/graphql-ruby/pull/4322). To test parallel I/O, I'm using `system("sleep #{duration}")`, but this causes a segfault sometimes. I'd love to find a way to keep developing this feature but I'm not sure where to go next.
I have attached a script which replicates the bug and I have attached the full segfault error dump. I encountered this error by running:
ruby fiber_bug.rb 2>out.txt ``` Does that help debug? Please let me know if I can provide anything else that'd be helpful. ---Files-------------------------------- out.txt (121 KB) fiber_bug.rb (624 Bytes) -- https://bugs.ruby-lang.org/

Issue #19853 has been updated by ioquatix (Samuel Williams). https://github.com/ruby/ruby/pull/8315 fixes the segfault and turns it into a `TypeError`. ---------------------------------------- Bug #19853: Segfault when calling `system` from a non-blocking fiber https://bugs.ruby-lang.org/issues/19853#change-104391 * Author: rmosolgo (Robert Mosolgo) * Status: Open * Priority: Normal * Assignee: ioquatix (Samuel Williams) * ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin22] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- Hi! I'm trying to improve my Ruby library to support transfer-based fibers (https://github.com/rmosolgo/graphql-ruby/pull/4322). To test parallel I/O, I'm using `system("sleep #{duration}")`, but this causes a segfault sometimes. I'd love to find a way to keep developing this feature but I'm not sure where to go next. I have attached a script which replicates the bug and I have attached the full segfault error dump. I encountered this error by running: ``` ruby fiber_bug.rb 2>out.txt ``` Does that help debug? Please let me know if I can provide anything else that'd be helpful. ---Files-------------------------------- out.txt (121 KB) fiber_bug.rb (624 Bytes) -- https://bugs.ruby-lang.org/

Issue #19853 has been updated by ioquatix (Samuel Williams). Status changed from Open to Closed Backport changed from 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 3.0: DONTNEED, 3.1: REQUIRED, 3.2: REQUIRED Merged in https://github.com/ruby/ruby/commit/901b6d9c5025a30b3d7a5ed0a2c00baf9cfb061d ---------------------------------------- Bug #19853: Segfault when calling `system` from a non-blocking fiber https://bugs.ruby-lang.org/issues/19853#change-104401 * Author: rmosolgo (Robert Mosolgo) * Status: Closed * Priority: Normal * Assignee: ioquatix (Samuel Williams) * ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin22] * Backport: 3.0: DONTNEED, 3.1: REQUIRED, 3.2: REQUIRED ---------------------------------------- Hi! I'm trying to improve my Ruby library to support transfer-based fibers (https://github.com/rmosolgo/graphql-ruby/pull/4322). To test parallel I/O, I'm using `system("sleep #{duration}")`, but this causes a segfault sometimes. I'd love to find a way to keep developing this feature but I'm not sure where to go next. I have attached a script which replicates the bug and I have attached the full segfault error dump. I encountered this error by running: ``` ruby fiber_bug.rb 2>out.txt ``` Does that help debug? Please let me know if I can provide anything else that'd be helpful. ---Files-------------------------------- out.txt (121 KB) fiber_bug.rb (624 Bytes) -- https://bugs.ruby-lang.org/

Issue #19853 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 3.0: DONTNEED, 3.1: REQUIRED, 3.2: REQUIRED to 3.0: DONTNEED, 3.1: REQUIRED, 3.2: DONE ruby_3_2 9cd28caa7cc3b0d987db7c1231fe101fb3b27399 merged revision(s) 901b6d9c5025a30b3d7a5ed0a2c00baf9cfb061d. ---------------------------------------- Bug #19853: Segfault when calling `system` from a non-blocking fiber https://bugs.ruby-lang.org/issues/19853#change-104750 * Author: rmosolgo (Robert Mosolgo) * Status: Closed * Priority: Normal * Assignee: ioquatix (Samuel Williams) * ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-darwin22] * Backport: 3.0: DONTNEED, 3.1: REQUIRED, 3.2: DONE ---------------------------------------- Hi! I'm trying to improve my Ruby library to support transfer-based fibers (https://github.com/rmosolgo/graphql-ruby/pull/4322). To test parallel I/O, I'm using `system("sleep #{duration}")`, but this causes a segfault sometimes. I'd love to find a way to keep developing this feature but I'm not sure where to go next. I have attached a script which replicates the bug and I have attached the full segfault error dump. I encountered this error by running: ``` ruby fiber_bug.rb 2>out.txt ``` Does that help debug? Please let me know if I can provide anything else that'd be helpful. ---Files-------------------------------- out.txt (121 KB) fiber_bug.rb (624 Bytes) -- https://bugs.ruby-lang.org/
participants (3)
-
ioquatix (Samuel Williams)
-
nagachika (Tomoyuki Chikanaga)
-
rmosolgo (Robert Mosolgo)