aboutsummaryrefslogtreecommitdiffstats
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/io-console] [DOC] Add documentation for IO#cursorMatheus Richard2023-12-071-0/+10
| | | | | | ruby/io-console#50 https://github.com/ruby/io-console/commit/ee752ce771
* Set AI_ADDRCONFIG when making getaddrinfo(3) calls for outgoing conns (#7295)KJ Tsanaktsidis2023-12-073-3/+19
| | | | | | | | | | | | | | | | | | | When making an outgoing TCP or UDP connection, set AI_ADDRCONFIG in the hints we send to getaddrinfo(3) (if supported). This will prompt the resolver to _NOT_ issue A or AAAA queries if the system does not actually have an IPv4 or IPv6 address (respectively). This makes outgoing connections marginally more efficient on non-dual-stack systems, since we don't have to try connecting to an address which can't possibly work. More importantly, however, this works around a race condition present in some older versions of glibc on aarch64 where it could accidently send the two outgoing DNS queries with the same DNS txnid, and get confused when receiving the responses. This manifests as outgoing connections sometimes taking 5 seconds (the DNS timeout before retry) to be made. Fixes #19144
* [ruby/bigdecimal] Clarify that JSON methods come from the JSON gemPeter Zhu2023-12-061-1/+1
| | | | https://github.com/ruby/bigdecimal/commit/581725d4e5
* [ruby/bigdecimal] [DOC] Add section Methods for Working with JSONBurdetteLamar2023-12-061-1/+14
| | | | https://github.com/ruby/bigdecimal/commit/2edd8d0a23
* [flori/json] Bump up 2.7.1Hiroshi SHIBATA2023-12-051-1/+1
| | | | https://github.com/flori/json/commit/a1af7a308c
* Removed obsoleted version definitionHiroshi SHIBATA2023-12-052-2/+0
|
* [flori/json] Detect json version from version.rbHiroshi SHIBATA2023-12-051-1/+5
| | | | https://github.com/flori/json/commit/3ef57b5b39
* [flori/json] The modern Ruby uses utf-8 encodings by defaultHiroshi SHIBATA2023-12-051-2/+0
| | | | https://github.com/flori/json/commit/11b31210ac
* [flori/json] [DOC] RDoc for additionsBurdette Lamar2023-12-0513-85/+344
| | | | | | | | | | | | | | | | (https://github.com/flori/json/pull/557) * RDoc for additions * Update lib/json/add/time.rb Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org> --------- https://github.com/flori/json/commit/3f2efd60f7 Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
* [flori/json] Fix JSON.dump overload combinationtompng2023-12-051-12/+11
| | | | https://github.com/flori/json/commit/41c2712a3b
* [flori/json] Overload kwargs in JSON.dumpTakashi Kokubun2023-12-051-3/+8
| | | | https://github.com/flori/json/commit/936f280f9f
* [flori/json] JSON.dump: handle unenclosed hashes regressionJean Boussier2023-12-051-2/+8
| | | | | | | | | Fix: https://github.com/flori/json/issues/553 We can never add keyword arguments to `dump` otherwise existing code using unenclosed hash will break. https://github.com/flori/json/commit/8e0076a3f2
* Manually merged from flori/jsonHiroshi SHIBATA2023-12-015-5/+52
| | | | | | | | | | | | > https://github.com/flori/json/pull/525 > Rename escape_slash in script_safe and also escape E+2028 and E+2029 Co-authored-by: Jean Boussier <jean.boussier@gmail.com> > https://github.com/flori/json/pull/454 > Remove unnecessary initialization of create_id in JSON.parse() Co-authored-by: Watson <watson1978@gmail.com>
* Rename escape_slash in script_safe and also escape E+2028 and E+2029Jean Boussier2023-12-014-26/+59
| | | | | | | | | | | | | | | | | | | | | It is rather common to directly interpolate JSON string inside <script> tags in HTML as to provide configuration or parameters to a script. However this may lead to XSS vulnerabilities, to prevent that 3 characters need to be escaped: - `/` (forward slash) - `U+2028` (LINE SEPARATOR) - `U+2029` (PARAGRAPH SEPARATOR) The forward slash need to be escaped to prevent closing the script tag early, and the other two are valid JSON but invalid Javascript and can be used to break JS parsing. Given that the intent of escaping forward slash is the same than escaping U+2028 and U+2029, I chos to rename and repurpose the existing `escape_slash` option.
* Use ruby_xfree to free buffersJean Boussier2023-12-012-8/+8
| | | | | They are allocated with ruby_xmalloc, they should be freed with ruby_xfree.
* [flori/json] Bump up 2.7.0Hiroshi SHIBATA2023-12-012-2/+2
| | | | https://github.com/flori/json/commit/ca546128f2
* [flori/json] Fix "unexpected token" offset for InfinityJohn Hawthorn2023-12-012-2/+2
| | | | | | | | Previously in the JSON::Ext parser, when we encountered an "Infinity" token (and weren't allowing NaN/Infinity) we would try to display the "unexpected token" at the character before. https://github.com/flori/json/commit/42ac170712
* [ruby/cgi] Fix unescapeHTMLflosacca2023-11-301-7/+26
| | | | https://github.com/ruby/cgi/commit/67610e6ca8
* Adjust indent [ci skip]Nobuyoshi Nakada2023-11-301-15/+15
|
* Rename rsock_raise_socket_error to rsock_raise_resolution_errorMisaki Shioi2023-11-304-9/+9
| | | | Again, rsock_raise_socket_error is called only when getaddrinfo and getaddrname fail
* Replace SocketError with Socket::ResolutionError in rsock_raise_socket_errorMisaki Shioi2023-11-301-2/+6
| | | | rsock_raise_socket_error is called only when getaddrinfo and getaddrname fail
* Add Socket::ResolutionError & Socket::ResolutionError#error_codeMisaki Shioi2023-11-302-0/+13
| | | | Socket::ResolutionError#error_code returns Socket::EAI_XXX
* Further fix the GVL instrumentation APIJean Boussier2023-11-281-41/+39
| | | | | | | | | | Followup: https://github.com/ruby/ruby/pull/9029 [Bug #20019] Some events still weren't triggered from the right place. The test suite was also improved a bit more.
* Retry pthread_create a few timesYusuke Endoh2023-11-281-2/+16
| | | | | | According to https://bugs.openjdk.org/browse/JDK-8268605, pthread_create may fail spuriously. This change implements a simple retry as a modest measure, which is also used by JDK.
* [ruby/stringio] Development of 3.1.1 started.Sutou Kouhei2023-11-281-1/+1
| | | | https://github.com/ruby/stringio/commit/75da93d48f
* Refactor and fix the GVL instrumentation APIJean Boussier2023-11-271-73/+140
| | | | | | | | | | | | 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>
* [ruby/stringio] Do not compile the C extension on TruffleRubyBenoit Daloze2023-11-271-1/+5
| | | | | | | | | | | * 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
* [ruby/psych] Prefer each_char in Psych::Visitors::Visitor::ToRuby#deserializeMau Magnaguagno2023-11-271-1/+1
| | | | | | Use safe navigation operator with each_char to remove empty strings and improve readability. https://github.com/ruby/psych/commit/5fe714b216
* [ruby/openssl] History.md: Escape Markdown syntax Italic "*". [ci skip]Jun Aruga2023-11-251-1/+1
| | | | https://github.com/ruby/openssl/commit/dc26433ae5
* objspace_dump.c: dump call cache ids with dump_append_idJean Boussier2023-11-221-4/+5
| | | | | | Not all `ID` have an associated string. Fixes a SEGFAULT in ObjectSpace.dump_all spec.
* `ObjectSpace.count_nodes` doesn't count nodesyui-knk2023-11-211-142/+1
| | | | | | | 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.
* Don't try compacting ivars on Classes that are "too complex"Aaron Patterson2023-11-201-0/+5
| | | | | Too complex classes use a hash table to store ivs, and should always pin their IVs. We shouldn't touch those classes in compaction.
* Revert "Revert "Remove SHAPE_CAPACITY_CHANGE shapes""Peter Zhu2023-11-131-5/+0
| | | | This reverts commit 5f3fb4f4e397735783743fe52a7899b614bece20.
* Record more info from CALLCACHE in heap dumpsJohn Hawthorn2023-11-131-3/+23
| | | | | This records the called_id and klass from imemo_callcache objects in heap dumps.
* GVL Instrumentation: pass thread->self as part of event dataJean Boussier2023-11-131-0/+19
| | | | | | | | | | | | | | | | | | | 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.
* Revert "Remove SHAPE_CAPACITY_CHANGE shapes"Peter Zhu2023-11-101-0/+5
| | | | | | | This reverts commit f6910a61122931e4193bcc0fad18d839c319b720. We're seeing crashes in the test suite of Shopify's core monolith after this change.
* [ruby/io-console] bump up to 0.6.1.dev.1Nobuyoshi Nakada2023-11-101-1/+1
| | | | https://github.com/ruby/io-console/commit/057ab96a73
* [ruby/io-console] Include FFI version version.rbNobuyoshi Nakada2023-11-101-0/+1
| | | | https://github.com/ruby/io-console/commit/b0c688c57e
* [ruby/io-console] Define IO::ConsoleMode::VERSION from gemspecNobuyoshi Nakada2023-11-102-0/+7
| | | | https://github.com/ruby/io-console/commit/ebdbebf461
* [ruby/io-console] Update file list in gemspecNobuyoshi Nakada2023-11-101-8/+8
| | | | https://github.com/ruby/io-console/commit/0bfde8372c
* Remove SHAPE_CAPACITY_CHANGE shapesPeter Zhu2023-11-091-5/+0
| | | | | 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.
* [ruby/digest] Suppress implicit cast down warningsNobuyoshi Nakada2023-11-091-1/+2
| | | | https://github.com/ruby/digest/commit/2f3505bf3f
* [ruby/stringio] Development of 3.1.0 started.Sutou Kouhei2023-11-081-1/+1
| | | | https://github.com/ruby/stringio/commit/a2f8ef1a6a
* [ruby/stringio] Add missing row separator encoding conversionSutou Kouhei2023-11-081-22/+41
| | | | | | | | | | | | | (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
* [ruby/strscan] Bump versionSutou Kouhei2023-11-081-1/+1
| | | | https://github.com/ruby/strscan/commit/1b3393be05
* [ruby/fiddle] Remove garbageSutou Kouhei2023-11-081-1/+0
| | | | https://github.com/ruby/fiddle/commit/bbcb66e16e
* [ruby/fiddle] Include stdbool.h explicitly for old RubySutou Kouhei2023-11-081-0/+1
| | | | https://github.com/ruby/fiddle/commit/74a05fb358
* [ruby/fiddle] Use Ruby's true/false for C boolSutou Kouhei2023-11-087-22/+89
| | | | | | | | GitHub: fix https://github.com/ruby/fiddle/pull/130 Reported by Benoit Daloze. Thanks!!! https://github.com/ruby/fiddle/commit/2640e0148e
* [flori/json] Enhanced RDoc for Range extensionsBurdetteLamar2023-11-081-7/+22
| | | | https://github.com/flori/json/commit/ec47749b53
* String for string literal is not resizableNobuyoshi Nakada2023-11-082-0/+13
|