summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2 daysSkip some broken tests with mingw platformHiroshi SHIBATA
2025-10-07Truncate x-oauth-basic strings from tests of rubygemsHiroshi SHIBATA
2025-10-07Merge URI-0.12.5Hiroshi SHIBATA
2025-07-09Bump up resolv-0.2.3 for Ruby 3.2Hiroshi SHIBATA
2025-04-04Use EnvUtil.apply_timeout_scaleHiroshi SHIBATA
2025-04-04Extend open_timeout for test failure on s390xHiroshi SHIBATA
https://rubyci.s3.amazonaws.com/s390x/ruby-master/log/20250403T060004Z.fail.html.gz
2025-04-03Followed up 7c400c66c9Hiroshi SHIBATA
2025-04-03Use IPv4 for test server because TestNetHTTPS is failing with s390xHiroshi SHIBATA
https://rubyci.s3.amazonaws.com/s390x/ruby-3.2/log/20250403T005659Z.fail.html.gz
2025-04-02[rubygems/rubygems] Bump up minimum required version for cmake 4Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/3e77caeddf
2025-03-13merge revision(s) da4464b824857d7610f9865ceb452ce0ead49164: [Backport #19426]Hiroshi SHIBATA
[Bug #19426] Fix endless `Range#step` with `#succ` method
2025-03-13merge revision(s) 79eb75a8dd64848f23e9efc465f06326b5d4b680: [Backport #20025]Hiroshi SHIBATA
[Bug #20025] Check if upper/lower before fallback to case-folding
2025-03-13merge revision(s) 08b3a45bc97c835b4677bf76dbce68fd51d81897: [Backport #21180]Hiroshi SHIBATA
Push a real iseq in rb_vm_push_frame_fname() Previously, vm_make_env_each() (used during proc creation and for the debug inspector C API) picked up the non-GC-allocated iseq that rb_vm_push_frame_fname() creates, which led to a SEGV when the GC tried to mark the non GC object. Put a real iseq imemo instead. Speed should be about the same since the old code also did a imemo allocation and a malloc allocation. Real iseq allows ironing out the special-casing of dummy frames in rb_execution_context_mark() and rb_execution_context_update(). A check is added to RubyVM::ISeq#eval, though, to stop attempts to run dummy iseqs. [Bug #21180] Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2025-03-13it is not working with Ruby 3.2Hiroshi SHIBATA
2025-03-13Merge strscan-3.0.7Hiroshi SHIBATA
2025-03-13merge revision(s) f423f6e10c0c226dfed98e7cb7a5d489191dfa35: [Backport #21131]Hiroshi SHIBATA
Ensure IO.copy_stream buffer is an independent string Otherwise, changes to the buffer by the destination write method could result in data changing for supposedly independent strings. Fixes [Bug #21131]
2025-03-06Replace tombstone when converting AR to ST hashJohn Hawthorn
[Bug #21170] st_table reserves -1 as a special hash value to indicate that an entry has been deleted. So that that's a valid value to be returned from the hash function, do_hash replaces -1 with 0 so that it is not mistaken for the sentinel. Previously, when upgrading an AR table to an ST table, rb_st_add_direct_with_hash was used which did not perform the same conversion, this could lead to a hash in a broken state where one if its entries which was supposed to exist being marked as a tombstone. The hash could then become further corrupted when the ST table required resizing as the falsely tombstoned entry would be skipped but it would be counted in num entries, leading to an uninitialized entry at index 15. In most cases this will be really rare, unless using a very poorly implemented custom hash function. This also adds two debug assertions, one that st_add_direct_with_hash does not receive the reserved hash value, and a second in rebuild_table_with, which ensures that after we rebuild/compact a table it contains the expected number of elements. Co-authored-by: Alan Wu <alanwu@ruby-lang.org>
2025-02-26Merge cgi-0.3.7Hiroshi SHIBATA
2025-02-26Merge uri-0.12.4Hiroshi SHIBATA
2025-01-25merge revision(s) e0d600ec190c64aff76cfcbd6009cffb927da166: [Backport #21012]nagachika
Avoid opt_aset_with optimization inside multiple assignment Previously, since the opt_aset_with optimization was introduced, use of the opt_aset_with optimization inside multiple assignment would result in a segfault or incorrect instructions. Fixes [Bug #21012] Co-authored-by: Nobuyoshi Nakada <nobu.nakada@gmail.com>
2025-01-11merge revision(s) b176d4f52e4af67654814dab3e9c5f4bf9170e54: [Backport #21008]nagachika
[Bug #21008] Normalize before sum to float After switching to `Float`-mode when summing `Numeric` objects, normalization for `Float` is still needed.
2025-01-11merge revision(s) 8034e9c3d001ca3dff124ab42972684eac8af2ae: [Backport #20995]nagachika
[Bug #20995] Protect `IO.popen` block from exiting by exception
2025-01-11merge revision(s) 19c39e4cfaa467e69b9848c9c5496d7f50d39c7f, ↵nagachika
d78ff6a767ca813ac5fa178dd7611f20a993c191: [Backport #20984] [Bug #20984] ENV.inspect should be encoding aware [Bug #20984] Fix test with locale encoding
2024-12-15merge revision(s) e90b447655dd39ad1eb645cdaae450efd605db00: [Backport #20924]nagachika
[Bug #20924] Fix reading with delimiter in wide character encodings
2024-12-15merge revision(s) 660b995365f719fa59ed6f2809bb1527e6470d14: [Backport #20915]nagachika
[Bug #20915] Fix SEGV with `TracePoint#parameters` and aliased C method The following snippet results with a SEGV: ```ruby C = Class.new do alias_method :new_to_s, :to_s end TracePoint.new(:c_call, &:parameters).enable { C.new.new_to_s } ``` at MRI 3.3.6 and ruby 3.4.0dev The root cause of the issue lies in the `rb_tracearg_parameters` function within the `RUBY_EVENT_C_RETURN` branch. Specifically, when the invoked method is an alias for a C function, `rb_method_entry_without_refinements(..., trace_arg->called_id, ...)` may return NULL. In that case we can fallback to `trace_arg->id`.
2024-11-30merge revision(s) 02b70256b5171d4b85ea7eeab836d3d7cfb3dbfc, ↵nagachika
6b4f8945d600168bf530d21395da8293fbd5e8ba: [Backport #20909] Check negative integer underflow Many of Oniguruma functions need valid encoding strings
2024-11-30merge revision(s) a8c2d5e7bee5fad0965baeb58d312ddc5932ec26: [Backport #20907]nagachika
Ensure fiber scheduler re-acquires mutex when interrupted from sleep. (#12158) [Bug #20907]
2024-11-30merge revision(s) 3b7892b6e4d1a1a5d6019987f9b46ed443dd104f: [Backport #20871]nagachika
Fix a bug in rb_include_module that stops nested inclusion into module subclasses This bug was present since the code was originally added by me in 3556a834a2847e52162d1d3302d4c64390df1694. Fixes [Bug #20871]
2024-11-22Removed extra assertions for Ruby 3.2Hiroshi SHIBATA
2024-11-22Fix flaky "Expected 499 to be >= 500" assertion in test_gc_compact.rbKJ Tsanaktsidis
There have been some sproradically flaky tests related to GC compaction, which fail with: 1) Failure: TestGCCompact#test_moving_hashes_down_size_pools [/test/ruby/test_gc_compact.rb:442]: Expected 499 to be >= 500. What's happening here, is that, _sometimes_, depending on very unlucky combinations of machine things, one of the expected-to-be-moved hashes might be found on the machine stack during GC, and thus pinned. One factor which seems to make this _more_ likely is that GCC 11 on Ubuntu 22.04 seems to want to allocate 440 bytes of stack space for `gc_start`, which is much more than it actually uses on the common code path. The result is that there are some 50-odd VALUE-sized cells "live" on the stack which may well contain valid heap pointers from previous function calls, and will need to be pinned. This is, of course, totally normal and expected; Ruby's GC is conservative and if there is the possibility that a VALUE might be live on the machine stack, it can't be moved. However, it does make these tests flaky. This commit "fixes" the tests by performing the work in a fiber; the fiber goes out of scope and should be collected by the call to verify_compaction_references, so there should be no references to the to-be-moved objects floating around on the machine stack. Fixes [#20021]
2024-11-22Assert that at least one element has been embeddedPeter Zhu
It's not guaranteed that the first element will always be embedded.
2024-11-22Assert that resizing arrays will re-embed themPeter Zhu
2024-11-22Assert that resizing objects will re-embed themPeter Zhu
2024-11-22Fix Error in GC Compaction specsMatt Valentine-House
Previously if any of the tests that move objects between size pools failed to move anything, then the call to stats.dig would return `nil` which would then cause assert_operator to error. This should be a test Failure, rather than an Error so this commit uses a default value of 0 if stats.dig fails to find a key. Also refactor object movement tests to use stats.dig, rather than :[]
2024-11-19[ruby/net-http] test_https.rb - fix test_session_reuse_but_expireMSP-Greg
https://github.com/ruby/net-http/commit/5544243c41
2024-11-19[ruby/openssl] Only CSR version 1 (encoded as 0) is allowed by PKIX standardsJob Snijders
RFC 2986, section 4.1 only defines version 1 for CSRs. This version is encoded as a 0. Starting with OpenSSL 3.3, setting the CSR version to anything but 1 fails. Do not attempt to generate a CSR with invalid version (which now fails) and invalidate the CSR in test_sign_and_verify_rsa_sha1 by changing its subject rather than using an invalid version. This commit fixes the following error. ``` 2) Error: test_version(OpenSSL::TestX509Request): OpenSSL::X509::RequestError: X509_REQ_set_version: passed invalid argument /home/runner/work/openssl/openssl/test/openssl/test_x509req.rb:18:in `version=' /home/runner/work/openssl/openssl/test/openssl/test_x509req.rb:18:in `issue_csr' /home/runner/work/openssl/openssl/test/openssl/test_x509req.rb:43:in `test_version' 40: req = OpenSSL::X509::Request.new(req.to_der) 41: assert_equal(0, req.version) 42: => 43: req = issue_csr(1, @dn, @rsa1024, OpenSSL::Digest.new('SHA256')) 44: assert_equal(1, req.version) 45: req = OpenSSL::X509::Request.new(req.to_der) 46: assert_equal(1, req.version) ``` https://github.com/ruby/openssl/commit/c06fdeb091
2024-11-10merge revision(s) d71be7274bd2623bb521be72c245c08fc38d6ae4: [Backport #20873]nagachika
[Bug #20873] Consider `-FIXNUM_MIN` overflow `-FIXNUM_MIN` is usually greater than `FIXNUM_MAX` on platforms using two's complement representation.
2024-11-10Fix update_coderange for binary stringsJohn Hawthorn
Although a binary (aka ASCII-8BIT) string will never have a broken coderange, it still has to differentiate between "valid" and "7bit". On Ruby 3.4/trunk this problem is masked because we now clear the coderange more agressively in rb_str_resize, and we happened to always be strinking this string, but we should not assume that. On Ruby 3.3 this created strings where `ascii_only?` was true in cases it shouldn't be as well as other problems. Fixes [Bug #20883] Co-authored-by: Daniel Colson <danieljamescolson@gmail.com> Co-authored-by: Matthew Draper <matthew@trebex.net>
2024-11-10merge revision(s) 56ecc243e230e8e99761ec0ffc5116601f094bb0: [Backport #20868]nagachika
[Bug #20868] Fix Method#hash to not change after compaction The hash value of a Method must remain constant after a compaction, otherwise it may not work as the key in a hash table. For example: def a; end # Need this method here because otherwise the iseq may be on the C stack # which would get pinned and not move during compaction def get_hash method(:a).hash end puts get_hash # => 2993401401091578131 GC.verify_compaction_references(expand_heap: true, toward: :empty) puts get_hash # => -2162775864511574135
2024-11-10merge revision(s) 29c480dd6fca993590c82078ba797e2c4e876ac7: [Backport #20853]nagachika
[Bug #20853] Fix Proc#hash to not change after compaction The hash value of a Proc must remain constant after a compaction, otherwise it may not work as the key in a hash table.
2024-11-06Skip MinGW failure with GitHub Actions updateHiroshi SHIBATA
We should fix this later
2024-11-06Pend some tests because these are not working with macOS 15 and Xcode 16Hiroshi SHIBATA
2024-10-18merge revision(s) 6118e8a47394409b53164b60e79fadf348b97db3, ↵nagachika
dc64448202299633a235f310b8bf2192263f274f: [Backport #20716] Fix method caching bug when including/prepend module A that prepends module B Fix by always adding the generated iclass to the subclasses list, otherwise the method cache for the iclass is not cleared when the method in the module is overwritten. Fixes [Bug #20716] Remove an unused variable
2024-10-18merge revision(s) 35e124832e29b65c84d4e0e4e434616859f9bdf5: [Backport #20755]nagachika
[Bug #20755] Frozen string should not be writable via IO::Buffer
2024-10-18merge revision(s) 637067440f74043c6d79fc649ab8acf1afea25a5: [Backport #20752]nagachika
[Bug #20752] Slice of readonly `IO::Buffer` also should be readonly
2024-10-18merge revision(s) c1862cbb89a6bf42dcd07d92fe4f4bfeebca5775: [Backport #20719]nagachika
[Bug #20719] `Float` argument must be ASCII compatible
2024-10-18merge revision(s) d33e3d47b84a73b38644f2a3d41881ce9be6ef18: [Backport #20704]nagachika
[Bug #20704] Win32: Fix chdir to non-ASCII path On Windows, `chdir` in compilers' runtime libraries uses the active code page, but command line arguments in ruby are always UTF-8, since commit:33ea2646b98adb49ae2e1781753bf22d33729ac0.
2024-10-04Add `IO::Buffer` tests for read and write with length & offset.Samuel Williams
2024-08-18merge revision(s) 992596fb7af18a7f472589a607d0eb3fbb03b49a: [Backport #20344]nagachika
Fix next inside block argument stack underflow [Bug #20344] Fix compile_next adding removable adjust label
2024-08-18Allow waitpid(-1, Process::WNOHANG) to be woken if a waitpid(pid) isStan Hu
...pending If two threads are running, with one calling waitpid(-1, Process::WNOHANG), and another calling waitpid($some_pid), and then $some_other_pid exits, we would expect the waitpid(-1, Process::WNOHANG) call to retrieve that exit status. However, it cannot actually do so until $some_pid _also_ exits. This patch fixes the issue by calling do_waitpid unconditionally in waitpid_wait; this will ensure that a waitpid -1 actually reaps something (after first checking that no PID-directed call wants the process). [Bug #20490]
2024-08-18merge revision(s) 1870505f478cc75993b296b7144a45137ace6937: [Backport ↵nagachika
#20651] [Backport #20571] Fix wrong unreachable chunk remove when jump destination label is unremovable