Skip to content

Commit 0124377

Browse files
committed
Merge tag 'v2_1_2' into merge-upstream-2.1.2
Conflicts: ChangeLog ext/readline/extconf.rb
2 parents 215a869 + e9dce8d commit 0124377

32 files changed

+329
-72
lines changed

ChangeLog

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,127 @@ Thu Mar 6 10:33:31 2014 Martin Bosslet <[email protected]>
1111
Reported by Jeff Hodges.
1212
[ruby-core:59829] [Bug #9424]
1313

14+
Thu May 8 01:13:10 2014 NARUSE, Yui <[email protected]>
15+
16+
* configure.in: correct pthread_setname_np's prototype on NetBSD.
17+
[Bug #9586]
18+
19+
Tue May 6 00:54:56 2014 Narihiro Nakamura <[email protected]>
20+
21+
* gc.c (gc_after_sweep): suppress unnecessary expanding heap.
22+
Tomb heap pages are freed pages here, so expanding heap is
23+
not required.
24+
25+
Mon May 5 02:35:20 2014 Nobuyoshi Nakada <[email protected]>
26+
27+
* ext/openssl/ossl_pkey.c (ossl_pkey_verify): as EVP_VerifyFinal()
28+
finalizes only a copy of the digest context, the context must be
29+
cleaned up after initialization by EVP_MD_CTX_cleanup() or a
30+
memory leak will occur. [ruby-core:62038] [Bug #9743]
31+
32+
Mon May 5 02:21:48 2014 Nobuyoshi Nakada <[email protected]>
33+
34+
* ext/dl/cptr.c (dlptr_free), ext/dl/handle.c (dlhandle_free),
35+
ext/fiddle/handle.c (fiddle_handle_free),
36+
ext/fiddle/pointer.c (fiddle_ptr_free): fix memory leak.
37+
based on the patch Heesob Park at [ruby-dev:48021] [Bug #9599].
38+
39+
Mon May 5 01:20:27 2014 Eric Wong <[email protected]>
40+
41+
* gc.c (rb_gc_writebarrier): drop special case for big hash/array
42+
[Bug #9518]
43+
44+
Mon May 5 01:13:00 2014 Koichi Sasada <[email protected]>
45+
46+
* gc.c (gc_before_sweep): cap `malloc_limit' to
47+
gc_params.malloc_limit_max. It can grow and grow with such case:
48+
`loop{"a" * (1024 ** 2)}'
49+
[Bug #9687]
50+
51+
This issue is pointed by Tim Robertson.
52+
http://www.omniref.com/blog/blog/2014/03/27/ruby-garbage-collection-still-not-ready-for-production/
53+
54+
Mon May 5 00:52:18 2014 Kenta Murata <[email protected]>
55+
56+
* ext/bigdecimal/bigdecimal.c (BigDecimal_initialize): Insert GC guard.
57+
58+
* ext/bigdecimal/bigdecimal.c (BigDecimal_global_new): ditto.
59+
60+
Mon May 5 00:42:35 2014 SHIBATA Hiroshi <[email protected]>
61+
62+
* ext/psych/psych.gemspec: update gemspec for psych-2.0.5
63+
64+
Mon May 5 00:42:35 2014 SHIBATA Hiroshi <[email protected]>
65+
66+
* ext/psych/lib/psych.rb: Merge psych-2.0.5. bump version to
67+
libyaml-0.1.6 for CVE-2014-2525.
68+
* ext/psych/yaml/config.h: ditto.
69+
* ext/psych/yaml/scanner.c: ditto.
70+
* ext/psych/yaml/yaml_private.h: ditto.
71+
72+
Mon May 5 00:35:20 2014 Aaron Patterson <[email protected]>
73+
74+
* ext/psych/lib/psych/visitors/yaml_tree.rb: support dumping Encoding
75+
objects.
76+
77+
* ext/psych/lib/psych/visitors/to_ruby.rb: support loading Encoding
78+
objects.
79+
80+
* test/psych/test_encoding.rb: add test
81+
82+
* ext/psych/lib/psych.rb: add version
83+
84+
Mon May 5 00:16:35 2014 SHIBATA Hiroshi <[email protected]>
85+
86+
* gc.c: Fix up default GC params by @csfrancis [fix GH-556]
87+
88+
Fri May 2 00:19:36 2014 Nobuyoshi Nakada <[email protected]>
89+
90+
* ext/openssl/ossl.c (ossl_make_error): check NULL for unknown
91+
error reasons with old OpenSSL, and insert a colon iff formatted
92+
message is not empty.
93+
94+
Thu May 1 20:56:56 2014 Nobuyoshi Nakada <[email protected]>
95+
96+
* ext/readline/extconf.rb (rl_hook_func_t): check pointer type.
97+
[ruby-dev:48089] [Bug #9702]
98+
99+
Thu May 1 20:47:08 2014 Nobuyoshi Nakada <[email protected]>
100+
101+
* ext/readline/extconf.rb: fix typo, `$defs` not `$DEFS`.
102+
[ruby-core:61756] [Bug #9578]
103+
104+
Thu May 1 20:47:08 2014 Nobuyoshi Nakada <[email protected]>
105+
106+
* ext/readline/extconf.rb (rl_hook_func_t): define as Function for
107+
very old readline versions. [ruby-core:61209] [Bug #9578]
108+
109+
Thu May 1 20:47:08 2014 Tanaka Akira <[email protected]>
110+
111+
* ext/readline/readline.c (Init_readline): Use rl_hook_func_t instead
112+
of Function to support readline-6.3. (rl_hook_func_t is available
113+
since readline-4.2.)
114+
Reported by Dmitry Medvinsky. [ruby-core:61141] [Bug #9578]
115+
116+
Sat Mar 1 21:00:27 2014 Marc-Andre Lafortune <[email protected]>
117+
118+
* proc.c: Having optional keyword arguments makes maximum arity +1,
119+
not unlimited [#8072]
120+
121+
Sat Mar 1 17:25:12 2014 Marc-Andre Lafortune <[email protected]>
122+
123+
* proc.c: Having any mandatory keyword argument increases min arity
124+
[#9299]
125+
126+
Mon Feb 24 14:56:41 2014 WATANABE Hirofumi <[email protected]>
127+
128+
* tool/make-snapshot: needs CXXFLAGS. [ruby-core:59393][Bug #9320]
129+
130+
Mon Feb 24 14:56:41 2014 NAKAMURA Usaku <[email protected]>
131+
132+
* tool/make-snapshot: support new version scheme.
133+
>>>>>>> v2_1_2
134+
14135
Mon Feb 24 13:05:48 2014 Aaron Patterson <[email protected]>
15136

16137
* ext/psych/lib/psych.rb: New release of psych.

configure.in

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2455,6 +2455,36 @@ if test x"$enable_pthread" = xyes; then
24552455
else
24562456
AC_CHECK_FUNCS(pthread_attr_init)
24572457
fi
2458+
if test "$ac_cv_func_pthread_setname_np" = yes; then
2459+
AC_CACHE_CHECK([arguments of pthread_setname_np], [rb_cv_func_pthread_setname_np_arguments],
2460+
[rb_cv_func_pthread_setname_np_arguments=
2461+
# Linux,AIX, (pthread_self(), name)
2462+
# NetBSD (pthread_self(), name, \"%s\")
2463+
# Darwin (name)
2464+
for mac in \
2465+
"(pthread_self(), name)" \
2466+
"(pthread_self(), name, \"%s\")" \
2467+
"(name)" \
2468+
; do
2469+
AC_TRY_COMPILE([
2470+
@%:@include <pthread.h>
2471+
@%:@ifdef HAVE_PTHREAD_NP_H
2472+
@%:@include <pthread_np.h>
2473+
@%:@endif
2474+
@%:@define SET_THREAD_NAME(name) pthread_setname_np${mac}
2475+
],
2476+
[if (SET_THREAD_NAME("conftest")) return 1;],
2477+
[rb_cv_func_pthread_setname_np_arguments="${mac}"
2478+
break])
2479+
done
2480+
]
2481+
)
2482+
if test -n "${rb_cv_func_pthread_setname_np_arguments}"; then
2483+
AC_DEFINE_UNQUOTED(SET_THREAD_NAME(name), pthread_setname_np${rb_cv_func_pthread_setname_np_arguments})
2484+
else
2485+
AC_DEFINE_UNQUOTED(SET_THREAD_NAME(name), (void)0)
2486+
fi
2487+
fi
24582488
fi
24592489
if test x"$ac_cv_header_ucontext_h" = xyes; then
24602490
if test x"$rb_with_pthread" = xyes; then

ext/bigdecimal/bigdecimal.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2456,9 +2456,11 @@ static Real *BigDecimal_new(int argc, VALUE *argv);
24562456
static VALUE
24572457
BigDecimal_initialize(int argc, VALUE *argv, VALUE self)
24582458
{
2459+
ENTER(1);
24592460
Real *pv = rb_check_typeddata(self, &BigDecimal_data_type);
2460-
Real *x = BigDecimal_new(argc, argv);
2461+
Real *x;
24612462

2463+
GUARD_OBJ(x, BigDecimal_new(argc, argv));
24622464
if (ToValue(x)) {
24632465
pv = VpCopy(pv, x);
24642466
}
@@ -2539,7 +2541,10 @@ BigDecimal_new(int argc, VALUE *argv)
25392541
static VALUE
25402542
BigDecimal_global_new(int argc, VALUE *argv, VALUE self)
25412543
{
2542-
Real *pv = BigDecimal_new(argc, argv);
2544+
ENTER(1);
2545+
Real *pv;
2546+
2547+
GUARD_OBJ(pv, BigDecimal_new(argc, argv));
25432548
if (ToValue(pv)) pv = VpCopy(NULL, pv);
25442549
pv->obj = TypedData_Wrap_Struct(rb_cBigDecimal, &BigDecimal_data_type, pv);
25452550
return pv->obj;

ext/dl/cptr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ dlptr_free(void *ptr)
4949
(*(data->free))(data->ptr);
5050
}
5151
}
52+
xfree(ptr);
5253
}
5354

5455
static size_t

ext/dl/handle.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ dlhandle_free(void *ptr)
3838
if( dlhandle->ptr && dlhandle->open && dlhandle->enable_close ){
3939
dlclose(dlhandle->ptr);
4040
}
41+
xfree(ptr);
4142
}
4243

4344
static size_t

ext/fiddle/handle.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ fiddle_handle_free(void *ptr)
4040
if( fiddle_handle->ptr && fiddle_handle->open && fiddle_handle->enable_close ){
4141
dlclose(fiddle_handle->ptr);
4242
}
43+
xfree(ptr);
4344
}
4445

4546
static size_t

ext/fiddle/pointer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ fiddle_ptr_free(void *ptr)
5656
(*(data->free))(data->ptr);
5757
}
5858
}
59+
xfree(ptr);
5960
}
6061

6162
static size_t

ext/openssl/ossl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,11 @@ ossl_make_error(VALUE exc, const char *fmt, va_list args)
311311
else
312312
msg = ERR_reason_error_string(e);
313313
if (NIL_P(str)) {
314-
str = rb_str_new_cstr(msg);
314+
if (msg) str = rb_str_new_cstr(msg);
315315
}
316316
else {
317-
rb_str_cat2(rb_str_cat2(str, ": "), msg);
317+
if (RSTRING_LEN(str)) rb_str_cat2(str, ": ");
318+
rb_str_cat2(str, msg ? msg : "(null)");
318319
}
319320
}
320321
if (dOSSL == Qtrue){ /* show all errors on the stack */

ext/openssl/ossl_pkey.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,16 @@ ossl_pkey_verify(VALUE self, VALUE digest, VALUE sig, VALUE data)
318318
{
319319
EVP_PKEY *pkey;
320320
EVP_MD_CTX ctx;
321+
int result;
321322

322323
GetPKey(self, pkey);
323-
EVP_VerifyInit(&ctx, GetDigestPtr(digest));
324324
StringValue(sig);
325325
StringValue(data);
326+
EVP_VerifyInit(&ctx, GetDigestPtr(digest));
326327
EVP_VerifyUpdate(&ctx, RSTRING_PTR(data), RSTRING_LEN(data));
327-
switch (EVP_VerifyFinal(&ctx, (unsigned char *)RSTRING_PTR(sig), RSTRING_LENINT(sig), pkey)) {
328+
result = EVP_VerifyFinal(&ctx, (unsigned char *)RSTRING_PTR(sig), RSTRING_LENINT(sig), pkey);
329+
EVP_MD_CTX_cleanup(&ctx);
330+
switch (result) {
328331
case 0:
329332
return Qfalse;
330333
case 1:

ext/psych/lib/psych.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#
2222
# Psych is a YAML parser and emitter.
2323
# Psych leverages libyaml [Home page: http://pyyaml.org/wiki/LibYAML]
24-
# or [Git repo: https://github.com/zerotao/libyaml] for its YAML parsing
24+
# or [HG repo: https://bitbucket.org/xi/libyaml] for its YAML parsing
2525
# and emitting capabilities. In addition to wrapping libyaml, Psych also
2626
# knows how to serialize and de-serialize most Ruby objects to and from
2727
# the YAML format.
@@ -217,7 +217,7 @@
217217

218218
module Psych
219219
# The version is Psych you're using
220-
VERSION = '2.0.3'
220+
VERSION = '2.0.5'
221221

222222
# The version of libyaml Psych is using
223223
LIBYAML_VERSION = Psych.libyaml_version.join '.'

0 commit comments

Comments
 (0)