[#108771] [Ruby master Bug#18816] Ractor segfaulting MacOS 12.4 (aarch64 / M1 processor) — "brodock (Gabriel Mazetto)" <noreply@...>

Issue #18816 has been reported by brodock (Gabriel Mazetto).

8 messages 2022/06/05

[#108802] [Ruby master Feature#18821] Expose Pattern Matching interfaces in core classes — "baweaver (Brandon Weaver)" <noreply@...>

Issue #18821 has been reported by baweaver (Brandon Weaver).

9 messages 2022/06/08

[#108822] [Ruby master Feature#18822] Ruby lack a proper method to percent-encode strings for URIs (RFC 3986) — "byroot (Jean Boussier)" <noreply@...>

Issue #18822 has been reported by byroot (Jean Boussier).

18 messages 2022/06/09

[#108937] [Ruby master Bug#18832] Suspicious superclass mismatch — "fxn (Xavier Noria)" <noreply@...>

Issue #18832 has been reported by fxn (Xavier Noria).

16 messages 2022/06/15

[#108976] [Ruby master Misc#18836] DevMeeting-2022-07-21 — "mame (Yusuke Endoh)" <noreply@...>

Issue #18836 has been reported by mame (Yusuke Endoh).

12 messages 2022/06/17

[#109043] [Ruby master Bug#18876] OpenSSL is not available with `--with-openssl-dir` — "Gloomy_meng (Gloomy Meng)" <noreply@...>

Issue #18876 has been reported by Gloomy_meng (Gloomy Meng).

18 messages 2022/06/23

[#109052] [Ruby master Bug#18878] parse.y: Foo::Bar {} is inconsistently rejected — "qnighy (Masaki Hara)" <noreply@...>

Issue #18878 has been reported by qnighy (Masaki Hara).

9 messages 2022/06/26

[#109055] [Ruby master Bug#18881] IO#read_nonblock raises IOError when called following buffered character IO — "javanthropus (Jeremy Bopp)" <noreply@...>

Issue #18881 has been reported by javanthropus (Jeremy Bopp).

9 messages 2022/06/26

[#109063] [Ruby master Bug#18882] File.read cuts off a text file with special characters when reading it on MS Windows — magynhard <noreply@...>

Issue #18882 has been reported by magynhard (Matth辰us Johannes Beyrle).

15 messages 2022/06/27

[#109081] [Ruby master Feature#18885] Long lived fork advisory API (potential Copy on Write optimizations) — "byroot (Jean Boussier)" <noreply@...>

Issue #18885 has been reported by byroot (Jean Boussier).

23 messages 2022/06/28

[#109083] [Ruby master Bug#18886] Struct aref and aset don't trigger any tracepoints. — "ioquatix (Samuel Williams)" <noreply@...>

Issue #18886 has been reported by ioquatix (Samuel Williams).

8 messages 2022/06/29

[#109095] [Ruby master Misc#18888] Migrate ruby-lang.org mail services to Google Domains and Google Workspace — "shugo (Shugo Maeda)" <noreply@...>

Issue #18888 has been reported by shugo (Shugo Maeda).

16 messages 2022/06/30

[ruby-core:108916] [Ruby master Bug#18829] GC_COMPACTION_SUPPORTED macro should be set and detected automatically.

From: "jeremyevans0 (Jeremy Evans)" <noreply@...>
Date: 2022-06-14 19:54:13 UTC
List: ruby-core #108916
Issue #18829 has been updated by jeremyevans0 (Jeremy Evans).

Backport changed from 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN to 2.7: DONTNEED, 3.0: REQUIRED, 3.1: REQUIRED
Status changed from Open to Closed

Since this problem does not occur in the master branch (due to the increased page size), it seems like the bug has already been fixed/worked around.  It seems unlikely we would backport the increased page size to older Ruby versions, and we don't generally apply patches to release branches that are not backported from master (it only happens in exceptional cases, and this case doesn't appear to warrant it).

I'm marking this for backport to supported versions, but the odds of a fix being backported without you providing a patch seem low.  Even with a patch, it would be up to the branch maintainer whether to apply it.

Another possibility would be adding a patch to the master branch for this, and then asking for that patch to be backported, but if this is no longer an issue in the master branch due to the increased page size, I would be against applying such a patch.

----------------------------------------
Bug #18829: GC_COMPACTION_SUPPORTED macro should be set and detected automatically.
https://bugs.ruby-lang.org/issues/18829#change-98001

* Author: jprokop (Jarek Prokop)
* Status: Closed
* Priority: Normal
* ruby -v: ruby 3.2.0dev (2022-06-14T01:21:55Z master 048f14221c) [powerpc64le-linux]
* Backport: 2.7: DONTNEED, 3.0: REQUIRED, 3.1: REQUIRED
----------------------------------------
After backporting the patch [0] for GC compaction support from https://github.com/ruby/ruby/pull/5934 (for bug https://bugs.ruby-lang.org/issues/18779), I found that there is no mechanism to automatically define the GC_COMPACTION_SUPPORTED based on the platform.

This does not seem to be a major issue with the Ruby master branch as the Ruby GC page size is bumped up to 64K so platforms like ppc64le do not struggle anymore, however, if the Ruby GC page size is set to 16K as is the case with Ruby 3.1 for example, then the compaction is enabled even in cases when it should not be.

For master I can reach a failure if I set the Ruby GC page size to 16K by editing macro in gc.c (https://github.com/ruby/ruby/blob/master/gc.c#L863) to:
``` c
#define HEAP_PAGE_ALIGN_LOG 14
```

As there are no compile-time checks around this, after compiling ruby and using the following script I get an exception.
script:
``` ruby
if GC.respond_to?(:compact)
  GC.verify_compaction_references(double_heap: true, toward: :empty)
end

100_000.times do |i|
  puts "i: #{i}, count: #{count}"
end
```

Running it raises an exception even though the code is in a guard clause that should prevent this:
```
~/.rubies/ruby-master/bin/ruby ./reproducer.rb 
<internal:gc>:251:in `verify_compaction_references': Compaction isn't available on this platform (NotImplementedError)
	from ./reproducer.rb:4:in `<main>'
```

Right now, our workaround is to define the macro `GC_COMPACTION_SUPPORTED` only on platforms that we know do support compaction. Ideally, this should not be required and the configuration script or the gc.c file should take care of defining the macro correctly.

[0] https://src.fedoraproject.org/fork/jackorp/rpms/ruby/blob/1e34def591d4615bde83a28ff6cd336aa5879a80/f/ruby-3.2.0-define-unsupported-gc-compaction-methods-as-rb_f_notimplement.patch



-- 
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