[ruby-core:120120] [Ruby master Bug#20933] Unexpected IO::Buffer::MaskError in IO::Buffer#xor!

Issue #20933 has been reported by agitter (Alexander Gitter). ---------------------------------------- Bug #20933: Unexpected IO::Buffer::MaskError in IO::Buffer#xor! https://bugs.ruby-lang.org/issues/20933 * Author: agitter (Alexander Gitter) * Status: Open * ruby -v: ruby 3.4.0dev (2024-12-06T12:47:35Z master 78614ee900) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- The following script raises `Mask overlaps source buffer! (IO::Buffer::MaskError)` most of the time when running it on my Ubuntu 24.04 machine. "Most of the time" means this sometimes (20% - 30%) works without issue. ```ruby a = IO::Buffer.new(1024 * 1024) b = IO::Buffer.new(1024 * 1024) a = IO::Buffer.new(1024 * 1024) # Removing this line makes this work much more reliably a.xor!(b) ``` I'm guessing this is somehow related to these being `MAPPED` buffers - reducing the sizes to 1024 bytes also fixes the problem. -- https://bugs.ruby-lang.org/

Issue #20933 has been updated by peterzhu2118 (Peter Zhu). Thank you for this bug report. I have a fix here: https://github.com/ruby/ruby/pull/12284 ---------------------------------------- Bug #20933: Unexpected IO::Buffer::MaskError in IO::Buffer#xor! https://bugs.ruby-lang.org/issues/20933#change-110874 * Author: agitter (Alexander Gitter) * Status: Open * ruby -v: ruby 3.4.0dev (2024-12-06T12:47:35Z master 78614ee900) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- The following script raises `Mask overlaps source buffer! (IO::Buffer::MaskError)` most of the time when running it on my Ubuntu 24.04 machine. "Most of the time" means this sometimes (20% - 30%) works without issue. ```ruby a = IO::Buffer.new(1024 * 1024) b = IO::Buffer.new(1024 * 1024) a = IO::Buffer.new(1024 * 1024) # Removing this line makes this work much more reliably a.xor!(b) ``` I'm guessing this is somehow related to these being `MAPPED` buffers - reducing the sizes to 1024 bytes also fixes the problem. -- https://bugs.ruby-lang.org/

Issue #20933 has been updated by agitter (Alexander Gitter). I just gave your branch a quick test and can confirm it fixes this issue. Thank you! ---------------------------------------- Bug #20933: Unexpected IO::Buffer::MaskError in IO::Buffer#xor! https://bugs.ruby-lang.org/issues/20933#change-110878 * Author: agitter (Alexander Gitter) * Status: Open * ruby -v: ruby 3.4.0dev (2024-12-06T12:47:35Z master 78614ee900) +PRISM [x86_64-linux] * Backport: 3.1: UNKNOWN, 3.2: UNKNOWN, 3.3: UNKNOWN ---------------------------------------- The following script raises `Mask overlaps source buffer! (IO::Buffer::MaskError)` most of the time when running it on my Ubuntu 24.04 machine. "Most of the time" means this sometimes (20% - 30%) works without issue. ```ruby a = IO::Buffer.new(1024 * 1024) b = IO::Buffer.new(1024 * 1024) a = IO::Buffer.new(1024 * 1024) # Removing this line makes this work much more reliably a.xor!(b) ``` I'm guessing this is somehow related to these being `MAPPED` buffers - reducing the sizes to 1024 bytes also fixes the problem. -- https://bugs.ruby-lang.org/
participants (2)
-
agitter (Alexander Gitter)
-
peterzhu2118 (Peter Zhu)