79677 Commits

Author SHA1 Message Date
KJ Tsanaktsidis
082962e857 Work around a hang in fork(2) on FreeBSD
See bug https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271490

On FreeBSDk, it's possible for fork(2) in a multithreaded process to
hang because of a bug in the lock handling of the dynamic linker. This
is now fixed on FreeBSD master, but it would be good if we could work
around it for Ruby CI which is running 13.1.

Setting LD_BIND_NOW seems to work around the problem (probably because
the dynamic linker doesn't then need to resolve anything through the PLT
when it's first called).
2023-08-30 20:47:39 +01:00
Kevin Newton
1ed70eb99f [ruby/yarp] Fix unused variable in YARPRubyAPITest
https://github.com/ruby/yarp/commit/0556f971ce
2023-08-30 19:20:21 +00:00
Kevin Newton
49dff732e8
Update YARP APIs to handle uint8_t 2023-08-30 14:41:39 -04:00
Kevin Newton
7be08f3f58 [ruby/yarp] Switch from handling const char * to const uint8_t *
https://github.com/ruby/yarp/commit/465e7bb0a9
2023-08-30 14:41:23 -04:00
Kevin Newton
eac3da173a [ruby/yarp] Fix test-unit API in fuzzer test
https://github.com/ruby/yarp/commit/d24f62566e
2023-08-30 18:36:38 +00:00
Mike Dalessio
2d009805e7 [ruby/yarp] fix: comment followed by whitespace at end of file
Previously this resulted in invalid memory access.

Found by the fuzzer.

https://github.com/ruby/yarp/commit/b248553dd6
2023-08-30 18:27:52 +00:00
Mike Dalessio
ae7f907559 [ruby/yarp] fix: heredoc with incomplete escape at end of file
Previously this resulted in invalid memory access.

Found by the fuzzer.

https://github.com/ruby/yarp/commit/ec4abd87f4
2023-08-30 18:27:51 +00:00
Mike Dalessio
341f47a6dd [ruby/yarp] fix: incomplete escape in regex at the end of file
Previously this resulted in invalid memory access.

Found by the fuzzer.

https://github.com/ruby/yarp/commit/55b9dfb41c
2023-08-30 18:27:51 +00:00
Mike Dalessio
7cebb9b737 [ruby/yarp] fix: incomplete escape in list at the end of file
Previously this resulted in invalid memory access.

Found by the fuzzer.

https://github.com/ruby/yarp/commit/78ed75ed75
2023-08-30 18:27:51 +00:00
Mike Dalessio
46e47404a8 [ruby/yarp] fix: trailing decimal, binary, octal, and hex numbers at end of file
Previously this resulted in invalid memory access.

Found by the fuzzer.

https://github.com/ruby/yarp/commit/af5b85a27a
2023-08-30 18:27:50 +00:00
Mike Dalessio
c83552a596 [ruby/yarp] fix: trailing asterisk at end of file
Previously this resulted in invalid memory access.

Found by the fuzzer.

https://github.com/ruby/yarp/commit/c86b4907b4
2023-08-30 18:27:49 +00:00
Mike Dalessio
bd0268372e [ruby/yarp] fix: trailing comment at end of file
Previously this resulted in invalid memory access.

Found by the fuzzer.

https://github.com/ruby/yarp/commit/a1c9404906
2023-08-30 18:27:49 +00:00
Mike Dalessio
6f8126faeb [ruby/yarp] fix: string escape char "\" at the end of a file
Previously this resulted in invalid memory access.

Found by the fuzzer.

https://github.com/ruby/yarp/commit/178862e2ca
2023-08-30 18:27:48 +00:00
Mike Dalessio
476f38d62d [ruby/yarp] fix: ":" at the end of a file
Previously this resulted in invalid memory access.

Found by the fuzzer.

https://github.com/ruby/yarp/commit/c781c9fcd2
2023-08-30 18:27:48 +00:00
Mike Dalessio
3da139d284 [ruby/yarp] fix: "$" at the end of a file
Previously this resulted in invalid memory access as well as a
cascading failed assertion:

    src/enc/yp_unicode.c:2224: yp_utf_8_codepoint: Assertion `n >= 1' failed.

Found by the fuzzer.

https://github.com/ruby/yarp/commit/a34c534440
2023-08-30 18:27:47 +00:00
Mike Dalessio
440cdceffb [ruby/yarp] test: new test file for capturing interesting fuzzer snippets
Note that we call `YARP.dump` for these fuzzer tests to better match
the fuzz.parse harness, which also serializes.

https://github.com/ruby/yarp/commit/032ad047e9
2023-08-30 18:27:47 +00:00
Mike Dalessio
f652c05a59 [ruby/yarp] debug: ensure valgrind will work when calling YARP.dump
https://github.com/ruby/yarp/commit/deba3420d5
2023-08-30 18:27:47 +00:00
Takashi Kokubun
1edb03788d Stop using -v for rjit test-all
It outputs way too many lines. It's hard to download the output from
GitHub Actions.
2023-08-30 10:18:11 -07:00
Kevin Newton
c4998bc3f2 [ruby/yarp] Desugar ||= more accurately
Class variables, global variables, constants, and constant paths
should actually desugar to `defined?` instead of just reading the
value.

https://github.com/ruby/yarp/commit/551a59b876
2023-08-30 16:51:17 +00:00
Kevin Newton
06f54c9a8c
Fix merge error on ruby_api_test.rb 2023-08-30 12:43:56 -04:00
Kevin Newton
c5c0a3cf17 [ruby/yarp] Use assert_raise
https://github.com/ruby/yarp/commit/b85e01d77d
2023-08-30 16:10:25 +00:00
Nathan Froyd
9d8d2b81d2 [ruby/yarp] use a more idiomatic form of assert_raises
https://github.com/ruby/yarp/commit/687213d2e3
2023-08-30 16:10:25 +00:00
Nobuyoshi Nakada
c74039eec7
use assert_raise 2023-08-31 00:38:27 +09:00
Maxime Chevalier-Boisvert
e58fed128b
YJIT: shrink Context from 29 to 21 bytes by reducing space used by TempMapping (#8321)
* YJIT: merge tempmapping and temp types into a single-byte encoding

YJIT: refactor to shrink Context by 8 bytes

* Add tests, fix bug in TempMapping::map_to_local()

* Update yjit/src/core.rs

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>

* Update yjit/src/core.rs

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>

* Fewer transmutes where `as` would suffice. Also repr(u8)

* Update yjit/src/core.rs

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>

* Update yjit/src/core.rs

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>

* Update yjit/src/core.rs

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>

---------

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2023-08-30 11:14:51 -04:00
Nathan Froyd
c521b6f823 [ruby/yarp] add tests for Location#join
https://github.com/ruby/yarp/commit/b01711396f
2023-08-30 15:10:24 +00:00
Nobuyoshi Nakada
74f4d2683e
sync_default_gems.rb: Remove Java templates 2023-08-30 22:18:10 +09:00
git
00fdb4e12e Update default gems list at 36a3899e9d464e243648694fa28398 [ci skip] 2023-08-30 09:18:22 +00:00
Stan Lo
36a3899e9d [ruby/irb] Bump version to 1.8.0
(https://github.com/ruby/irb/pull/700)

https://github.com/ruby/irb/commit/a061744ed3
2023-08-30 09:17:06 +00:00
Jean Boussier
bcc905100f BasicSocket#recv* return nil rather than an empty packet
[Bug #19012]

man recvmsg(2) states:

> Return Value
> These calls return the number of bytes received, or -1 if an error occurred.
> The return value will be 0 when the peer has performed an orderly shutdown.

Not too sure how one is supposed to make the difference between a packet of
size 0 and a closed connection.
2023-08-30 10:07:18 +02:00
Nobuyoshi Nakada
acedbcb1b4
sync_default_gems.rb: Fix typo in replace_rdoc_ref_all 2023-08-30 15:00:00 +09:00
Nobuyoshi Nakada
c05737e09f
sync_default_gems.rb: Transform by proc 2023-08-30 14:59:17 +09:00
yui-knk
2e648bfee4 [DOC] Detailed explanation when one line pattern matching is a void value expression 2023-08-30 12:47:09 +09:00
git
a83152d4db Update bundled gems list at ad2a464e8fc6bd4daa5b20b3c69d94 [ci skip] 2023-08-30 02:11:23 +00:00
Soutaro Matsumoto
ad2a464e8f
Bundle RBS 3.2.1 (#8306) 2023-08-30 11:10:41 +09:00
Josh Nichols
e747e2c36b [rubygems/rubygems] Update bundler/lib/bundler/settings.rb
https://github.com/rubygems/rubygems/commit/75ffa8ef76

Co-authored-by: Martin Emde <martinemde@users.noreply.github.com>
2023-08-30 00:36:38 +00:00
Josh Nichols
6a876a61d7 [rubygems/rubygems] (Further) Improve Bundler::Settings#[] performance and memory usage
I previously identified and improved this method over in https://github.com/rubygems/rubygems/pull/6884
but while reviewing another memory_profiler profile, I realized another
gain we can eek out.

This method keeps comes up in part because `configs` is allocating a new
Hash every time. My last change took advantage of that by using `map!`
on it. `configs` is called quite often, including in this `[]` method,
so there's a benefit to memoizing it.

Back in `[]`, logically we are trying to find the first Hash in `configs`
that has a value for the given key. Currently, we end up `map` and
`compact` to just get that value.

Instead, we can use a loop over `configs`, and break when we find the
value for the key.

https://github.com/rubygems/rubygems/commit/b913cfc87b
2023-08-30 00:36:38 +00:00
Peter Zhu
27024004fa Fix string2cstr in lldb_cruby.py [ci skip] 2023-08-29 19:31:53 -04:00
Jemma Issroff
3151d7876f
[YARP] Until Node, minor cleanup (#8325)
* Remove conditional from yp_compile_if

* Extracted yp_compile_while, compile UntilNode

* Small checks for body / value that could be empty
2023-08-29 14:17:08 -07:00
Jemma Issroff
80dc570a45
Compile more YARP node types (#8322)
* Add several more node simple types to YARP's compiler:

Nodes include: DefinedNode, EmbeddedStatementsNode,
LocalVariableReadNode, LocalVariableWriteNode, MultiWriteNode,
OptionalParameterNode, SplatNode, YieldNode

* Add AssocSplatNode, RangeNode

* Add RangeNode, other helpers for future nodes

* Add ArrayNode, HashNode, static literal helpers

* Add branch conditionals

* Add IfNode, UnlessNode

* Add ScopeNode

* NEW_ISEQ and NEW_CHILD_ISEQ implemented for YARP

* Add nodes that depend on ScopeNode

* Addressed PR comments
2023-08-29 13:13:15 -07:00
Kevin Newton
b435161404 [ruby/yarp] Add instance variable names to the constant pool
https://github.com/ruby/yarp/commit/f049932c44
2023-08-29 20:12:57 +00:00
Kevin Newton
455153705c Tests for the YARP compiler 2023-08-29 15:53:25 -04:00
Kevin Newton
5161c6c4cd [ruby/yarp] Statements inside ensure blocks can accept blocks
https://github.com/ruby/yarp/commit/be84ea5343
2023-08-29 19:33:31 +00:00
Samuel Giddins
7a5df9d0ed [rubygems/rubygems] Fix bundle update --redownload
It now does the redownloading/installing just like bundle install --redownload

https://github.com/rubygems/rubygems/commit/3b058e5eca
2023-08-29 19:31:36 +00:00
Stan Lo
f37f357e80 [ruby/irb] Improve help/show_cmds message during debugger
integration
(https://github.com/ruby/irb/pull/693)

* `help` should display debugger's help during irb:rdbg session

* Update `show_cmds`'s output when in irb:rdbg session

https://github.com/ruby/irb/commit/4029c2e564
2023-08-29 18:36:16 +00:00
ima1zumi
c58561b5e3 [ruby/reline] Remove ARGV.first in east_asian_width.rb
(https://github.com/ruby/reline/pull/587)

`ARGV.first` is the name of the EastAsianWidth file and is not needed for east_asian_width.rb

https://github.com/ruby/reline/commit/6649bda31c
2023-08-29 17:55:02 +00:00
elfham
95efdef3b2 [ruby/reline] Set EastAsianWidth::UNICODE_VERSION
(https://github.com/ruby/reline/pull/586)

* Set EastAsianWidth::UNICODE_VERSION

* Commented out UNICODE_VERSION in Reline::Unicode::EastAsianWidth

* Commented out UNICODE_VERSION in Reline::Unicode::EastAsianWidth

https://github.com/ruby/reline/commit/6d94f2a26a
2023-08-29 17:20:18 +00:00
Jemma Issroff
535045ab3b
[YARP] Compile basic types (#8311)
* Add a compile_context arg to yp_compile_node

The compile_context will allow us to pass around the parser, and
the constants and lookup table (to be used in future commits).

* Compile yp_program_node_t and yp_statements_node_t

Add the compilation for program and statements node so that we can
successfully compile an empty program with YARP.

* Helper functions for parsing numbers, strings, and symbols

* Compile basic numeric / boolean node types in YARP

* Compile StringNode and SymbolNodes in YARP

* Compile several basic node types in YARP

* Added error return for missing node
2023-08-29 09:27:00 -07:00
Nathan Froyd
36e210718c [ruby/yarp] simplify context_pop
https://github.com/ruby/yarp/commit/fe85b595b6
2023-08-29 15:36:21 +00:00
tomoya ishida
062eec7558 [ruby/irb] Add --nomultiline indent and prompt test
(https://github.com/ruby/irb/pull/699)

https://github.com/ruby/irb/commit/9b4aea753b
2023-08-29 15:34:49 +00:00
Chad Schroeder
51e7fb5331 [ruby/irb] fixes https://github.com/ruby/irb/pull/524
(https://github.com/ruby/irb/pull/696)

https://github.com/ruby/irb/commit/59bcc07def
2023-08-29 13:10:35 +00:00