summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Cast tv_usec to int32_t to fit in tv_nsecYuta Saito2021-12-021-1/+1
| | | | | | suseconds_t, which is the type of tv_usec, may be defined with a longer size type than tv_nsec's type (long). So usec to nsec conversion needs an explicit casting.
* Needs to update revision.h unless existing [ci skip]Nobuyoshi Nakada2021-12-021-0/+5
|
* Don't call + and < in Integer.times for !FIXNUMJeremy Evans2021-12-012-2/+27
| | | | | | | The methods aren't called for FIXNUM, and it's best to have consistent behavior. Fixes [Bug #18377]
* Ignore to generate the documentation from vendored librariesHiroshi SHIBATA2021-12-021-0/+1
|
* Rework tracing for blocks running as methodsAlan Wu2021-12-016-60/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The main impetus for this change is to fix [Bug #13392]. Previously, we fired the "return" TracePoint event after popping the stack frame for the block running as method (BMETHOD). This gave undesirable source location outputs as the return event normally fires right before the frame going away. The iseq for each block can run both as a block and as a method. To accommodate that, this commit makes vm_trace() fire call/return events for instructions that have b_call/b_return events attached when the iseq is running as a BMETHOD. The logic for rewriting to "trace_*" instruction is tweaked so that when the user listens to call/return events, instructions with b_call/b_return become trace variants. To continue to provide the return value for non-local returns done using the "return" or "break" keyword inside BMETHODs, the stack unwinding code is tweaked. b_return events now provide the same return value as return events for these non-local cases. A pre-existing test deemed not providing a return value for these b_return events as a limitation. This commit removes the checks for call/return TracePoint events that happen when calling into BMETHODs when no TracePoints are active. Technically, migrating just the return event is enough to fix the bug, but migrating both call and return removes our reliance on `VM_FRAME_FLAG_FINISH` and re-entering the interpreter when the caller is already in the interpreter.
* Revert "Force disable yjit on OpenBSD"Aaron Patterson2021-12-011-6/+0
| | | | This reverts commit 119626da947bf6492ef7a27abf3bf12de5d0d95a.
* Check that cb / ocb exist before marking executableAaron Patterson2021-12-011-2/+9
| | | | | | | | | If YJIT isn't enabled, or hasn't finished booting, cb / ocb could be null. This commit just checks to make sure they're available before marking as executable Co-Authored-By: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
* Mark JIT code as writeable / executable depending on the situationAaron Patterson2021-12-016-5/+81
| | | | | | | | | | | | | | | | Some platforms don't want memory to be marked as writeable and executable at the same time. When we write to the code block, we calculate the OS page that the buffer position maps to. Then we call `mprotect` to allow writes on that particular page. As an optimization, we cache the "last written" aligned page which allows us to amortize the cost of the `mprotect` call. In other words, sequential writes to the same page will only call `mprotect` on the page once. When we're done writing, we call `mprotect` on the entire JIT buffer. This means we don't need to keep track of which pages were marked as writeable, we let the OS take care of that. Co-authored-by: John Hawthorn <john@hawthorn.email>
* [rubygems/rubygems] Provide distinguished name which will be correctly parsed.Vít Ondruch2021-12-022-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems that since ruby openssl 2.1.0 [[1]], the distinguished name submitted to `OpenSSL::X509::Name.parse` is not correctly parsed if it does not contain the first slash: ~~~ $ ruby -v ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux] $ gem list | grep openssl openssl (default: 2.2.0) $ irb -r openssl irb(main):001:0> OpenSSL::X509::Name.parse("CN=nobody/DC=example").to_s(OpenSSL::X509::Name::ONELINE) => "CN = nobody/DC=example" irb(main):002:0> OpenSSL::X509::Name.parse("/CN=nobody/DC=example").to_s(OpenSSL::X509::Name::ONELINE) => "CN = nobody, DC = example" ~~~ Instead, use `OpenSSL::X509::Name.new` directly as suggested by upstream maintainer. [1]: https://github.com/ruby/openssl/commit/19c67cd10c57f3ab7b13966c36431ebc3fdd653b https://github.com/rubygems/rubygems/commit/09ca0c2dae Co-authored-by: Kazuki Yamaguchi <k@rhe.jp>
* * 2021-12-02 [ci skip]git2021-12-021-1/+1
|
* YJIT: Fail gracefully while OOM for new entry pointsAlan Wu2021-12-017-66/+131
| | | | | | | | | | | | | | | | | | | | Previously, YJIT crashes with rb_bug() when asked to compile new methods while out of executable memory. To handle this situation gracefully, this change keeps track of all the blocks compiled each invocation in case YJIT runs out of memory in the middle of a compliation sequence. The list is used to free all blocks in case compilation fails. yjit_gen_block() is renamed to gen_single_block() to make it distinct from gen_block_version(). Call to limit_block_version() and block_t allocation is moved into the function to help tidy error checking in the outer loop. limit_block_version() now returns by value. I feel that an out parameter with conditional mutation is unnecessarily hard to read in code that does not need to go for last drop performance. There is a good chance that the optimizer is able to output identical code anyways.
* [win32] skip example about STDIN encodingsNobuyoshi Nakada2021-12-011-15/+17
|
* [win32] Transcode input from console [Bug #18353]Nobuyoshi Nakada2021-12-011-0/+12
| | | | | On Windows, as the input from console is encoded in the active code page, convert the input to the internal encoding.
* Merge rubygems master fd676ac464491afaa0baf5435cb11b3f86229cbdHiroshi SHIBATA2021-12-0114-86/+70
|
* Removed vcr files. They are needless for this repoHiroshi SHIBATA2021-12-012-7/+0
|
* * 2021-12-01 [ci skip]git2021-12-011-2/+2
|
* [rubygems/rubygems] Update ↵Olle Jonsson2021-12-011-1/+1
| | | | | | | bundler/lib/bundler/templates/newgem/github/workflows/main.yml.tt https://github.com/rubygems/rubygems/commit/8836fe157b Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
* [rubygems/rubygems] Update main.yml.ttOlle Jonsson2021-12-011-1/+1
| | | | https://github.com/rubygems/rubygems/commit/3260173c59
* [rubygems/rubygems] newgem tmpl: ruby as "2.7" in GH Actions matrixOlle Jonsson2021-12-011-1/+1
| | | | https://github.com/rubygems/rubygems/commit/f5bead5634
* [rubygems/rubygems] newgem templ: Avoid Float 3.0 -> "3" in GH ActionOlle Jonsson2021-12-011-2/+2
| | | | | | | | This change avoids a YAML Float-to-String conversion, which turns a 3.0 into a "3". That can make names of builds less clear. In order to use this new capability, I added a "name" descriptor to the matrix-created Job. https://github.com/rubygems/rubygems/commit/6221241ad4
* [rubygems/rubygems] Fix race condition when reading & writing gemspecs ↵David Rodríguez2021-11-303-13/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | concurrently When bundler parallel installer installs gems concurrently, one can get confusing warnings like the following: ``` "[/home/runner/work/rubygems/rubygems/bundler/tmp/2/gems/system/specifications/zeitwerk-2.4.2.gemspec] isn't a Gem::Specification (NilClass instead). ``` I've got these warnings several times in the past, but I never managed to reproduce them, and never look deeply into the root cause, but this time a got a cause that reproduced quite frequently, so I looked into it. The problem is one thread reading a gemspec while another thread is writing it. The write of the gemspec was not protected, so `Gem::Specification.load` could end up seeing a truncated gemspec and thus throw this warning. The fix involve two changes: * Change the methods that write gemspecs to use `Gem.binary_write` which is protected by a lock. * Fix `Gem.binary_write` to create the file lock at file creation time, not when the file already exists after. The realworld user problem caused by this issue happens in bundler, but I'm fixing it in rubygems first, and then I'll backport to bundler whatever needs backporting to fix the issue on the bundler side. https://github.com/rubygems/rubygems/commit/a672e7555c
* [rubygems/rubygems] Revert "Remove spec file before building"David Rodríguez2021-11-302-5/+0
| | | | | | | | | | | This reverts commit af604436d8141c34cb2e1e645b9b0d47bfd55a55. The issue that led to introducing it was never reproduced. I tried to repro with this patch and it still works just fine. Since this removal is getting in the middle for some race conditions I'm facing, I'm reverting the patch. https://github.com/rubygems/rubygems/commit/2dd267f0e4
* [rubygems/rubygems] Run hooks tests on gemspecs not already installedDavid Rodríguez2021-11-301-2/+10
| | | | | | | | | | | | The current `setup_base_installer` ends up using the `quick_gem` helper, which leaves the created specification installed. Instead, make sure to use the `util_spec` helper, which does a similar thing but doesn't leave the specification installed. The idea is that tests do not rely on the installer removing existing gemspecs, bacause I plan to stop doing that. https://github.com/rubygems/rubygems/commit/843f1a0abc
* Delete #if line during checking madvise() on SolarisNaohisa Goto2021-11-301-1/+0
| | | | | | | | The madvise() declaration should always be compiled on Solaris to check whether the declaration is good on the environment. For the purpose, the #if line is unnecessary. (There was also a trivial typo that the #if was not closed by #endif and the check always failed with preprocessor error.)
* Let pretty_inspect work once at firstNobuyoshi Nakada2021-11-301-1/+1
| | | | | For older pp.rb which did not need io/console, and dealing with `LoadError`.
* [ruby/error_highlight] Ignore all syscall errorsYusuke Endoh2021-11-301-1/+1
| | | | | | At least, Error::ENOTSUP may be raised on some extreme environments https://github.com/ruby/error_highlight/commit/2787983ff7
* lib/pp.rb (width_for): Ignore all syscall errorsYusuke Endoh2021-11-301-1/+1
| | | | According to nobu, Errno::EBAD is raised on Windows.
* lib/pp.rb (width_for): ignore Errno::EINVALYusuke Endoh2021-11-301-1/+1
| | | | | | | | | | | The error is raised on Solaris http://rubyci.s3.amazonaws.com/solaris10-gcc/ruby-master/log/20211130T030003Z.fail.html.gz ``` 1) Failure: TestRubyOptions#test_require [/export/home/users/chkbuild/cb-gcc/tmp/build/20211130T030003Z/ruby/test/ruby/test_rubyoptions.rb:265]: pid 7386 exit 1 | /export/home/users/chkbuild/cb-gcc/tmp/build/20211130T030003Z/ruby/lib/pp.rb:67:in `winsize': Invalid argument - <STDOUT> (Errno::EINVAL) ```
* Load io/console earlierNobuyoshi Nakada2021-11-301-0/+1
| | | | | Something goes wrong at loading libraries inside `mu_pp` in the test overriding `Class.inherited`.
* Recent systems prohibit symlink for relative loadingNobuyoshi Nakada2021-11-301-1/+1
|
* Enable load-relative on SolarisNobuyoshi Nakada2021-11-301-1/+7
|
* lib/pp.rb (PP.pp): Use io/console's winsize by defaultYusuke Endoh2021-11-301-1/+10
| | | | [Feature #12913]
* Cache wheather madvise declaration is needed on SolarisNobuyoshi Nakada2021-11-301-2/+5
|
* Fix conflicting declaration on SolarisNobuyoshi Nakada2021-11-302-2/+10
| | | | | | | | | | | | | | | | | | | | SunC ``` "cont.c", line 24: identifier redeclared: madvise current : function(pointer to char, unsigned int, int) returning int previous: function(pointer to void, unsigned int, int) returning int : "/usr/include/sys/mman.h", line 232 ``` GCC ``` cont.c:24:12: error: conflicting types for 'madvise' 24 | extern int madvise(caddr_t, size_t, int); | ^~~~~~~ In file included from cont.c:16: /usr/include/sys/mman.h:232:12: note: previous declaration of 'madvise' was here 232 | extern int madvise(void *, size_t, int); | ^~~~~~~ ```
* Fix `GC.total_time` exampleNobuyoshi Nakada2021-11-301-1/+1
| | | | | The result may increase actually or not, since GC can finish shorter than the timer granularity.
* [rubygems/rubygems] Fix escape of filenames in `bundle doctor`ooooooo-q2021-11-302-2/+13
| | | | https://github.com/rubygems/rubygems/commit/3ede1435ea
* * 2021-11-30 [ci skip]git2021-11-301-1/+1
|
* Revert "test/socket/test_socket.rb: skip on Solaris"Naohisa Goto2021-11-301-4/+0
| | | | | | | | | This reverts commit 27fb9d272daaae89089dfb61849ebe8e7aa6c833. The test failure on Solaris 10 is due to incomplete IPv6 configuration on the CI server, that have already been fixed. Reference for the fix: https://centrify.force.com/support/Article/KB-1179-X11-Forwarding-fails-with-Centrify-OpenSSH-5-0-Solaris/
* Workaround for implicit declaration of function 'madvise' on SolarisNaohisa Goto2021-11-302-0/+9
| | | | | | | | On Solaris, madvise(3C) is NOT defined for SUS (XPG4v2) or later, but MADV_* macros are defined when __EXTENSIONS__ is defined. This may cause compile error on Solaris 10 with GCC when "-Werror=implicit-function-declaration" and "-D_XOPEN_SOURCE=600" are added by configure.
* Update to ruby/spec@7f22a0bBenoit Daloze2021-11-2962-59/+656
|
* Update to ruby/mspec@098b320Benoit Daloze2021-11-291-1/+1
|
* [ci skip] Update documentation for GC.statPeter Zhu2021-11-291-4/+4
|
* [rubygems/rubygems] Deprecate typo nameNobuyoshi Nakada2021-11-291-0/+1
| | | | https://github.com/rubygems/rubygems/commit/62d54cbf08
* Simplify platform check for Windows-UCRTLars Kanis2021-11-291-1/+1
| | | RUBY_PLATFORM can be used since commit 576b2e64cdc5ea42ad345dd3c1c215e006c06fca .
* Consider environment variable case-insensitivenessNobuyoshi Nakada2021-11-291-3/+18
|
* * 2021-11-29 [ci skip]git2021-11-291-1/+1
|
* [ruby/readline] Suppress constant redefinition warningNobuyoshi Nakada2021-11-291-0/+1
| | | | | | | When already set by `use_lib_reline` in test/readline/helper.rb of readline-ext. https://github.com/ruby/readline/commit/0e3ca3b217
* Suppress address-of-packed-member warning by gccNobuyoshi Nakada2021-11-281-1/+3
|
* [ruby/ostruct] [DOC] Fix code markups [ci skip]Nobuyoshi Nakada2021-11-281-6/+6
| | | | | | Backquotes are not special characters in RDoc. https://github.com/ruby/ostruct/commit/a901df26b9
* * 2021-11-28 [ci skip]git2021-11-281-1/+1
|