[#102393] [Ruby master Feature#17608] Compact and sum in one step — sawadatsuyoshi@...

Issue #17608 has been reported by sawa (Tsuyoshi Sawada).

13 messages 2021/02/04

[#102438] [Ruby master Bug#17619] if false foo=42; end creates a foo local variable set to nil — pkmuldoon@...

Issue #17619 has been reported by pkmuldoon (Phil Muldoon).

10 messages 2021/02/10

[#102631] [Ruby master Feature#17660] Expose information about which basic methods have been redefined — tenderlove@...

Issue #17660 has been reported by tenderlovemaking (Aaron Patterson).

9 messages 2021/02/27

[#102639] [Ruby master Misc#17662] The herdoc pattern used in tests does not syntax highlight correctly in many editors — eregontp@...

Issue #17662 has been reported by Eregon (Benoit Daloze).

13 messages 2021/02/27

[#102652] [Ruby master Bug#17664] Behavior of sockets changed in Ruby 3.0 to non-blocking — ciconia@...

Issue #17664 has been reported by ciconia (Sharon Rosner).

23 messages 2021/02/28

[ruby-core:102630] [Ruby master Bug#17652] GC compaction crash on mprotect

From: xtkoba+ruby@...
Date: 2021-02-27 00:15:37 UTC
List: ruby-core #102630
Issue #17652 has been updated by xtkoba (Tee KOBAYASHI).

File ruby-cygwin-rb_aligned_malloc.patch added

It seems that the `addr` argument for Cygwin's `munmap(2)` must be aligned to 64KB boundaries. A patch is attached to conform to this.

----------------------------------------
Bug #17652: GC compaction crash on mprotect
https://bugs.ruby-lang.org/issues/17652#change-90624

* Author: peterzhu2118 (Peter Zhu)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
# GitHub PR: ~~https://github.com/ruby/ruby/pull/4221~~ https://github.com/ruby/ruby/pull/4227

# Issue

GC compaction will crash on some pages due to a failing `mprotect` call. According to the `mprotect` documentation:

> POSIX says that the behavior of mprotect() is unspecified if it is applied to a region of memory that was not obtained via mmap(2).

This causes `mprotect` to sometimes fail.

# Reproduction

```ruby
GC.auto_compact = true

times = 20_000_000
arr = Array.new(times)
times.times do |i|
  arr[i] = "#{i}"
end

arr = Array.new(1_000_000, 42)
GC.start

puts "ok"
```

# Expected output

Program runs and prints "ok".

# Actual output

Crashes on Ubuntu 18.04. See `crash.log` for the crash log (note that the log file has been truncated because it's too big).


---Files--------------------------------
crash.log (6.26 KB)
ruby-cygwin-rb_aligned_malloc.patch (840 Bytes)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread