* got rid of inadvertent label lists.
* marked up resolve_feature_path method names.
* fixed indentation of UnboundMethod#bind_call and marked up as
RDoc.
It's unlikely anyone would actually hit these. The methods are
private, you only hit this code path if calling these methods
before performing the SSL connection, and there is already a
verbose warning issued.
Fixes#2290.
1. `Gem::Specification.date` returns SOURCE_DATE_EPOCH when defined,
2. this commit makes RubyGems set it _persistently_ when not provided.
This combination means that you can build a gem, check the build time,
and use that value to generate a new build -- and then verify they're
the same.
https://github.com/rubygems/rubygems/commit/d830d53f59
for all compilations and compaction.
Prior to this commit, the last-compiled code has not been used because
MJIT worker is stopped before setting the code, and compaction has also
been skipped.
But it was not intentional and `wait: true` pause should wait until
those two things by its feature.
Since the introduction of STR_SHARED_ROOT, the word "shared"
has become very overloaded with respect to String's internal
states. Use a different name for STR_IS_SHARED_M and explain
its purpose.
The buffer deduplication codepath in rb_fstring can be used to free the buffer
of shared string roots, which leads to use-after-free.
Introudce a new flag to tag strings that at one point have been a shared root.
Check for it in rb_fstring to avoid freeing buffers that are shared by
multiple strings. This change is based on nobu's idea in [ruby-core:94838].
The included test case test for the sequence of calls to internal functions
that lead to this bug. See attached ticket for Ruby level repros.
[Bug #16151]
GCC emits a lot of false positives for rb_scan_args because:
* `rb_scan_args(argc, argv, "*:", NULL, &opts);` makes `n_mand == 0`,
* `n_mand == argc + 1` implies `argc == -1`, and
* `memcpy(ptr, argv, sizeof(VALUE)*argc);` explodes
However, we know that argc is never so big, thus this is a false
positive. This change suppresses it by adding a condition `n_mand > 0`.
```
In file included from /usr/include/string.h:494,
from ./include/ruby/defines.h:145,
from ./include/ruby/ruby.h:29,
from ./include/ruby/encoding.h:27,
from dir.c:14:
In function 'memcpy',
inlined from 'ruby_nonempty_memcpy.part.0' at ./include/ruby/ruby.h:1763:17,
inlined from 'ruby_nonempty_memcpy' at ./include/ruby/ruby.h:1760:1,
inlined from 'rb_scan_args_set' at ./include/ruby/ruby.h:2594:9,
inlined from 'dir_s_aref' at dir.c:2774:12:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning: '__builtin___memcpy_chk' pointer overflow between offset 0 and size [-8, 9223372036854775807] [-Warray-bounds]
return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:10: warning:
'__builtin___memcpy_chk' specified size 18446744073709551608 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
```