Project

General

Profile

Actions

Bug #20933

closed

Unexpected IO::Buffer::MaskError in IO::Buffer#xor!

Added by agitter (Alexander Gitter) 22 days ago. Updated 19 days ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.4.0dev (2024-12-06T12:47:35Z master 78614ee900) +PRISM [x86_64-linux]
[ruby-core:120120]

Description

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.

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0