[#62297] Re: [ruby-cvs:52906] nari:r45760 (trunk): * gc.c (gc_after_sweep): suppress unnecessary expanding heap. — Eric Wong <normalperson@...>
[email protected] wrote:
7 messages
2014/05/02
[#62307] Re: [ruby-cvs:52906] nari:r45760 (trunk): * gc.c (gc_after_sweep): suppress unnecessary expanding heap.
— SASADA Koichi <ko1@...>
2014/05/03
(2014/05/03 4:41), Eric Wong wrote:
[#62402] Re: [ruby-cvs:52906] nari:r45760 (trunk): * gc.c (gc_after_sweep): suppress unnecessary expanding heap.
— Eric Wong <normalperson@...>
2014/05/05
SASADA Koichi <[email protected]> wrote:
[#62523] [ruby-trunk - Feature #9632] [PATCH 0/2] speedup IO#close with linked-list from ccan — ko1@...
Issue #9632 has been updated by Koichi Sasada.
3 messages
2014/05/11
[#62556] doxygen (Re: Re: [ruby-trunk - Feature #9632] [PATCH 0/2] speedup IO#close with linked-list from ccan) — Tanaka Akira <akr@...>
2014-05-11 8:50 GMT+09:00 Eric Wong <[email protected]>:
3 messages
2014/05/13
[#62727] [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl — Eric Wong <normalperson@...>
rb_unlink_method_entry may cause old_me to be swept before the new
7 messages
2014/05/24
[#63039] Re: [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl
— SASADA Koichi <ko1@...>
2014/06/10
Hi,
[#63077] Re: [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl
— Eric Wong <normalperson@...>
2014/06/10
SASADA Koichi <[email protected]> wrote:
[#63086] Re: [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl
— SASADA Koichi <ko1@...>
2014/06/11
(2014/06/11 4:47), Eric Wong wrote:
[#63087] Re: [RFC] vm_method.c (rb_method_entry_make): avoid freed me in m_tbl
— Eric Wong <normalperson@...>
2014/06/11
SASADA Koichi <[email protected]> wrote:
[#62862] [RFC] README.EXT: document rb_gc_register_mark_object — Eric Wong <normalperson@...>
Any comment on officially supporting this as part of the C API?
5 messages
2014/05/30
[ruby-core:62800] [ruby-trunk - Bug #9709] Large string causes SEGV with x64-mingw32
From:
nagachika00@...
Date:
2014-05-27 15:37:27 UTC
List:
ruby-core #62800
Issue #9709 has been updated by Tomoyuki Chikanaga.
Backport changed from 1.9.3: REQUIRED, 2.0.0: DONE, 2.1: REQUIRED to 1.9.3: REQUIRED, 2.0.0: DONE, 2.1: DONE
r45534 was backported into `ruby_2_1` branch at r46187.
----------------------------------------
Bug #9709: Large string causes SEGV with x64-mingw32
https://bugs.ruby-lang.org/issues/9709#change-46919
* Author: Hiroshi Shirosaki
* Status: Closed
* Priority: Normal
* Assignee:
* Category:
* Target version:
* ruby -v: ruby 2.2.0dev (2014-04-07 trunk 45529) [x64-mingw32]
* Backport: 1.9.3: REQUIRED, 2.0.0: DONE, 2.1: DONE
----------------------------------------
Creating large string causes SEGV with x64-mingw32 on Windows.
test.rb
~~~
A = ""
1000000.times do |i|
A << "a" * 100000
end
~~~
gdb backtrace of `./miniruby test.rb`
~~~
Program received signal SIGSEGV, Segmentation fault.
0x000007fefe88120b in msvcrt!memmove () from C:\Windows\system32\msvcrt.dll
(gdb) bt
#0 0x000007fefe88120b in msvcrt!memmove () from C:\Windows\system32\msvcrt.dll
#1 0x000000000054e404 in str_buf_cat (str=str@entry=115691040, ptr=ptr@entry=0x7b510e0 'a' <repeats 200 times>...,
len=len@entry=100000) at ../../../ruby/string.c:2042
#2 0x000000000054e90a in rb_enc_cr_str_buf_cat (str=str@entry=115691040, ptr=0x7b510e0 'a' <repeats 200 times>...,
len=100000, ptr_encindex=<optimized out>, ptr_cr=ptr_cr@entry=1048576, ptr_cr_ret=0x22eb10,
ptr_cr_ret@entry=0x22eaf0) at ../../../ruby/string.c:2164
#3 0x0000000000553c6c in rb_str_buf_append (str=115691040, str2=115660360) at ../../../ruby/string.c:2207
#4 0x0000000000553d9f in rb_str_append (str2=115660360, str=115691040) at ../../../ruby/string.c:2220
#5 rb_str_concat (str1=115691040, str2=115660360) at ../../../ruby/string.c:2256
#6 0x00000000005ac743 in vm_exec_core (th=0x768ce00, th@entry=0x0, initial=initial@entry=0)
at ../../../ruby/insns.def:1824
#7 0x00000000005ad661 in vm_exec (th=0x0) at ../../../ruby/vm.c:1328
#8 0x0000000000000000 in ?? ()
~~~
`capa` setting looks wrong in the following code. Here is a patch.
~~~
diff --git a/string.c b/string.c
index 511374c..8abfc25 100644
--- a/string.c
+++ b/string.c
@@ -2029,7 +2029,7 @@ str_buf_cat(VALUE str, const char *ptr, long len)
if (capa <= total) {
while (total > capa) {
if (capa + termlen >= LONG_MAX / 2) {
- capa = (total + 4095) / 4096;
+ capa = LONG_MAX - termlen;
break;
}
capa = (capa + termlen) * 2;
~~~
--
https://bugs.ruby-lang.org/