summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2023-11-27Refactor and fix the GVL instrumentation APIJean Boussier
This entirely changes how it is tested. Rather than to use counters we now record the timeline of events with associated threads which makes it much easier to assert that certains events are only preceded by a specific event, and makes it much easier to debug unexpected timelines. Co-Authored-By: Étienne Barrié <etienne.barrie@gmail.com> Co-Authored-By: JP Camara <jp@jpcamara.com> Co-Authored-By: John Hawthorn <john@hawthorn.email>
2023-11-27[ruby/stringio] Do not compile the C extension on TruffleRubyBenoit Daloze
* Before this it was compiled but not used, because TruffleRuby has a stringio.rb in stdlib and .rb has precedence over .so. In fact that extension never worked on TruffleRuby, because rb_io_extract_modeenc() has never been defined on TruffleRuby. * So this just skip compiling the extension since compilation of it now fails: https://github.com/ruby/openssl/issues/699 https://github.com/ruby/stringio/commit/d791b63df6
2023-11-27[ruby/psych] Prefer each_char in Psych::Visitors::Visitor::ToRuby#deserializeMau Magnaguagno
Use safe navigation operator with each_char to remove empty strings and improve readability. https://github.com/ruby/psych/commit/5fe714b216
2023-11-25[ruby/openssl] History.md: Escape Markdown syntax Italic "*". [ci skip]Jun Aruga
https://github.com/ruby/openssl/commit/dc26433ae5
2023-11-22objspace_dump.c: dump call cache ids with dump_append_idJean Boussier
Not all `ID` have an associated string. Fixes a SEGFAULT in ObjectSpace.dump_all spec.
2023-11-21`ObjectSpace.count_nodes` doesn't count nodesyui-knk
Node has not been managed by GC from Ruby 2.5. Therefore these codes are not needed. If ObjectSpace depends on Node, it needs to update the file when node type is updated. Delete node related codes to avoid such update.
2023-11-20Don't try compacting ivars on Classes that are "too complex"Aaron Patterson
Too complex classes use a hash table to store ivs, and should always pin their IVs. We shouldn't touch those classes in compaction.
2023-11-13Revert "Revert "Remove SHAPE_CAPACITY_CHANGE shapes""Peter Zhu
This reverts commit 5f3fb4f4e397735783743fe52a7899b614bece20.
2023-11-13Record more info from CALLCACHE in heap dumpsJohn Hawthorn
This records the called_id and klass from imemo_callcache objects in heap dumps.
2023-11-13GVL Instrumentation: pass thread->self as part of event dataJean Boussier
Context: https://github.com/ivoanjo/gvl-tracing/pull/4 Some hooks may want to collect data on a per thread basis. Right now the only way to identify the concerned thread is to use `rb_nativethread_self()` or similar, but even then because of the thread cache or MaNy, two distinct Ruby threads may report the same native thread id. By passing `thread->self`, hooks can use it as a key to store the metadata. NB: Most hooks are executed outside the GVL, so such data collection need to use a thread-safe data-structure, and shouldn't use the reference in other ways from inside the hook. They must also either pin that value or handle compaction.
2023-11-10Revert "Remove SHAPE_CAPACITY_CHANGE shapes"Peter Zhu
This reverts commit f6910a61122931e4193bcc0fad18d839c319b720. We're seeing crashes in the test suite of Shopify's core monolith after this change.
2023-11-10[ruby/io-console] bump up to 0.6.1.dev.1Nobuyoshi Nakada
https://github.com/ruby/io-console/commit/057ab96a73
2023-11-10[ruby/io-console] Include FFI version version.rbNobuyoshi Nakada
https://github.com/ruby/io-console/commit/b0c688c57e
2023-11-10[ruby/io-console] Define IO::ConsoleMode::VERSION from gemspecNobuyoshi Nakada
https://github.com/ruby/io-console/commit/ebdbebf461
2023-11-10[ruby/io-console] Update file list in gemspecNobuyoshi Nakada
https://github.com/ruby/io-console/commit/0bfde8372c
2023-11-09Remove SHAPE_CAPACITY_CHANGE shapesPeter Zhu
We don't need to create a shape to transition capacity as we can transition the capacity when the capacity of the SHAPE_IVAR changes.
2023-11-09[ruby/digest] Suppress implicit cast down warningsNobuyoshi Nakada
https://github.com/ruby/digest/commit/2f3505bf3f
2023-11-08[ruby/stringio] Development of 3.1.0 started.Sutou Kouhei
https://github.com/ruby/stringio/commit/a2f8ef1a6a
2023-11-08[ruby/stringio] Add missing row separator encoding conversionSutou Kouhei
(https://github.com/ruby/stringio/pull/69) The conversion logic is borrowed from ruby/ruby's io.c: https://github.com/ruby/ruby/blob/40391faeab608665da87a05c686c074f91a5a206/io.c#L4059-L4079 Fix ruby/stringio#68 Reported by IWAMOTO Kouichi. Thanks!!! https://github.com/ruby/stringio/commit/4b170c1a68
2023-11-08[ruby/strscan] Bump versionSutou Kouhei
https://github.com/ruby/strscan/commit/1b3393be05
2023-11-08[ruby/fiddle] Remove garbageSutou Kouhei
https://github.com/ruby/fiddle/commit/bbcb66e16e
2023-11-08[ruby/fiddle] Include stdbool.h explicitly for old RubySutou Kouhei
https://github.com/ruby/fiddle/commit/74a05fb358
2023-11-08[ruby/fiddle] Use Ruby's true/false for C boolSutou Kouhei
GitHub: fix https://github.com/ruby/fiddle/pull/130 Reported by Benoit Daloze. Thanks!!! https://github.com/ruby/fiddle/commit/2640e0148e
2023-11-08[flori/json] Enhanced RDoc for Range extensionsBurdetteLamar
https://github.com/flori/json/commit/ec47749b53
2023-11-08String for string literal is not resizableNobuyoshi Nakada
2023-11-07[ruby/cgi] Add snake case aliases for escapeURIComponentJean Boussier
As agreed in [Feature #18822] https://github.com/ruby/cgi/commit/9d1161ec9d
2023-11-07[ruby/zlib] Bump up 3.1.0Hiroshi SHIBATA
https://github.com/ruby/zlib/commit/2561e122ac
2023-11-07[ruby/zlib] Support Ruby 2.5+ againHiroshi SHIBATA
https://github.com/ruby/zlib/commit/661ea3ec5f
2023-11-07[ruby/pathname] Bump up 0.3.0Hiroshi SHIBATA
https://github.com/ruby/pathname/commit/f3d23679b0
2023-11-07[ruby/fcntl] Bump up 1.1.0Hiroshi SHIBATA
https://github.com/ruby/fcntl/commit/fe780abe07
2023-11-07[ruby/win32ole] Bump up 1.8.10Hiroshi SHIBATA
https://github.com/ruby/win32ole/commit/9a18f388a9
2023-11-07[ruby/bigdecimal] fixed docs for .scaleTim Kretschmer
the scale of `1` is actually 0 https://github.com/ruby/bigdecimal/commit/9a8bc9c417
2023-11-07[ruby/bigdecimal] Update doc for bigdecimal/utilKoichi ITO
Follow up https://github.com/ruby/bigdecimal/issues/89. `BigDecimal.new` has already been removed. This PR replaces `BigDecimal.new` with `Kernel.BigDecimal` in the documentation, following the message below: > BigDecimal.new is deprecated; use Kernel.BigDecimal method instead. https://github.com/ruby/bigdecimal/commit/26d84ba766e971da8eaaf2ce41e7b89935fa68da https://github.com/ruby/bigdecimal/commit/dd52adf3b2
2023-11-07[ruby/date] Bump up 3.3.4Hiroshi SHIBATA
https://github.com/ruby/date/commit/50e18d2684
2023-11-07Prevent cpu_set_t overflow even if there are more than 63 coresYusuke Endoh
Do not use `pthread_attr_setaffinity_np` if `sched_getcpu()` exceeds `CPU_SETSIZE`. (Using `CPU_ALLOC()` would be more appropriate.)
2023-11-07Fix a memory leakYusuke Endoh
pointed by @nobu
2023-11-07Use pthread_attr_setaffinity_np instead of pthread_setaffinity_npYusuke Endoh
2023-11-07Detach a pthread after pthread_setaffinity_npYusuke Endoh
After a pthread for getaddrinfo is detached, we cannot predict when the thread will exit. It would lead to a segfault by setting pthread_setaffinity to the terminated pthread. I guess this problem would be more likely to occur in high-load environments. This change detaches the pthread after pthread_setaffinity is called. [Feature #19965]
2023-11-07Revert "Do not use pthread_setaffinity_np on s390x"Yusuke Endoh
This reverts commit de82439215dd2770ef9a3a2cf5798bdadb788533.
2023-11-05[ruby/etc] Fix inconsistent dll linkage warningNobuyoshi Nakada
https://github.com/ruby/etc/commit/e4c71e5996
2023-11-04[ruby/stringio] Make STRINGIO_VERSION uniformNobuyoshi Nakada
https://github.com/ruby/stringio/commit/4400bf3380
2023-11-04[ruby/stringio] Move Java version to Java directoryNobuyoshi Nakada
https://github.com/ruby/stringio/commit/3f90a0d619
2023-11-02Make every initial size pool shape a root shapePeter Zhu
This commit makes every initial size pool shape a root shape and assigns it a capacity of 0.
2023-10-31[Feature #10602] Add new API rb_profile_thread_frames()Daisuke Aritomo
Add a new API rb_profile_thread_frames(), which is essentialy a per-thread version of rb_profile_frames(). While the original rb_profile_frames() always returns results about the current active thread obtained by GET_EC(), this new API takes a Thread to be profiled as an argument. This should come in handy when profiling I/O-bound programs such as webapps, since this new API allows us to learn about Threads performing I/O (which do not have the GVL). Profiling worker threads (such as Sidekiq workers) may be another application. Implements [Feature #10602] Co-authored-by: Mike Perham <mike@perham.net>
2023-10-29[ruby/etc] Start 1.4.3Nobuyoshi Nakada
https://github.com/ruby/etc/commit/a9e4d4730d
2023-10-26[ruby/zlib] Check for z_size_t along with {crc,adler}32_z inKJ Tsanaktsidis
extconf.rb (https://github.com/ruby/zlib/pull/69) The android NDK (android-ndk-r21e) does not have crc32_z, adler32_z, nor z_size_t in its zlib.h header file. However, it _does_ have the crc32_z and adler32_z symbols in the libz.a static library! mkmf performs two tests for have_func: * It sees if a program that includes the header and takes the address of the symbol can compile * It sees if a program that defines the symbol as `extern void sym_name()` and calls it can be linked If either test works, it considers the function present. The android-ndk-r21e is passing the second test but not the first for crc32_z/adler32_z. So, we define HAVE_ZLIB_SIZE_T_FUNCS, but then can't actually compile the extension (since the prototypes aren't in the header file). We can keep this working how it was working before by _also_ checking for `have_type("z_size_t", "zlib.h")`. The have_type check _only_ looks in the header file for the type; if a program including the header file and using the type can't compile, the type is considered absent regardless of what might be in libz.a. https://github.com/ruby/zlib/commit/3b9fe962d8
2023-10-26[ruby/zlib] Fix misdetection of {crc32,alder32}_z in cloudflare zlib forkKJ Tsanaktsidis
We use the Cloudflare fork of zlib (https://github.com/cloudflare/zlib), which we find gives improved performance on AWS Graviton ARM instances. That fork does not define crc32_z and alder32_z functions. Until two days ago, Ruby's zlib gem worked fine, because cloudflare zlib _also_ did not define z_size_t, which meant Ruby did not try and use these functions. Since https://github.com/cloudflare/zlib/commit/a3ba99596d6271224d39ef9d6853511f51821e05 however, cloudflare zlib _does_ define z_size_t (but NOT crc32_z or alder32_z). The zlib gem would try and use these nonexistant functions and not compile. This patch fixes it by actually specifically detecting the functions that the gem wants to call, rather than just the presence of the z_size_t type. https://github.com/ruby/zlib/commit/c96e8b9a57
2023-10-25Do not use pthread_setaffinity_np on s390xYusuke Endoh
Looks like it randomly causes a segfault https://rubyci.s3.amazonaws.com/rhel_zlinux/ruby-master/log/20231025T093302Z.fail.html.gz ``` [11186/26148] TestNetHTTP_v1_2#test_set_form/home/chkbuild/build/20231025T093302Z/ruby/tool/lib/webrick/httprequest.rb:197: [BUG] Segmentation fault at 0x000003ff1ffff000 ruby 3.3.0dev (2023-10-25T07:50:00Z master 526292d9fe) [s390x-linux] ```
2023-10-24rb_getaddrinfo should return EAI_AGAIN instead of EAGAINYusuke Endoh
2023-10-24Indent critical regions with blocksYusuke Endoh
Cosmetic change per ko1's preference