[#35027] [Ruby 1.9-Bug#4352][Open] [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s) — "James M. Lawrence" <redmine@...>
Bug #4352: [patch] Fix eval(s, b) backtrace; make eval(s, b) consistent with eval(s)
Issue #4352 has been updated by James M. Lawrence.
Hi,
On Wed, Feb 2, 2011 at 10:47 AM, Yusuke ENDOH <mame@tsg.ne.jp> wrote:
Hi,
[#35036] [Ruby 1.9-Bug#4354][Open] File.realdirpath is expected to test for real file. — Luis Lavena <redmine@...>
Bug #4354: File.realdirpath is expected to test for real file.
[#35055] [Ruby 1.9-Bug#4359][Open] regular expressions created with Regexp::FIXEDENCODING have incorrect inspect — Aaron Patterson <redmine@...>
Bug #4359: regular expressions created with Regexp::FIXEDENCODING have incorrect inspect
[#35071] Bug in system()? — Anthony Wright <anthony@...>
I've just hit a problem where the system() method to call an external program failed in a fairly unpredictable way, and I couldn't get any clues from within ruby to diagnose the problem. As a result I ended up debugging process.c to work out what the problem was.
[#35100] [Ruby 1.9-Bug#4370][Open] Abort trap in net/http — David Phillips <redmine@...>
Bug #4370: Abort trap in net/http
[#35114] [Ruby 1.9-Bug#4373][Open] http.rb:677: [BUG] Segmentation fault — Christian Fazzini <redmine@...>
Bug #4373: http.rb:677: [BUG] Segmentation fault
[#35144] Documentation Clarifications to Array methods rotate, rotate!, index, and rindex — Loren Sands-Ramshaw <lorensr@...>
Tue Feb 8 11:47:11 2011 Loren Sands-Ramshaw <lorensr@gmail.com>
[#35146] [Ruby 1.9-Bug#4383][Assigned] psych fails to parse a symbol in a flow sequence — Yuki Sonoda <redmine@...>
Bug #4383: psych fails to parse a symbol in a flow sequence
[#35167] Redmine misconfigured (was Re: Re: [Ruby 1.9-Bug#4340] Encoding of result string for String#gsub is not consistent) — mathew <meta@...>
On Tue, Feb 8, 2011 at 16:27, Eric Hodel <drbrain@segment7.net> wrote:
[#35171] [Ruby 1.9-Bug#4386][Open] encoding: directive does not affect regex expressions — mathew murphy <redmine@...>
Bug #4386: encoding: directive does not affect regex expressions
[#35202] Patch to Net::InternetMessageIO — Daniel Cormier <daniel.cormier@...>
This patch addresses an issue when sending a message with Net::SMTP
On Fri, Feb 11, 2011 at 09:13, Daniel Cormier <daniel.cormier@gmail.com> wrote:
Perhaps that is a better solution, but shouldn't sending a message
On Fri, Feb 11, 2011 at 17:08, Daniel Cormier <daniel.cormier@gmail.com> wrote:
Ok, but since the period escaping is already being done (just with
[#35237] [Ruby 1.9-Bug#4400][Open] nested at_exit hooks run in strange order — Suraj Kurapati <redmine@...>
Bug #4400: nested at_exit hooks run in strange order
Issue #4400 has been updated by Motohiro KOSAKI.
[#35332] [ANN] Planned maintenance of redmine.ruby-lang.org — "Yuki Sonoda (Yugui)" <yugui@...>
-----BEGIN PGP SIGNED MESSAGE-----
-----BEGIN PGP SIGNED MESSAGE-----
[#35340] odd require behavior — Roger Pack <rogerdpack2@...>
Hello all.
[#35355] eval'ing large strings runs out of stack space? — Roger Pack <rogerdpack2@...>
Hello all.
[#35356] suggestion: default irb to saving history — Roger Pack <rogerdpack2@...>
Hello all.
[#35376] [Ruby 1.9 - Feature #4447] [Open] add String#byteslice() method — Suraj Kurapati <sunaku@...>
string.force_encoding(ENCODING::BINARY).slice almost does what you want,
[ruby-core:35359] Re: eval'ing large strings runs out of stack space?
On 2/23/11 7:55 PM, Ryan Davis wrote:
>
> 10003 % ruby19 -v -e 'eval (["000000000"]*500000).inspect'
> ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.5.0]
> (eval):0: stack level too deep (SystemStackError)
> 10004 % ruby -v -e 'eval (["000000000"]*500000).inspect'
> ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
> 10005 %
#inspect isn't the problem:
> ruby-1.9.2-p136 --version -e '(['000000000']*500000).inspect'
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.6.0]
My guess (I don't know 1.9 very well, yet.):
The issue may be related to the parse.y args -> aref_args production.
the args grammer production is left-recursive.
http://www.gnu.org/software/bison/manual/html_node/Recursion.html
"Any kind of sequence can be defined using either left recursion or
right recursion, but you should always use left recursion, because it
can parse a sequence of any number of elements with bounded stack space.
Right recursion uses up space on the Bison stack in proportion to the
number of elements in the sequence, because all the elements must be
shifted onto the stack before the rule can be applied even once. See The
Bison Parser Algorithm, for further explanation of this. "
I'm not sure if this also implies C stack usage but it maybe due to
mmap()'ed fiber stacks. Does changing
FIBER_MACHINE_STACK_ALLOCATION_SIZE help?
It might be triggered by the mprotect() in cont.c or here:
vm_eval.c:1028
/* kick */
CHECK_STACK_OVERFLOW(th->cfp, iseq->stack_max);
> gdb --args ./ruby -e 'eval((["000000000"] * 500000).inspect)'
GNU gdb 6.3.50-20050815 (Apple version gdb-1510) (Wed Sep 22 02:45:02
UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for
shared libraries ... done
(gdb) b rb_exc_raise
The program is not being run.
(gdb) r
Starting program: /Users/stephens/local/src/ruby-trunk-git/ruby -e
eval\(\(\[\"000000000\"\]\ \*\ 500000\).inspect\)
Reading symbols for shared libraries ++... done
Breakpoint 1, rb_exc_raise (mesg=4303807840) at eval.c:461
warning: Source file is more recent than executable.
461 {
(gdb) c
Continuing.
Breakpoint 1, rb_exc_raise (mesg=4303798400) at eval.c:461
461 {
(gdb) c
Continuing.
Breakpoint 1, rb_exc_raise (mesg=4303796920) at eval.c:461
461 {
(gdb) c
Continuing.
Breakpoint 1, rb_exc_raise (mesg=4303729480) at eval.c:461
461 {
(gdb) c
Continuing.
Breakpoint 1, rb_exc_raise (mesg=4303728360) at eval.c:461
461 {
(gdb) c
Continuing.
Breakpoint 1, rb_exc_raise (mesg=4303824080) at eval.c:461
461 {
(gdb) bt
#0 rb_exc_raise (mesg=4303824080) at eval.c:461
#1 0x000000010016c870 in eval_string_with_cref (self=4303884640,
src=4303721440, scope=4, cref=0x0, file=0x100199113 "(eval)", line=1) at
vm_eval.c:1019
#2 0x000000010016cb02 in rb_f_eval (argc=1, argv=<value temporarily
unavailable, due to optimizations>, self=4303884640) at vm_eval.c:1062
#3 0x0000000100175bf1 in vm_call_cfunc [inlined] () at
/Users/stephens/local/src/ruby-trunk-git/vm_insnhelper.c:402
#4 0x0000000100175bf1 in vm_call_method (th=0x1003016b0,
cfp=0x1004ffef8, num=1, blockptr=0x1, flag=8, id=<value temporarily
unavailable, due to optimizations>, me=0x10031d440, recv=4303884640) at
vm_insnhelper.c:524
#5 0x0000000100163f45 in vm_exec_core (th=0x1003016b0, initial=<value
temporarily unavailable, due to optimizations>) at insns.def:1006
#6 0x000000010016bb83 in vm_exec (th=0x1003016b0) at vm.c:1145
#7 0x000000010016be8f in rb_iseq_eval_main (iseqval=4303721960) at
vm.c:1386
#8 0x000000010003bb22 in ruby_exec_internal (n=0x1008595e8) at eval.c:214
#9 0x000000010003e4ec in ruby_exec_node [inlined] () at
/Users/stephens/local/src/ruby-trunk-git/eval.c:261
#10 0x000000010003e4ec in ruby_run_node (n=<value temporarily
unavailable, due to optimizations>) at eval.c:254
#11 0x000000010000086f in main (argc=3, argv=0x7fff5fbfec50) at main.c:35
(gdb) c
Continuing.
Breakpoint 1, rb_exc_raise (mesg=4303824080) at eval.c:461
461 {
(gdb) bt
#0 rb_exc_raise (mesg=4303824080) at eval.c:461
#1 0x000000010016c4e8 in eval_string_with_cref (self=4303884640,
src=4303721440, scope=4, cref=0x0, file=0x100199113 "(eval)", line=1) at
vm_eval.c:1052
#2 0x000000010016cb02 in rb_f_eval (argc=1, argv=<value temporarily
unavailable, due to optimizations>, self=4303884640) at vm_eval.c:1062
#3 0x0000000100175bf1 in vm_call_cfunc [inlined] () at
/Users/stephens/local/src/ruby-trunk-git/vm_insnhelper.c:402
#4 0x0000000100175bf1 in vm_call_method (th=0x1003016b0,
cfp=0x1004ffef8, num=1, blockptr=0x1, flag=8, id=<value temporarily
unavailable, due to optimizations>, me=0x10031d440, recv=4303884640) at
vm_insnhelper.c:524
#5 0x0000000100163f45 in vm_exec_core (th=0x1003016b0, initial=<value
temporarily unavailable, due to optimizations>) at insns.def:1006
#6 0x000000010016bb83 in vm_exec (th=0x1003016b0) at vm.c:1145
#7 0x000000010016be8f in rb_iseq_eval_main (iseqval=4303721960) at
vm.c:1386
#8 0x000000010003bb22 in ruby_exec_internal (n=0x1008595e8) at eval.c:214
#9 0x000000010003e4ec in ruby_exec_node [inlined] () at
/Users/stephens/local/src/ruby-trunk-git/eval.c:261
#10 0x000000010003e4ec in ruby_run_node (n=<value temporarily
unavailable, due to optimizations>) at eval.c:254
#11 0x000000010000086f in main (argc=3, argv=0x7fff5fbfec50) at main.c:35
(gdb) c
Continuing.
(eval):0: stack level too deep (SystemStackError)
Program exited with code 01.
(gdb)
-- Kurt