YAML/Psych stack error

10 views
Skip to first unread message

Thomas Buschhardt

unread,
Feb 27, 2013, 8:05:41 AM2/27/13
to rub...@googlegroups.com
Hallo,

I got an error if I try YAML (or Psych):

require 'ruboto/util/stack'
with_large_stack{require 'yaml'}
a={:lis=>[1,2]}
YAML.dump(a)

=> Stack too deep

Greets Thomas

Scott Moyer

unread,
Feb 27, 2013, 9:35:38 AM2/27/13
to rub...@googlegroups.com

Does it go away if you move the code into the with_large_stack block?

require 'ruboto/util/stack'
with_large_stack do


  require 'yaml'
  a={:lis=>[1,2]}
  YAML.dump(a)

end

Thomas Buschhardt

unread,
Feb 27, 2013, 9:39:47 AM2/27/13
to rub...@googlegroups.com
Hallo Scott,

yes it works.

Scott Moyer

unread,
Feb 27, 2013, 9:47:09 AM2/27/13
to rub...@googlegroups.com

I suspect there are many ways to trigger the stack limit (especially under older versions of Android). The fix is always to move things out of the UI thread to a thread with a larger stack.

On Feb 27, 2013 6:39 AM, "Thomas Buschhardt" <busch...@gmail.com> wrote:
Hallo Scott,

yes it works.

--
You received this message because you are subscribed to the Google Groups "Ruboto (JRuby on Android)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruboto+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages