Funky results from v8 as it approaches the end of its stack space

25 views
Skip to first unread message

Marcel Laverdet

unread,
Sep 4, 2012, 5:43:55 AM9/4/12
to v8-users
Hey I'm seeing an issue where v8 starts behaving oddly when my embedded JS is reaching high stack space. I put together a simple example of this:

When I run this the print() function calls start getting "(null)" for the first parameter, but the correct value from "ii.toString()". I posted the output of the executable on my system as a comment on the gist, but at some point print() starts getting null before a throwing undefined shortly after:

0 0
1 1
2 2
3 3
4 4
5 5
...
15708 15708
15709 15709
(null) 15710
(null) 15711
(null) 15712
...
(null) 15737
(null) 15738
(null) 15739
caught:
undefined

Where my print() call looks like this:
print(ii, ii.toString());

Is this behavior expected? I'm currently troubleshooting an issue in node-fibers where I'm seeing segfaults at high stack space instead of the expected RangeError and I'm concerned that these issues are related.

On the other hand this is happening on bleeding_edge, as well as very old versions (I tested 3.6.6.25 for instance).

gcc version 4.5.3 both 32 and 64 bit; Linux 3.2.1

Yang Guo

unread,
Sep 14, 2012, 9:23:22 AM9/14/12
to v8-u...@googlegroups.com
Are you referring to V8's developer shell (d8)? This has been fixed. The reason is that v8::String::Utf8Value hides exceptions thrown when evaluating the object's toString() method, e.g. stack overflow. This has now been fixed in d8 (http://code.google.com/p/v8/issues/detail?id=2317).

Yang
Reply all
Reply to author
Forward
0 new messages