2016-10-27

Thu Oct 27 23:28:12 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

Thu Oct 27 16:33:47 2016 NAKAMURA Usaku <usa@ruby-lang.org>

tool/redmine-backporter.rb (rel)

check the exception and show right message.

Thu Oct 27 14:57:33 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/socket/lib/socket.rb (UDPSocket#recvfrom_nonblock)

[DOC] Remove a false statement “If maxlen is omitted, its default
value is 65536.” maxlen, the first parameter, cannot be omitted as the
method signature indicates. This hasn't changed ever since it was first
implemented.

Thu Oct 27 09:42:09 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

object.c (rb_convert_to_integer)

convert a fixable float to a fixnum directly without the conversion method,
as well as bignum case.

Tue Sep 27 22:59:42 2016 URABE Shyouhei <shyouhei@ruby-lang.org>

Tue Sep 27 18:10:18 2016 Jeremy Evans <code@jeremyevans.net>

This makes all warnings raised call Warning#warn, which by
default does the same thing it does currently

(rb_write_error_str). You can override Warning#warn to change the behavior. [ruby-core

75016] [Feature #12299]

Tue Sep 27 17:35:28 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

iseq.c (iseqw_s_compile_file)

deal with syntax error as well as compile, and should not abort when
rescued.

Tue Sep 27 12:07:17 2016 NARUSE, Yui <naruse@ruby-lang.org>

lib/cgi/cookie.rb (parse)

don't allow , as a separator. [Bug #12791]

lib/webrick/cookie.rb (parse)

ditto.

2016-09-26

Mon Sep 26 21:37:21 2016 Akinori MUSHA <knu@iDaemons.org>

man/erb.1, man/irb.1, man/ri.1, man/ruby.1

Remove Ns before punctuation.

Mon Sep 26 16:23:49 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/stringio/stringio.c (strio_seek)

Avoid signed integer overflow. It's not harmful in practice here, but
is still undefined behavior.

ext/stringio/stringio.c (strio_extend)

Check that the new length does not exceed LONG_MAX. This fixes the invalid
write on the overflow.

test/stringio/test_stringio.rb (test_write_integer_overflow)

Add a test case for the above fix in strio_extend().

Mon Sep 26 15:43:34 2016 Kazuki Yamaguchi <k@rhe.jp>

eval_intern.h (TH_PUSH_TAG)

Initialize struct rb_vm_tag::tag with Qundef rather than 0 which is equal
to Qfalse. Since Kernel#throw searches a
tag with rb_vm_tag::tag == obj, throw(false) can accidentally find an
unrelated tag which is not created by Kernel#catch.
[ruby-core:77229] [Bug #12743]

Fri Sep 16 21:19:51 2016 Naohisa Goto <ngotogenome@gmail.com>

Fix compile error with old version of fcc on Solaris 10. [Bug #12768]
[ruby-dev:49808]

Fri Sep 16 19:46:05 2016 NAKAMURA Usaku <usa@ruby-lang.org>

win32/Makefile.sub (config.h)

fixed compile error with VC introduced by previous commit.

Fri Sep 16 14:54:34 2016 URABE Shyouhei <shyouhei@ruby-lang.org>

internal.h (WARN_UNUSED_RESULT)

moved to configure.in, to actually check its availability rather to check
GCC's version.

configure.in (WARN_UNUSED_RESULT)

moved to here.

configure.in (RUBY_FUNC_ATTRIBUTE)

change function declaration to return int rather than void, because it
makes no sense for a warn_unused_result attributed function to return void.
Funny thing however is that it also makes no sense for noreturn attributed
function to return int. So there is a fundamental conflict between them.
While I tested this, I confirmed both GCC 6 and Clang 3.8 prefers int over
void to correctly detect necessary attributes under this setup. Maybe
subject to change in future.

internal.h (UNINITIALIZED_VAR)

renamed to MAYBE_UNUSED, then moved to configure.in for the same reason we
move WARN_UNUSED_RESULT.

configure.in (MAYBE_UNUSED)

moved to here.

internal.h (__has_attribute)

deleted, because it has no use now.

string.c (rb_str_enumerate_lines)

refactor macro rename.

string.c (rb_str_enumerate_bytes)

ditto.

string.c (rb_str_enumerate_chars)

ditto.

string.c (rb_str_enumerate_codepoints)

ditto.

thread.c (do_select)

ditto.

vm_backtrace.c (rb_debug_inspector_open)

ditto.

vsnprintf.c (BSD_vfprintf)

ditto.

Fri Sep 16 14:35:55 2016 URABE Shyouhei <shyouhei@ruby-lang.org>

ChangeLog (add-log-time-format)

Not exactly sure when but recently (25.x maybe), emacs changed its API to
take optional two arguments. We have to follow that.

Tue Sep 13 21:23:51 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>

Tue Sep 13 21:11:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

extract the predicate macro to tell if the given length is capable in an
embedded string, and fix possible integer overflow.

Tue Sep 13 18:37:08 2016 Koichi Sasada <ko1@atdot.net>

test/ruby/test_exception.rb

fix thread issues. * use Queue
instead of a local variable for synchronization. * join created thread to
solve leaking threads warning.

Tue Sep 13 16:07:26 2016 Kazuki Yamaguchi <k@rhe.jp>

string.c (rb_str_set_len)

The buffer overflow check is wrong. The space for termlen is allocated
outside the capacity returned by rb_str_capacity(). This fixes r41920
(“string.c: multi-byte terminator”, 2013-07-11). [ruby-core:77257] [Bug
#12757]

Fri Sep 2 16:06:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

Fri Sep 2 00:55:11 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

move extmk.rb specific tricks from lib/mkmf.rb. keep RUBYCOMMONDIR prefix
not to conflict with a timestamp file in the toplevel.

2016-09-01

Thu Sep 1 14:24:16 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

ext/extmk.rb (gems)

move dirty hacks for bundled gems from mkmf.rb.

lib/mkmf.rb (create_makefile)

yield all configuration strings.

2016-08-31

Wed Aug 31 17:39:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

ext/extmk.rb (create_makefile)

make gem.build_complete file under TARGET_SO_DIR and install it only when
the gem build succeeded. [ruby-core:77057] [Bug #12681]

Wed Aug 31 15:36:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

ext/extmk.rb

move TARGET_SO_DIR stuffs to mkmf.rb.

lib/mkmf.rb (create_makefile)

create target shared object files under $(TARGET_SO_DIR) which is $sodir if
it is defined with $extout. [ruby-core:77058] [Bug #12681]

Wed Aug 31 01:56:55 2016 Yuichiro Kaneko <yui-knk@ruby-lang.org>

doc/extension.ja.rdoc

[DOC] Fix a typo. [ci skip]

Wed Aug 31 00:52:23 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

ext/extmk.rb

make the gems target directory under the expanded name. [ruby-core:77102]
[Bug #12714]

2016-08-30

Tue Aug 30 15:27:27 2016 Kouhei Yanagita <yanagi@shakenbu.org>

ext/json/lib/json/add/ostruct.rb (OpenStruct.json_create)

Correct documentation, fix the name of values. [Fix GH-1421]

Tue Aug 30 14:53:34 2016 NAKAMURA Usaku <usa@ruby-lang.org>

io.c (nogvl_fsync, nogvl_fdatasync)

on Windows, just ignore if the fd is associated to non-disk device. if
call fsync and/or fdatasync with such fds, it causes Errno::EBADF exception
and the behavior is incompatible with ruby 2.1 and earlier unintentionally
introduced.

Tue Aug 30 03:38:35 2016 NARUSE, Yui <naruse@ruby-lang.org>

vm_dump.c (backtrace)

use rip in the saved context for the case the SIGSEGV is received when the
process is in userland. Note that ip in the stack should be used if the
signal is received when it is in kernel (when it is calling syscall) [Bug
#12711]

2016-08-27

Sat Aug 27 10:26:14 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

array.c (rb_ary_concat_multi)

take multiple arguments. based on the patch by Satoru Horie. [Feature
#12333]

string.c (rb_str_concat_multi, rb_str_prepend_multi)

ditto.

2016-08-25

Thu Aug 25 00:42:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

win32/file.c (append_wstr)

remove a codepage argument, and use INVALID_CODE_PAGE for conversion by
econv.

win32/file.c (append_wstr)

exclude the terminator from the result length when input len == -1.

2016-08-24

Wed Aug 24 22:41:30 2016 Kouhei Sutou <kou@cozmixng.org>

gc.c (gc_reset_malloc_info)

Remove too much “;”.

Wed Aug 24 20:07:57 2016 Naohisa Goto <ngotogenome@gmail.com>

include/ruby/defines.h (ALWAYS_INLINE)

Add alternative definition. Fix compile error with compilers that do not
have force inline attribute, including old version of fcc on Solaris 10.
[ruby-dev:49773] [Bug #12701]

Wed Aug 24 16:56:26 2016 NARUSE, Yui <naruse@ruby-lang.org>

.gdbinit

follow r55766's VM change.

Wed Aug 24 12:57:56 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

object.c (rb_mod_initialize, rb_class_initialize)

[DOC] these methods do not invoke module_eval/class_eval, just eval the
given block under the new module/class but sharing the context with the
surrounding scope like those methods. [ruby-core:77023] [Bug #12696]

Fri Jul 29 03:49:04 2016 Koichi Sasada <ko1@atdot.net>

describe this change. I believe nobody touch these objects because there
are no method defined.

vm_core.h

remove the following definitions. * rb_cEnv decl. * GetEnvPtr() because Env
is no longer T_DATA object.

vm_core.h (rb_env_t)

fix layout for imemo values.

vm_core.h (vm_assert_env)

added.

vm_core.h (vm_env_new)

added.

2016-07-28

Thu Jul 28 19:53:21 2016 Koichi Sasada <ko1@atdot.net>

vm_core.h

revisit the structure of frame, block and env. [Bug #12628] This patch
introduce many changes. * Introduce concept of “Block Handler (BH)” to
represent passed blocks. * move rb_control_frame_t::flag to ep (as a special local variable). This flags represents not
only frame type, but also env flags such as escaped. * rename `rb_block_t`
to `struct rb_block`. * Make Proc, Binding and RubyVM::Env objects
wb-protected. Check [Bug #12628] for more details.

Thu Jul 14 17:26:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

update by –header option of tool/enc-unicode.rb.
enc/unicode/name2ctype.kwd file has not been used.

common.mk (enc/unicode/name2ctype.kwd)

rule to create from Unicode data files, used only when the target does not
exist.

Thu Jul 14 13:10:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

ext/json/lib/json/ext

remove stale directory. bundled extension libraries are placed under the
directory for each architectures, but not mixed with plain text script
libraries.

Thu Jul 14 12:48:47 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>

ext/json/*/.rb

merge original files from upstream repository. It only fixes styles of
frozen string literal.

2016-07-13

Wed Jul 13 22:23:03 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>

test/json/json_common_interface_test.rb

use assert_raise instead of assert_raises.

Wed Jul 13 22:14:23 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>

test/lib/test/unit.rb

added test files with `_test` suffix for json upstream.

test/json

merge original test files from json upstream.

Wed Jul 13 16:08:08 2016 Koichi Sasada <ko1@atdot.net>

gc.c (gc_mark_roots)

should mark the VM object itself to mark singleton class of the VM object.
Before this patch, we only set mark bit for the VM object and invoke mark
function separately. [Bug #12583]

test/ruby/test_gc.rb

add a test.

Wed Jul 13 15:59:59 2016 NAKAMURA Usaku <usa@ruby-lang.org>

math.c (_USE_MATH_DEFINES)

it must be set before including internal.h because internal.h includes
ruby.h, ruby.h includes win32.h, and win32.h includes system's math.h.
this change is to get rid of a compiler warning (redefinition of a macro)
introduced at r55641.

Tue Jul 5 19:39:49 2016 Naohisa Goto <ngotogenome@gmail.com>

string.c (rb_str_change_terminator_length)

New function to change termlen and resize heap for the terminator. This is
split from rb_str_fill_terminator (str_fill_term) because filling
terminator and changing terminator length are different things. [Bug
#12536]

internal.h

declaration for rb_str_change_terminator_length.

string.c (str_fill_term)

Simplify only to zero-fill the terminator. For non-shared strings, it
assumes that (capa + termlen) bytes of heap is allocated. This partially
reverts r55557.

encoding.c (rb_enc_associate_index)

rb_str_change_terminator_length is used, and it should be called whenever
the termlen is changed.

string.c (str_capacity)

New static function to return capacity of a string with the given termlen,
because the termlen may sometimes be different from TERM_LEN(str)
especially during changing termlen or filling terminator with specific
termlen.

2016-07-02

Sat Jul 2 18:04:24 2016 NARUSE, Yui <naruse@ruby-lang.org>

RFC3986_Parser#split sets opaque only if the URI has path-rootless, not path-empty.
[ruby-core:76055] [Bug #12498] patched by Chris Heisterkamp
<cheister@squareup.com>

Sat Jul 2 04:26:14 2016 NARUSE, Yui <naruse@ruby-lang.org>

regcomp.c (noname_disable_map)

don't optimize out group 0 Ruby's Regexp doesn't allow normal
numbered groups if the regexp has named groups. On such case it optimizes
out related NT_ENCLOSE. But even on the case it can use g<0>. This
fix not to remove NT_ENCLOSE whose regnum is 0. [ruby-core:75828] [Bug
#12454]

Sat Jul 2 03:09:27 2016 Naohisa Goto <ngotogenome@gmail.com>

string.c

Partially reverts r55547 and r55555. ChangeLog about the reverted changes
are also deleted in this file. [Bug #12536] [ruby-dev:49699]
[ruby-dev:49702]

Sat Jul 2 02:22:22 2016 Naohisa Goto <ngotogenome@gmail.com>

string.c (str_fill_term)

When termlen increases, re-allocation of memory for termlen should always
be needed. In this fix, if possible, decrease capa instead of realloc. [Bug
#12536] [ruby-dev:49699]

2016-07-01

Fri Jul 1 20:20:20 2016 Naohisa Goto <ngotogenome@gmail.com>

Specify termlen from the given encoding when creating a new String object
is needed.

string.c (rb_tainted_str_new_with_enc)

New function to create a tainted String object with the given encoding.
This means that the termlen is correctly specified. Currently static
function. The function name might be renamed to rb_tainted_enc_str_new or
rb_enc_tainted_str_new.

string.c (rb_external_str_new_with_enc)

Use encoding by using the above rb_tainted_str_new_with_enc().

Fri Jul 1 19:38:57 2016 Naohisa Goto <ngotogenome@gmail.com>

test/fiddle/test_pointer.rb (test_to_str, test_to_s, test_aref_aset)

Attempt to use independent strings for destructive tests that directly
modify values on memory by using Fiddle::Pointer. [Bug #12537]
[ruby-dev:49700]

Fri Jul 1 18:20:00 2016 NARUSE, Yui <naruse@ruby-lang.org>

.gdbinit (rb_ps_thread)

show the detail of cfunc in ruby level backtrace.

Fri Jul 1 13:26:39 2016 Naohisa Goto <ngotogenome@gmail.com>

string.c (rb_str_subseq, str_substr)

When RSTRING_EMBED_LEN_MAX is used, TERM_LEN(str) should be considered with
it because embedded strings are also processed by TERM_FILL. Additional fix
for [Bug #12536] [ruby-dev:49699].

Fri Jul 1 12:11:01 2016 NARUSE, Yui <naruse@ruby-lang.org>

.gdbinit (rb_count_objects)

added gdb version of count_objects().

Fri Jul 1 04:32:52 2016 NARUSE, Yui <naruse@ruby-lang.org>

.gdbinit (rb_ps_thread)

show ruby level backtrace. Usually you can call `rb_ps` to show ruby level
backtraces for all living threads. Note that it can call with core file
like `gcore <pid>` and `gdb ruby core.<pid>`.

Wed Jun 29 12:41:58 2016 Shugo Maeda <shugo@ruby-lang.org>

Wed Jun 29 08:45:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

convert passed block symbol to proc. based on the patch by Daisuke Sato in
[ruby-dev:49695]. [Bug #12531]

Wed Jun 29 03:34:41 2016 NARUSE, Yui <naruse@ruby-lang.org>

bignum.c (rb_big2ulong)

the old logic seems to try to avoid calculating `-(long)(num-1)-1` if `num`
is not LONG_MIN. (Note that `-LONG_MIN` may be larger than LONG_MAX) But C
compilers can optimize it into single NEG instruction. Therefore those two
conditions can be single if-body.

bignum.c (rb_big2long)

ditto.

bignum.c (rb_big2ull)

ditto.

bignum.c (rb_big2ll)

ditto.

2016-06-28

Tue Jun 28 22:55:00 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

lib/pstore.rb (PStore::CHECKSUM_ALGO)

extract the algorithm for checksum, instead of qualified names for each
times.

Tue Jun 28 22:29:36 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

bootstraptest/runner.rb

do not use safe navigation operator. this runner may run on older ruby.
partially revert r53110

Tue Jun 28 15:20:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

Tue Jun 28 09:56:29 2016 Stefan Schussler <mail@stefanschuessler.de>

object.c (rb_mod_eqq)

[DOC] Fix typo in RDoc. [Fix GH-1393]

Tue Jun 28 02:41:32 2016 NARUSE, Yui <naruse@ruby-lang.org>

insns.def (opt_plus)

use `- 1` instead of `& (~1)` to allow compilers to use x86 LEA
instruction (3 operand). Even if 3 operand LEA's latency is 3 cycle
after SandyBridge, it reduces code size and can be faster because of super
scalar.

insns.def (opt_plus)

calculate and use rb_int2big. On positive Fixnum overflow, `recv - 1 + obj`
doesn't carry because recv's msb and obj's msb are 0, and
resulted msb is 1. Therefore simply rshift and cast as signed long works
fine. On negative Fixnum overflow, it will carry because both
arguments' msb are 1, and resulted msb is also 1. In this case it needs
to restore carried sign bit after rshift.

2016-06-27

Mon Jun 27 16:58:32 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

lib/fileutils.rb (FileUtils#install)

accecpt symbolic mode, as well as chmod.

lib/fileutils.rb (FileUtils#install)

add owner and group options.

Mon Jun 27 08:56:55 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

compile.c (ADD_TRACE)

ignore trace instruction on non-positive line.

parse.y (coverage)

get rid of ArgumentError
when the starting line number is not positive. [ruby-core:76141] [Bug
#12517]

2016-06-19

Sun Jun 19 21:25:43 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/ossl_ocsp.c

Add OCSP::SingleResponse that represents an OCSP SingleResponse structure.
Also add two new methods responses and find_response to
OCSP::BasicResponse. A BasicResponse has one or more SingleResponse. We
have OCSP::BasicResponse#status that returns them as an array of arrays,
each containing the content of a SingleResponse, but this is not useful.
When validating an OCSP response, we need to look into the each
SingleResponse and check their validity but it is not simple. For example,
when validating for a certificate 'cert', the code would be like: #
certid_target is an OpenSSL::OCSP::CertificateId
for cert basic = res.basic result = basic.status.any? do |ary| ary.cmp(certid_target) && ary <= Time.now && (!ary || Time.now <= ary) end Adding OCSP::SingleResponse at the same time allows
exposing OCSP_check_validity(). With this, the code above can be rewritten
as: basic = res.basic single = basic.find_response(certid_target) result =
single.check_validity

test/openssl/test_ocsp.rb

Test this.

Sun Jun 19 18:40:19 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/ossl_ocsp.c (ossl_ocspbres_add_status)

Allow specifying the times (thisUpdate, nextUpdate and revocationTime) with
Time objects. Currently they accepts
only relative seconds from the current time. This is inconvenience,
especially for revocationTime. When Integer is passed, they are still
treated as relative times. Since the type check is currently done with
rb_Integer(), this is a slightly incompatible change. Hope no one passes a
relative time as String or Time
object… Also, allow passing nil as nextUpdate. It is optional.

ext/openssl/ruby_missing.h

Define RB_INTEGER_TYPE_P() if not defined. openssl gem will be released
before Ruby 2.4.0.

Thu Jun 16 11:15:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

Thu Jun 16 00:02:32 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/ossl_ocsp.c (ossl_ocspreq_verify, ossl_ocspbres_verify)

Use ossl_clear_error() so that they don't print warnings to stderr and
leak errors in the OpenSSL error
queue. Also, check the return value of OCSP_*_verify() correctly. They can
return -1 on verification failure.

2016-06-15

Wed Jun 15 19:52:23 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/ossl_ocsp.c (ossl_ocspreq_sign, ossl_ocspbres_sign)

Allow specifying hash algorithm used in signing. They are hard coded to use
SHA-1. Based on a patch provided by Tim Shirley
<tidoublemy@gmail.com>. [ruby-core:70915] [Feature #11552] [GH
ruby/openssl#28]

Sun Jun 12 13:47:42 2016 Kazuki Yamaguchi <k@rhe.jp>

Skip test if 'openssl' engine is already loaded. And test the
number increased by Engine.load{_by_id,}, not the total count of loaded
engines. Previously, we called OpenSSL::Engine.cleanup
every time running a test case, but we no longer can do it.
[ruby-core:75225] [Feature #12324]

Fri Jun 10 14:48:36 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

2016-06-09

Thu Jun 9 21:42:00 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/ossl_asn1.c (asn1integer_to_num)

Use ASN1_ENUMERATED_to_BN() to convert an ASN1_ENUMERATED to a BN. Starting
from OpenSSL 1.1.0,
ASN1_INTEGER_to_BN() rejects non-ASN1_INTEGER objects. The format of
INTEGER and ENUMERATED are almost identical so they behaved in the same way
in OpenSSL <= 1.0.2.
[ruby-core:75225] [Feature #12324]

test/openssl/test_asn1.rb (test_decode_enumerated)

Test that it works.

Thu Jun 9 21:10:04 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>

tool/ifchange

fix timestamp error when target without directory.

Thu Jun 9 19:46:22 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/ossl_ssl.c

Add define guards for OPENSSL_NO_EC. SSL_CTX_set_ecdh_auto() is defined
even when ECDH is disabled in OpenSSL's configuration. This fixes
r55214.

Tue Jun 7 21:27:17 2016 Kazuki Yamaguchi <k@rhe.jp>

test/open-uri/test_ssl.rb

Regenerate test certificates. The test CA certificate was incorrectly
generated. A CA certificate must have the basic constraints extension with
cA bit set to TRUE. OpenSSL <=
1.0.2 allowed the error when the certificate is in the trusted store but OpenSSL 1.1.0 no longer does.
[ruby-core:75225] [Feature #12324]

Tue Jun 7 14:57:09 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/extconf.rb

Check for SSL_CTX_set_min_proto_version() macro added in OpenSSL 1.1.0. Version-specific
methods, such as TLSv1_method(), are deprecated in OpenSSL 1.1.0. We need to use
version-flexible methods (TLS_*method() or SSLv23_*method()) and disable
other protocol versions as necessary. [ruby-core:75225] [Feature #12324]

ext/openssl/ossl_ssl.c

Use SSL_CTX_set_{min,max}_proto_version() to fix the protocol version.

2016-06-06

Mon Jun 6 23:00:00 2016 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>

appveyor.yml

Update libressl version to 2.3.5.

Mon Jun 6 18:37:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

vm_insnhelper.c (vm_throw_start)

check if the iseq is symbol proc, class definition should not be a symbol
proc. [ruby-core:75856] [Bug #12462]

Use SSL_is_server() to see if the SSL is server. The state machine in OpenSSL was rewritten and
SSL_get_state() no longer returns SSL_ST_ACCEPT.

(ossl_ssl_cipher_to_ary, ossl_sslctx_session_get_cb)

Add some `const`s to suppress warning.

Mon Jun 6 01:18:10 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/ossl_asn1.c (decode_bool)

Do the same thing as d2i_ASN1_BOOLEAN() does by ourselves. This function is
removed in OpenSSL 1.1.0.
[ruby-core:75225] [Feature #12324]

Mon Jun 6 00:34:16 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/extconf.rb

Check existence of accessor functions that don't exist in OpenSSL 0.9.8. OpenSSL 1.1.0 made most of its
structures opaque and requires use of these accessor functions.
[ruby-core:75225] [Feature #12324]

Mon Jun 6 00:00:13 2016 Kazuki Yamaguchi <k@rhe.jp>

Implement EVP_PKEY_get0_*() and {RSA,DSA,EC_KEY,DH}get0*()
functions. OpenSSL 1.1.0 makes
EVP_PKEY/RSA/DSA/DH opaque. We used to provide setter methods for each
parameter of each PKey type, for example PKey::RSA#e=, but this is no
longer possible because the new API RSA_set0_key() requires the 'n'
at the same time. This commit adds deprecation warning to them and adds
PKey::#set_ methods as direct wrapper for those new APIs.
For example, 'rsa.e = 3' now needs to be rewritten as
'rsa.set_key(rsa.n, 3, rsa.d)'. [ruby-core:75225] [Feature #12324]

Don't set a priv_key for DH object that are used in tmp_dh_callback.
Generating a new key pair every time should be fine - actually the private
exponent is ignored in OpenSSL
>= 1.0.2f/1.0.1r even if we explicitly set. www.openssl.org/news/secadv/20160128.txt

2016-06-05

Sun Jun 5 22:06:00 2016 Kenta Murata <mrkn@mrkn.jp>

configure.in

Fix the timing to detect the appropriate C++ compiler in OS X.

Sun Jun 5 21:42:24 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/extconf.rb

Check absence of CRYPTO_lock() to see if the OpenSSL has the new threading API. In
OpenSSL <= 1.0.2, an
application had to set locking callbacks to use OpenSSL in a multi-threaded
environment. OpenSSL 1.1.0 now
finds pthreads or Windows threads so we don't need to do something
special. [ruby-core:75225] [Feature #12324] Also check existence of
*_up_ref(). Some structures in OpenSSL have a reference counter. We
used to increment it with CRYPTO_add() which is a part of the old API.

Wed Jun 1 15:58:20 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

revert r55237. replace crypt, not crypt_r, and check if crypt is broken
more.

missing/crypt.c

move crypt_r.c

string.c (rb_str_crypt)

use crypt_r if provided by the system.

Wed Jun 1 14:07:53 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

missing/crypt_r.c (a64toi)

initialize statically and fix out of bounds access when salt is not 7bit
clean.

Wed Jun 1 11:34:59 2016 NAKAMURA Usaku <usa@ruby-lang.org>

win32/Makefile.sub (MISSING)

fixed build error introduced at r55237.

Wed Jun 1 09:48:06 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

string.c (rb_str_crypt)

use reentrant crypt_r.

Wed Jun 1 09:37:26 2016 NAKAMURA Usaku <usa@ruby-lang.org>

missing/crypt.c (des_setkey)

void function never returns any value.

Wed Jun 1 09:16:22 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

crypt.h

separate header file from missing/crypt.c.

missing/crypt.c (crypt_r, setkey_r, encrypt_r)

add reentrant versions.

Wed Jun 1 02:25:38 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

missing/crypt.c

fix size macros to use configured values for platforms long is larger than
32bit. [ruby-core:75792] [Bug #12446]

2016-05-31

Tue May 31 17:28:46 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

lib/optparse.rb (OptionParser::Completion.candidate)

get rid of nil as key names. [ruby-core:75773] [Bug #12438]

lib/optparse.rb (OptionParser#make_switch)

char class option cannot be NoArgument, default to RequiredArgument.

Tue May 31 00:30:11 2016 NAKAMURA Usaku <usa@ruby-lang.org>

ext/socket/raddrinfo.c (host_str, port_str)

Use StringValueCStr instead of (Safe)StringValue, to detect NUL byte in the
string.

2016-05-30

Mon May 30 22:02:01 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/ossl_asn1.c (time_to_time_t)

Use NUM2TIMET() instead of NUM2LONG(). time_t may be larger than long.
[ruby-core:45552] [Bug #6571]

Mon May 30 18:29:28 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/ossl_ssl.c (ossl_sslctx_s_alloc)

Enable the automatic curve selection for ECDH by calling
SSL_CTX_set_ecdh_auto(). With this a TLS server automatically selects a
curve which both the client and the server support to use in ECDH. This
changes the default behavior but users can still disable ECDH by excluding
'ECDH' cipher suites from the cipher list (with
SSLContext#ciphers=). This commit also deprecate tmp_ecdh_callback=. It was
added in Ruby 2.3.0. It wraps SSL_CTX_set_tmp_ecdh_callback() which will be
removed in OpenSSL 1.1.0. Its
callback receives two values 'is_export' and 'keylength'
but both are completely useless for determining a curve to use in ECDH. The
automatic curve selection was introduced to replace this.

(ossl_sslctx_setup)

Deprecate SSLContext#tmp_ecdh_callback=. Emit a warning if this is in use.

(ossl_sslctx_set_ecdh_curves)

Add SSLContext#ecdh_curves=. Wrap SSL_CTX_set1_curves_list(). If it is not
available, this falls back to SSL_CTX_set_tmp_ecdh().

(Init_ossl_ssl)

Define SSLContext#ecdh_curves=.

ext/openssl/extconf.rb

Check the existence of EC_curve_nist2nid(), SSL_CTX_set1_curves_list(),
SSL_CTX_set_ecdh_auto() and SSL_CTX_set_tmp_ecdh_callback().

2016-05-28

Sat May 28 20:40:57 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

Sat May 28 14:00:10 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/lib/openssl/ssl.rb (SSLSocket)

Move the implementation of SSLSocket#initialize to C. Initialize the SSL
(OpenSSL object) in it. Currently this is delayed until ossl_ssl_setup(),
which is called from SSLSocket#accept or connect. Say we call
SSLSocket#hostname= with an illegal value. We expect an exception to be
raised in hostname= but actually we get it in the later SSLSocket#connect.
Because the SSL is not ready at hostname=, the actual call of
SSL_set_tlsext_host_name() is also delayed. This also fixes:
[ruby-dev:49376] [Bug #11724]

ext/openssl/ossl_ssl.c (ossl_ssl_initialize)

Added. Almost the same as the Ruby version but this instantiate the SSL
object at the same time.

Tue May 24 12:35:56 2016 URABE Shyouhei <shyouhei@ruby-lang.org>

2016-05-23

Mon May 23 21:33:36 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

include/ruby/missing.h (isfinite)

move from numeric.c.

Mon May 23 21:09:06 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/ossl.c (Init_openssl)

Avoid reference to unset global variable. ossl_raise() may be called before
dOSSL is set. Since global variables default to 0 and the default value of
dOSSL set in Init_openssl() is also Qfalse, there is no real issue but
confusing. Patch by Bertram Scharpf <software@bertram-scharpf.de>
[ruby-core:58264] [Bug #9101]

Sat May 21 21:07:18 2016 NARUSE, Yui <naruse@ruby-lang.org>

configure.in (ALWAYS_INLINE)

force compilers the function inlined.

Sat May 21 16:16:03 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/ossl_ssl.c (ossl_ssl_stop)

Don't free the SSL struct here. Since some methods such as
SSLSocket#connect releases GVL, there is a chance of use after free if we
free the SSL from another thread. SSLSocket#stop was documented as
“prepares it for another connection” so this is a slightly incompatible
change. However when this sentence was added (r30090, Add toplevel
documentation for OpenSSL,
2010-12-06), it didn't actually. The current behavior is from r40304
(Correct shutdown behavior w.r.t GC.,
2013-04-15). [ruby-core:74978] [Bug #12292]

2016-05-20

Fri May 20 23:25:42 2016 Kazuki Yamaguchi <k@rhe.jp>

Added. Convert the argument to String with StringValue() and validate the
length is in 4..PEM_BUFSIZE. PEM_BUFSIZE is a macro defined in OpenSSL headers.

(ossl_pem_passwd_cb)

When reading/writing encrypted PEM format, we used to pass the password to
PEM_def_callback() directly but it was problematic. It is not NUL character
safe. And surprisingly, it silently truncates the password to 1024 bytes.
[GH ruby/openssl#51]

Fri May 20 23:45:53 2016 Naohisa Goto <ngotogenome@gmail.com>

id_table.c (list_id_table_init)

When unaligned word access is prohibited and sizeof(VALUE) is 8 (64-bit
machines), capa should always be even number for 8-byte word alignment of
the values of a table. This code assumes that sizeof(ID) is 4,
sizeof(VALUE) is 8, and xmalloc() returns 8-byte aligned memory. This fixes
bus error on 64-bit SPARC Solaris 10. [Bug #12406]

Wed May 18 19:33:54 2016 NARUSE, Yui <naruse@ruby-lang.org>

Wed May 18 16:52:03 2016 Kazuki Yamaguchi <k@rhe.jp>

pop errors leaked by PKCS12_parse(). This is a bug in OpenSSL, which exists in the versions
before the version 1.0.0t, 1.0.1p, 1.0.2d.

Wed May 18 16:04:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

tool/downloader.rb (Downloader::RubyGems.download)

verify gems only if RubyGems is 2.4 or later. old RubyGems fails to verify
almost all of bundled gems.

Wed May 18 14:52:38 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

string.c (rb_str_modify_expand)

check integer overflow. [ruby-core:75592] [Bug #12390]

Wed May 18 13:11:44 2016 NARUSE, Yui <naruse@ruby-lang.org>

re.c (match_ary_subseq)

get subseq of match array without creating temporary array.

re.c (match_ary_aref)

get element(s) of match array without creating temporary array.

re.c (match_aref)

Use match_ary_subseq with handling irregulars.

re.c (match_values_at)

Use match_ary_aref.

Wed May 18 13:03:07 2016 Kazuki Yamaguchi <k@rhe.jp>

ext/openssl/ossl_x509cert.c (ossl_x509_verify)

X509_verify() family may put errors on 0 return (0 means verification
failure). Clear OpenSSL error
queue before return to Ruby. Since the queue is thread global, remaining
errors in the queue can cause an unexpected error in the next OpenSSL operation. [ruby-core:48284]
[Bug #7215]

2016-05-16

Mon May 16 19:29:31 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>

Mon May 16 13:28:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

configure.in (FUNC_STDCALL, FUNC_CDECL, FUNC_FASTCALL)

set macro names explicitly to the old names, which are accidentally changed
at r54985, for backward compatibilities. fiddle also depends on these names
to fallback to ANSI names. [ruby-core:75494] [Bug #12377]

Mon May 9 06:30:12 2016 NAKAMURA Usaku <usa@ruby-lang.org>

Mon May 9 02:51:51 2016 NARUSE, Yui <naruse@ruby-lang.org>

throw rb_memerror when it cannot allocate memory. This is pointed out by
Facebook's Infer.

gc.c (gc_prof_setup_new_record)

ditto.

regparse.c (parse_regexp)

ditto.

util.c (MALLOC)

use xmalloc and xfree like above.

Mon May 9 02:39:16 2016 NARUSE, Yui <naruse@ruby-lang.org>

configure.in

check function attribute const and pure, and define CONSTFUNC and PUREFUNC
if available. Note that I don't add those options as default because it
still shows many false-positive (it seems not to consider longjmp).

vm_eval.c (stack_check)

get rb_thread_t* as an argument to avoid duplicate call of GET_THREAD().

2016-05-08

Sun May 8 21:01:14 2016 NARUSE, Yui <naruse@ruby-lang.org>

ext/openssl/extconf.rb

assume it doesn't have SSLv2 related functions when OPENSSL_NO_SSL2 is
defined. Usually openssl's header and the library (libssl) have the
same set of functions, but on some environment the library has functions
whose headers doesn't declare. (openssl/opensslconf.h and libssl.so
aren't be synchronized) To detect such case explicitly check feature
macro and remove related functions.

Sun May 8 18:51:33 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

file.c (rb_home_dir_of)

return the default home path if the user name is the current user name, on
platforms where struct pwd is not supported. a temporary measure against
[Bug #12226].

Sun May 1 23:59:59 2016 Kenta Murata <mrkn@mrkn.jp>

Sun May 1 23:51:54 2016 NAKAMURA Usaku <usa@ruby-lang.org>

fixed wrong regexp. if both positives and negatives were specified,
positives had to be specified from the beginning.

Sun May 1 21:00:07 2016 NAKAMURA Usaku <usa@ruby-lang.org>

win32/win32.c

drop Win2K support.

Sun May 1 20:39:47 2016 NAKAMURA Usaku <usa@ruby-lang.org>

cont.c, hash.c, random.c, win32/win32.c

cleanup some Win9x/ME/NT4 support leftovers. [fix GH-1328] patched by
@cremno

Sun May 1 07:30:44 2016 NARUSE, Yui <naruse@ruby-lang.org>

string.c (search_nonascii)

use nlz on big endian environments.

internal.h (nlz_intptr)

defined.

Sun May 1 00:03:30 2016 NARUSE, Yui <naruse@ruby-lang.org>

configure.in (__builtin_ctz)

check.

configure.in (__builtin_ctzll)

check.

internal.h (rb_popcount32)

defined for ntz_int32. it can use __builtin_popcount but this function is
not used on GCC environment because it uses __builtin_ctz. When another
function uses this, using __builtin_popcount should be re-considered.

2016-04-23

Sat Apr 23 18:01:21 2016 NARUSE, Yui <naruse@ruby-lang.org>

vm_insnhelper.c (vm_getivar)

specify inline instead of static inline. vm_getivar is called by
vm_call_ivar and vm_getinstancevariable. At least with GCC 4.8 and 5.3 on
Linux, they are inlining it into vm_call_ivar but not
vm_getinstancevariable. By `inline`, they correctly inline it and gains
performance. Speedup ratio: compare with the result of `ruby 2.4.0dev
(2016-04-23 trunk 54727) [x86_64-linux]' (greater is better) name
built-ruby loop_whileloop 1.001 vm1_ivar* 1.189
vm1_ivar_set* 1.024 Note the `inline`'s meaning is different
between old GCC and C99. Old GCC's inline means C99's extern
inline. gcc.gnu.org/onlinedocs/gcc/Inline.html
Since Ruby specify -std=iso9899:1999, it works like C99.

Fri Apr 22 04:54:40 2016 NARUSE, Yui <naruse@ruby-lang.org>

include/ruby/ruby.h (LIKELY)

moved from internal.h.

include/ruby/ruby.h (UNLIKELY)

ditto.

2016-04-21

Thu Apr 21 01:44:19 2016 NARUSE, Yui <naruse@ruby-lang.org>

gc.c (objspace_malloc_prepare)

remove size check because it is used by objspace_xmalloc and
objspace_xcalloc. objspace_xmalloc introduces its own check in this commit.
objspace_xcalloc checks with xmalloc2_size (ruby_xmalloc2_size).

gc.c (objspace_xmalloc0)

common xmalloc function.

gc.c (objspace_xmalloc)

introduce its own size check.

gc.c (objspace_xmalloc2)

separated from ruby_xmalloc2 to clarify the layer who has the
responsibility to check the size.

Fri Apr 15 14:14:00 2016 Kenta Murata <mrkn@mrkn.jp>

Fri Apr 15 10:07:11 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

ext/io/console/console.c (console_key_pressed_p)

raise the same exception, “unknown virtual key code”, for names with nul
chars. though console_win32_vk() considers the length and can deal with nul
chars, rb_sprintf() raised at PRIsVALUE previously, so quote it if it is
unprintable.

Wed Apr 13 14:36:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

Wed Apr 13 14:11:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

add wrapper function of BIGSIZE and rename the method function with _m
suffix.

numeric.c (int_round_zero_p)

extracted from rb_int_round. optimize for Bignum, and convert VALUE
returned by Numeric#size to long.

Wed Apr 13 12:00:08 2016 Koichi Sasada <ko1@atdot.net>

test/ruby/test_basicinstructions.rb

add a test to check access instance variables on special const objects. All
of such objects are frozen, so that we can not set instance variables for
them. But we can read instance variables and return default value (nil).

2016-04-12

Tue Apr 12 20:40:35 2016 Kaneko Yuichiro <spiketeika@gmail.com>

ext/date/date_core.c (time_to_time)

should preserve timezone info. [ruby-core:74889] [Bug #12271]

Tue Apr 12 11:51:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

compile.c (new_label_body)

initialize bit fields, since compile_data_alloc does not clear the memory.
[Bug #12082]

Wed Apr 6 10:17:53 2016 cremno phobia <cremno@mail.ru>

missing/lgamma_r.c is used on Windows, since msvcrt does not provide it.

missing/lgamma_r.c (lgamma_r)

fix lgamma(-0.0). [ruby-core:74823] [Bug #12249]

Wed Apr 6 01:22:55 2016 NAKAMURA Usaku <usa@ruby-lang.org>

math.c (ruby_lgamma_r)

mswin's lgamma_r also seems to be wrong. cf. [Bug #12249]

Wed Apr 6 00:53:31 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

math.c (ruby_lgamma_r)

fix lgamma(-0.0) on mingw and OSX.

math.c (ruby_tgamma)

fix tgamma(-0.0) on mingw. [ruby-core:74817] [Bug #12249]

2016-04-05

Tue Apr 5 14:50:28 2016 NARUSE, Yui <naruse@ruby-lang.org>

ext/nkf/nkf-utf8/nkf.c (mime_putc)

fix typo. [Bug #12202] [ruby-core:74802]

Tue Apr 5 00:06:44 2016 Aeris <aeris@imirhil.fr>

ext/openssl/ossl_ssl.c (ossl_ssl_tmp_key)

Access to ephemeral TLS session key in case of forward secrecy cipher.
Only available since OpenSSL
1.0.2. [Fix GH-1318]

ext/openssl/extconf.rb

Check for SSL_get_server_tmp_key.

2016-04-04

Mon Apr 4 23:37:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

vm_core.h (rb_vm_struct)

make at_exit a single linked list but not RArray, not to mark the
registered functions by the write barrier. based on the patches by Evan
Phoenix. [ruby-core:73908] [Bug #12095]

Mon Apr 4 17:43:45 2016 Koichi Sasada <ko1@atdot.net>

gc.c

change default value of RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO 0.3 -> 0.2
RUBY_GC_HEAP_FREE_SLOTS_MAX_RATIO 0.8 -> 0.65 These values are same as
Ruby 2.0.0. This change cause GC
counts. However, generational GC
reduced each (minor) GC time and
increase memory locality. So that not so big impact on my benchmarking
results.

Mon Apr 4 17:36:52 2016 Koichi Sasada <ko1@atdot.net>

gc.c (get_envparam_double)

take an upper_bound. And also take an accept_zero flag which allow to
accept zero even if lower_bound is set.

gc.c (ruby_gc_set_params)

fix parameters. RUBY_GC_HEAP_FREE_SLOTS_MAX_RATIO set 0.9 as
lower_bound, so that it should be upper_bound. Set RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO as
lower bound. Also set lower/upper bound of
RUBY_GC_HEAP_FREE_SLOTS_GOAL_RATIO to
RUBY_GC_HEAP_FREE_SLOTS_MIN/MAX_RATIO.

Mon Apr 4 16:41:32 2016 Koichi Sasada <ko1@atdot.net>

vm.c (Init_VM)

should pass tokens.

2016-04-03

Sun Apr 3 09:34:29 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

numeric.c (flodivmod)

round division if it is a finite number and module is required.

numeric.c (dbl2ival)

do not round here.

numeric.c (flo_ceil)

use dbl2ival.

numeric.c (flo_round)

round explicitly.

2016-04-02

Sat Apr 2 15:24:18 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

include/ruby/intern.h (rb_check_arity)

returns argc.

2016-04-01

Fri Apr 1 01:26:00 2016 Benoit Daloze <eregontp@gmail.com>

ext/coverage/coverage.c

Fully reset coverage to not persist global state. It was returning old file
coverages as empty arrays to the user. [ruby-core:74596] [Bug #12220]

ext/coverage/coverage.c (rb_coverages)

remove unused static state.

thread.c

Moved and renamed coverage_clear_result_i to reset_coverage_i.

test/coverage/test_coverage.rb

improve precision of tests.

Fri Apr 1 14:55:28 2016 Kazuki Yamaguchi <k@rhe.jp>

configure.in (AC_CONFIG_FILES)

$srcdir/.git can be a file pointing the real git_dir, such as when the git
working tree is a “linked working tree” (a working tree created by
git-worktree). So use git-rev-parse –git-dir to check if $srcdir is the
top-level of a git repository, not just checking if the $srcdir/.git
directory does exist or not. [ruby-core:74759] [Bug #12239]

tool/change_maker.rb

use tool/vcs.rb to detect VCS. This used to have its own VCS detection
code, while we have tool/vcs.rb.

Fri Apr 1 01:13:55 2016 Benoit Daloze <eregontp@gmail.com>

2016-03-31

Thu Mar 31 19:16:16 2016 Koichi Sasada <ko1@atdot.net>

gc.c

need to set initial value of GC_HEAP_FREE_SLOTS_GOAL_RATIO.

Thu Mar 31 17:50:27 2016 Koichi Sasada <ko1@atdot.net>

gc.c

change additional allocation policy. Introduce new environment variable
RUBY_GC_HEAP_FREE_SLOTS_GOAL_RATIO (goal_ratio) to calculate the ratio of
additional memory. Before this change, we add pages with the following
formula

(when free_slots < total_pages * RUBY_GC_HEAP_FREE_SLOTS_MIN_RATIO)

next_pages = total_pages * RUBY_GC_HEAP_GROWTH_FACTOR This addition can
allocate too much. With this change, we increase pages to satisfy the
following formula: next_free_slots = next_total_slots * goal_ratio where
next_free_slots = free_slots + adding_slots next_total_slots = total_slots
+ adding_slots. If you want to prepare many free slots, increase this
ratio. If this variable is 0, then simply multiply
RUBY_GC_HEAP_GROWTH_FACTOR.

gc.c (get_envparam_double)

enable to accept 0.

Thu Mar 31 17:48:25 2016 Koichi Sasada <ko1@atdot.net>

gc.c (gc_marks_finish)

fix syntax error.

Thu Mar 31 16:49:36 2016 Koichi Sasada <ko1@atdot.net>

gc.c

simplify allocate/free detecting logic at the end of marking. Before this
change, heap_pages_min_slots are calculated at the beginning sweeping
phase. And this value is used at the end of next marking
phase. To simplify it, we use this value at the end of this marking phase.
It means that we don't need to store this value as global state. Also
heap_pages_max_slots is calculated at the begging of sweeping phase and
used at the end of sweeping phase. To simplify this logic, we introduced
new global value heap_pages_freeable_pages it means extra pages count we
can free. gc_sweep_step() checks this value and moves empty pages to
tomb_heap not more than this value. Because of this fix,
heap_pages_swept_slots is no longer needed.

Thu Mar 31 11:18:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

Thu Mar 31 03:41:02 2016 NARUSE, Yui <naruse@ruby-lang.org>

ext/nkf/nkf-utf8/nkf.c

Merge upstream 69f7e74dde. fix indent.

2016-03-30

Wed Mar 30 16:33:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

extension.rdoc, extension.ja.rdoc

[DOC] Fix some errors. Renamed files, wrong method names or argument types;
the example GetDBM macro is now updated to the current version of the
actual code. patch by Marcus Stollsteimer in [ruby-core:74690]. [Bug
#12228]

Wed Mar 30 09:46:01 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>

lib/open-uri.rb

Use `userinfo` for authenticated proxy. [fix GH-1148] Patch by
@SokichiFujita

Fri Mar 25 01:50:58 2016 NARUSE, Yui <naruse@ruby-lang.org>

fix reserving position where the stack growing bottom to top. [Bug #12118]

Fri Mar 25 01:10:42 2016 Sebastian Schuberth <sschuberth@gmail.com>

lib/mkmf.rb (find_executable0)

On Windows, it is actually valid to surround individual PATH directory
entries with double quotes. Remove these before joining the path as
otherwise the literal quotes would become part of the path, resulting in
the executable not to be found. [Fix GH-1305]

Wed Mar 23 11:44:53 2016 cremno <cremno@mail.ru>

cast to `signed char`, which is used already, instead of SIGN_EXTEND_CHAR.

parse.y

SIGN_EXTEND_CHAR is no longer used. [Fix GH-1302]

Wed Mar 23 11:38:47 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

cygwin/GNUmakefile.in (MSYS2_ARG_CONV_EXCL_PARAM)

* add missing parentheses and remove double quotes. * rename to get rid of
recursive references. * as –excludes-dir option is for a path name, its
argument should be converted. [ruby-dev:49526] [Bug #12199]

Wed Mar 23 10:39:38 2016 Koichi ITO <koic.ito@gmail.com>

variable.c

Added documentation about order of `Module#constants` [ci skip][Bug #12121][fix GH-1301]

2016-03-22

Tue Mar 22 14:18:59 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

parse.y (lambda_body, parser_yylex)

warn mismatched indentation of lambda block.

Tue Mar 22 11:36:49 2016 NAKAMURA Usaku <usa@ruby-lang.org>

Tue Mar 22 10:31:34 2016 NAKAMURA Usaku <usa@ruby-lang.org>

time.c (wdiv, wmod)

wdivmod0() assumes the 3rd and the 4th arguments are valid pointers. maybe
checking them in wdivmod0() is better manner, but I guess that passing real
dummy pointers may be faster than checking and branching in wdivmod0().
this commit fixes SEGV on 32bit and LLP64 platforms.

Tue Mar 22 10:24:04 2016 NAKAMURA Usaku <usa@ruby-lang.org>

time.c (divmodv)

void function never returns any value.

Tue Mar 22 10:11:01 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

test/lib/test/unit.rb (Test::Unit::StatusLine#failed)

print failed messages only if replacing mode, otherwise defer them until
the end, to get rid of interleaving failures with progress messages. refix
r54195.

Tue Mar 22 03:45:03 2016 NARUSE, Yui <naruse@ruby-lang.org>

time.c (MUL_OVERFLOW_FIXWV_P)

defined for FIXWV.

time.c (wmul)

use MUL_OVERFLOW_FIXWV_P and only switch.

time.c (wmul)

use mul which has Fixnum optimization.

time.c (rb_time_magnify)

If WIDEVALUE_IS_WIDER, wmul() has the same optimized logic, else mul() has
also the similar logic for Fixnum.

time.c (rb_time_unmagnify)

almost ditto.

Tue Mar 22 03:10:09 2016 NARUSE, Yui <naruse@ruby-lang.org>

time.c (divmodv)

add the case both arguments are Fixnum.

time.c (wquo)

use quo which has Fixnum optimization.

time.c (wdivmod0)

added for WIDEVALUE_IS_WIDER.

time.c (wdivmod)

use wdivmod0 and divmodv. divmodv has Fixnum optimization.

time.c (wdiv)

use wdivmod0 and div to avoid the use of divmodv which calls id_quo whose
return value is array.

time.c (wmod)

use wdivmod0 and mod to avoid the use of divmodv which calls id_quo whose
return value is array.

2016-03-21

Mon Mar 21 22:32:50 2016 NARUSE, Yui <naruse@ruby-lang.org>

internal.h (rb_fix_divmod_fix)

like r54213, use FIX2NUM only if x == FIXNUM_MIN && y == -1. This
must be a rare case and it is expected compiler to handle well.

Mon Mar 21 22:15:11 2016 NARUSE, Yui <naruse@ruby-lang.org>

time.c (mod)

Add Fixnum case.

time.c (quo)

c can be Fixnum except a == FIXNUM_MIN && b == -1. Such case can be
optimized out because quo()'s argument is constant.

2016-03-10

Thu Mar 10 17:34:16 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

enable coverage by coverage_enabled option, not by parse_in_eval flag in
the thread context.

iseq.h (rb_compile_option_struct)

add coverage_enabled flag.

parse.y (yycompile0)

set coverage_enabled flag if coverage array is made.

Thu Mar 10 15:19:54 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

node.c (dump_option)

nd_compile_option is a hidden hash object, cannot call inspect on it.

Thu Mar 10 09:49:54 2016 Rei Odaira <Rei.Odaira@gmail.com>

test/socket/test_socket.rb (test_udp_recvmsg_truncation)

AIX does not set the MSG_TRUNC flag for a message partially read by
recvmsg(2) with the MSG_PEEK flag set.

2016-03-09

Wed Mar 9 16:48:45 2016 Koichi Sasada <ko1@atdot.net>

benchmark/driver.rb

fix my last commit (syntax error).

Wed Mar 9 16:41:44 2016 Koichi Sasada <ko1@atdot.net>

benchmark/driver.rb

fix output messages.

benchmark/memory_wrapper.rb

use respond_to? because member? does not work well.

Wed Mar 9 16:20:25 2016 Koichi Sasada <ko1@atdot.net>

benchmark/driver.rb

support memory usage benchmark. use `–measure-target='. Now, we can use the following
targets: * real (default): real time which returns process time in sec. *
peak: peak memory usage (physical memory) in bytes. * size: last memory
usage (physical memory) in bytes.

Tue Mar 8 17:53:09 2016 NARUSE, Yui <naruse@ruby-lang.org>

Tue Mar 8 17:33:38 2016 NAKAMURA Usaku <usa@ruby-lang.org>

now no need to check ERROR_CALL_NOT_IMPLEMENTED because it is for old
Win9X.

Tue Mar 8 16:54:29 2016 NAKAMURA Usaku <usa@ruby-lang.org>

win32/win32.c (rb_w32_write_console)

stop the VT100 emulation if the console supports it natively.

Tue Mar 8 08:13:01 2016 Rei Odaira <Rei.Odaira@gmail.com>

test/net/imap/test_imap.rb (test_idle_timeout)

Because of the timeout specified in “imap.idle(0.2)”, there is no guarantee
that the server thread has done all the work before the client thread
performs the assertions. It depends on the thread scheduling. Add checks to
avoid false positives (on AIX, particularly).

2016-03-05

Sat Mar 5 09:50:58 2016 Rei Odaira <Rei.Odaira@gmail.com>

IN6_IS_ADDR_V4COMPAT and IN6_IS_ADDR_V4MAPPED are broken on AIX, so skip
related tests.

Sat Mar 5 09:17:54 2016 Rei Odaira <Rei.Odaira@gmail.com>

test/rinda/test_rinda.rb (test_make_socket_ipv4_multicast)

The fifth argument to getsockopt(2) should be modified to indicate the
actual size of the value on return, but not in AIX. This is a know bug.
Skip related tests.

test/rinda/test_rinda.rb (test_ring_server_ipv4_multicast)

ditto.

test/rinda/test_rinda.rb (test_make_socket_unicast)

ditto.

test/socket/test_basicsocket.rb (test_getsockopt)

ditto.

test/socket/test_sockopt.rb (test_bool)

ditto.

Sat Mar 5 07:36:27 2016 Rei Odaira <Rei.Odaira@gmail.com>

test/-ext-/float/test_nextafter.rb

In AIX, nextafter(+0.0,-0.0)=+0.0, and nextafter(-0.0,+0.0)=-0.0, but they
should return -0.0 and +0.0, respectively. This is a known bug in
nextafter(3) on AIX, so skip related tests.

Sat Mar 5 07:14:10 2016 Rei Odaira <Rei.Odaira@gmail.com>

test/zlib/test_zlib.rb (test_adler32_combine, test_crc32_combine)

Skip two tests on AIX because zconf.h in zlib does not correctly recognize
_LARGE_FILES in AIX. The problem was already reported to zlib, and skip
these tests until it is fixed.

Sat Mar 5 03:07:40 2016 Rei Odaira <Rei.Odaira@gmail.com>

thread_pthread.c (getstack)

__pi_stacksize returned by pthread_getthrds_np() is wrong on AIX. Use
__pi_stackend - __pi_stackaddr instead.

2016-03-04

Fri Mar 4 19:19:42 2016 Koichi Sasada <ko1@atdot.net>

gc.c

use 2 bits with unsigned int for rb_objspace::flags::mode because it always
returns 0 to 2 (non-negative value).

Fri Mar 4 18:42:08 2016 Koichi Sasada <ko1@atdot.net>

gc.c

rename “enum gc_stat” to “enum gc_mode” because there is a same name (no
related) function gc_stat(). Also gc_stat_* are renamed to gc_mode_*,
gc_stat_transition() to gc_mode_transition(), rb_objspace::flags::stat is
renamed to rb_objspace::flags::mode. Change rb_objspace::flags::mode from 2
bits to 3 bits because VC++ returns negative enum value with 2 bits.

gc.c (gc_mode)

add a macro to access rb_objspace::flags::mode with verification code
(verification is enabled only on RGENGC_CHECK_MODE > 0).

Tue Jun 21 19:32:23 2016 Mark St.Godard <markstgodard@gmail.com>

Use the first value in X-Forwarded-Proto, if header contains multiple comma
separated values. Some middlewares may add these values to the list, not
replacing. [Fix GH-1386]

Tue Jun 21 17:17:42 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

test/ruby/test_io.rb

Skip test_readpartial_with_not_empty_buffer, test_read_buffer_error,
test_read_unlocktmp_ensure, test_readpartial_unlocktmp_ensure, and
test_sysread_unlocktmp_ensure on cygwin, because these tests repeatedly
hang. This makes test_io.rb complete in finite time on cygwin.

ChangeLog

Fix test_in.rb -> test_io.rb (two instances).

Tue Jun 21 15:42:22 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

test/ruby/test_io.rb

Skip test_read_buffer_error on cygwin, because this test repeatedly hangs.

Tue Jun 21 15:35:14 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

LEGAL

Added filenames and copyrights for some files in enc/trans/JIS.

Mon Jun 20 18:39:16 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

test/ruby/test_io.rb

Skip test_open_fifo_does_not_block_other_threads on cygwin. Fifos seem to
work okay in cygwin, but this test repeatedly hangs.

Sat Apr 23 11:21:27 2016 Marcus Stollsteimer <sto.mar@web.de>

Fri Apr 1 20:58:33 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

enc/unicode/case-folding.rb, casefold.h

Data generation to implement swapcase
functionality for titlecase characters. Swapcase isn't defined by
Unicode, because the purpose/usage of swapcase is unclear anyway. The
implementation follows a proposal from Nobu, swapping the case of each
component of a titlecase character individually. This means that the
titlecase characters have to be decomposed.

enc/unicode.c

Code using the above data.

test/ruby/enc/test_case_mapping.rb

Tests for the above.

Tue Mar 29 16:53:44 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

enc/unicode/case-folding.rb, casefold.h

Tweaked handling of 6 special cases in CaseUnfold_11_Table.

enc/unicode.c

Adjustments for above.

test/ruby/enc/test_case_mapping.rb

Tests for the above: Some tests in test_titlecase activated; test_greek
added. A test in test_cherokee fixed.

Tue Mar 29 13:31:00 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

enc/unicode.c

Cleaned up some comments.

Tue Mar 29 13:24:56 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

enc/unicode/case-folding.rb, casefold.h

Removing data for idempotent titlecasing.

enc/unicode.c

Adjust code to data removal.

Mon Mar 28 14:54:49 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

enc/unicode.c

Refactoring in preparation for data reduction for titlecase.

Mon Mar 28 14:36:36 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

enc/unicode.c

Minor refactoring for I WITH DOT ABOVE.

Mon Mar 28 14:26:24 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

enc/unicode.c

Removed code now covered by data from table.

Mon Mar 28 11:49:21 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

enc/unicode.c

Adding comments. [ci skip]

Fri Mar 25 16:40:48 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

test/ruby/enc/test_case_mapping.rb

Additional tests title case; some not yet activated.

Tue Mar 22 21:08:30 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

include/ruby/oniguruma.h

Additional flag for characters that are titlecase.

enc/unicode/case-folding.rb, casefold.h

Using above flag in data.

enc/unicode.c

Marking capitalized character as unmodified if it is already titlecase.

Mon Feb 15 14:43:28 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

Mon Feb 8 21:26:19 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

Flags for upper/lower conversion added (titlecase and SpecialCasing still
missing)

Mon Feb 8 20:43:57 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

string.c, enc/unicode.c

Disassociating ONIGENC_CASE_FOLD flag from ONIGENC_CASE_DOWNCASE.

Mon Feb 8 13:00:17 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

enc/unicode.c

Shortened macros for enc/unicode/casefold.h to single-letter; use flags in
casefold.h for logic.

enc/unicode/case-folding.rb

Added flag for case folding. Changed parameter passing.

enc/unicode/casefold.h

New flags added.

Mon Feb 8 09:43:57 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

common.mk

Removed enc/unicode/casefold.h from automatic build because some CI systems
don't have gperf. Creation of enc/unicode/casefold.h is now possible
with make unicode-up. This is intended as a temporary measure.

Sat Feb 6 14:51:23 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

test/ruby/enc/test_regex_casefold.rb

Tests for three case folding primitives (mbc_case_fold,
get_case_fold_codes_by_str, apply_all_case_fold) in the various encodings.
Currently only known good encodings are tested to avoid test failures. For
bug hunting, start by adding more encodings with generate_test_casefold
encoding

Sat Feb 6 14:37:16 2016 Martin Duerst <duerst@it.aoyama.ac.jp>

enc/unicode.c, test/ruby/enc/test_case_mapping.rb

Implemented :fold option for String#downcase by
using case folding data from regular expression engine, and added a few
simple tests.

Fri Feb 26 10:52:29 2016 Alex Boyd <alex@opengroove.org>

Fri Feb 26 08:11:58 2016 Aaron Patterson <tenderlove@ruby-lang.org>

gem_prelude.rb

Reduce system calls by activating the `did_you_mean` gem before requiring
the gem. Activating the gem puts the gem on the load path, where simply
requiring the file will search every gem that's installed until it can
find a gem that contains the `did_you_mean` file.

Tue Jan 26 15:14:01 2016 Kazuki Yamaguchi <k@rhe.jp>

compile.c (iseq_peephole_optimize)

don't apply tailcall optimization to send/invokesuper instructions with
blockiseq. This is a follow-up to the changes in r51903; blockiseq is now
the third operand of send/invokesuper instructions. [ruby-core:73413] [Bug
#12018]

Tue Jan 26 14:26:46 2016 Eric Wong <e@80x24.org>

signal.c (sig_list)

use fstring for hash key

test/ruby/test_signal.rb (test_signal_list_dedupe_keys)

added

Tue Jan 26 13:08:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

signal.c (rb_f_kill)

should immediately deliver reserved signals SIGILL and SIGFPE, not only
SIGSEGV and SIGBUS.

Sat Jan 23 20:54:26 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>

Sat Jan 23 20:10:29 2016 Shugo Maeda <shugo@ruby-lang.org>

range.c (range_eqq)

revert r51585 because rb_call_super() is called in range_include() and thus
r51585 doesn't work when the receiver Range object consists of non linear
objects such as Date objects.
[ruby-core:72908] [Bug #12003]

2016-01-15

Fri Jan 15 20:20:20 2016 Naohisa Goto <ngotogenome@gmail.com>

regint.h (PLATFORM_UNALIGNED_WORD_ACCESS)

The value of UNALIGNED_WORD_ACCESS should be used to determine whether
unaligned word access is allowed or not. After this commit, ./configure
CPPFLAGS=“-DUNALIGNED_WORD_ACCESS=0” disables unaligned word access even on
platforms that support the feature.

Fri Jan 15 16:12:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

parse.y (string1)

reset heredoc indent for each string literal so that concatenated string
would not be dedented. [ruby-core:72857] [Bug #11990]

Wed Jan 13 00:37:12 2016 Satoshi Ohmori <sachin21dev@gmail.com>

2016-01-12

Tue Jan 12 21:01:09 2016 Benoit Daloze <eregontp@gmail.com>

common.mk

update URL and name for the Ruby spec suite.

Tue Jan 12 19:52:19 2016 sorah (Shota Fukumori) <her@sorah.jp>

lib/forwardable.rb

Convert given accessors to String. r53381 changed to accept only Symbol or String for accessors, but
there are several rubygems that pass classes (e.g. Array, Hash, …) as accessors. Prior r53381, it
was accepted because Module#to_s returns its
class name. After r53381 given accessors are checked with define_method,
but it accepts only Symbol or
String, otherwise raises TypeError. def_delegator Foo,
:some_method This change is to revert unexpected incompatibility. But this
behavior may change in the future.

2016-01-11

Mon Jan 11 09:50:24 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

configure.in

check if the API version number is consistent with the program version
number.

2016-01-10

Sun Jan 10 20:57:25 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

compile.c (compile_massign_lhs)

when index ends with splat, append rhs value to it like POSTARG, since
VM_CALL_ARGS_SPLAT splats the last argument only. [ruby-core:72777] [Bug
#11970]

Sun Jan 10 15:45:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>

include/ruby/missing.h (explicit_bzero_by_memset_s)

remove inline implementation by memset_s, which needs a macro before
including headers and can cause problems in extension libraries by the
order of the macro and headers.

2016-01-08

Fri Jan 8 22:30:06 2016 Akinori MUSHA <knu@iDaemons.org>

Fri Jan 8 19:49:27 2016 Koichi Sasada <ko1@atdot.net>

remove heap_page::body. Instead of this field, heap_page::start field works
well.

Fri Jan 8 19:31:52 2016 Koichi Sasada <ko1@atdot.net>

gc.c

rename rb_heap_t::page_length to rb_heap_t::total_pages. `page_length'
is not clear (we may understand with length of a page).

Fri Jan 8 17:07:14 2016 Koichi Sasada <ko1@atdot.net>

gc.c

remove heap_page::heap. This field is only used to recognize whether a page
is in a tomb or not. Instead of this field, heap_page::flags::in_tomb (1
bit field) is added. Also type of heap_page::(total|free|final)_slots are
changed from int to short. 2B is enough for them.