Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
V8 crashes without any stack info in backtrace
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mark Yap  
View profile  
 More options Nov 20 2012, 12:48 am
From: Mark Yap <mailmark...@gmail.com>
Date: Mon, 19 Nov 2012 21:48:54 -0800 (PST)
Local: Tues, Nov 20 2012 12:48 am
Subject: V8 crashes without any stack info in backtrace

Hi,

My embedded V8 application sometimes crashes without any backtrace info
when I debug the crash file in gdb.  Is
there any setting that needs to be enabled to get backtrace info so that it
is easier to debug?  I'm using debug version of v8.

The program below crashes with the below back trace if I fail to set the
arguments when calling a javascript function. Is there any easier way to
debug v8 when crashes with back traces like this occur?

(gdb) bt
#0  0x31a213ea in ?? ()
#1  0x5d334f11 in ?? ()
#2  0x5d3354c5 in ?? ()
#3  0x31a21381 in ?? ()
#4  0x0000000c in ?? ()
#5  0x00000000 in ?? ()

####
Handle<Value> LogCallback(const Arguments& args)
{
    String::Utf8Value val(args[0]);
    cout << *val << endl;
    return v8::Undefined();

}

int main()
{
    char *str = " function myfunc(obj) {    log('in myfunc....' + obj);  }
";

    HandleScope handleScope;

    // set global template
    Handle<ObjectTemplate> globalTemplate = ObjectTemplate::New();

globalTemplate->Set(String::New("log"),FunctionTemplate::New(LogCallback));

    // Create conext and enter
    Handle<Context> context = Context::New(NULL, globalTemplate);
    Context::Scope contextScope(context);

    // Compile Script
    Handle<String> scriptString = String::New(str);
    Handle<Script> compiledScript  = Script::Compile(scriptString);

    // Run script
    Handle<Value> result = compiledScript->Run();

    Handle<Value> value = context->Global()->Get(String::New("myfunc"));

    Handle<Function> function = Handle<Function>::Cast(value);
    int argc = 1;
    Handle<Value> args[argc];

    // Commenting the below line causes crash with no stack info
    //args[0] = String::New("teststring");

    function->Call(context->Global(), argc, args);

    return 0;

}

####

Thanks,
Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yang Guo  
View profile  
 More options Nov 26 2012, 4:41 am
From: Yang Guo <yang...@chromium.org>
Date: Mon, 26 Nov 2012 01:41:44 -0800 (PST)
Local: Mon, Nov 26 2012 4:41 am
Subject: Re: V8 crashes without any stack info in backtrace

There is no stack trace because the crash occurs in generated code. There
is no safety check for the argument of the function call, and since it's
not set, it's presumably NULL or some other invalid value. Upon access by
the function, you get a segfault. At this point, when you are in gdb
(running a binary that has debug symbols), you can use

print v8::internal::Isolate::Current()->PrintStack()

to print the javascript stack trace. I hope this helps.

Yang


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »