Status: New
Owner: ----

New issue 3024 by [email protected]: TryCatch::Exception Crashing on Access after Checks.
http://code.google.com/p/v8/issues/detail?id=3024

How the TryCatch that's causing this issue is being called.
Local<Value> executeFunction(Isolate* iso, const Persistent<Function>& fnc, Handle<Object> recv, int argc, Handle<Value> argv[])
        {
                TryCatch tryCatch;

Local<Value> retVal = Handle<Function>::New(iso, fnc)->Call(recv, argc, argv);

                if(tryCatch.HasCaught())
                {
                        ExceptionUtility::reportException(iso, tryCatch);
                        return Undefined();
                }
                else
                        return retVal;
        }


And its crashing in here.

        void reportException(Isolate* iso, const TryCatch& tryCatch)
        {
                path logScriptDirectory = path("logs/script");

if((exists(logScriptDirectory) && is_directory(logScriptDirectory)) || create_directories(logScriptDirectory))
                {
                        HandleScope scope(iso);

                        Handle<Message> msg = tryCatch.Message();

                        if(!msg.IsEmpty())
                        {
                                if(!msg->GetScriptResourceName().IsEmpty())
                                {
                                        string filename = 
*String::AsciiValue(msg->GetScriptResourceName());
                                        Utility::trace("Script Error Occurred In: 
" + filename);
                                
                                        Local<Value> tce = tryCatch.Exception();

                                        if(!tce.IsEmpty())
                                        {
                                                if(!tce->IsNull() && 
!tce->IsUndefined())
                                                {
                                                        std::string estr = 
*String::AsciiValue(tce->ToString()); // Here
                                                        Utility::trace("Exception 
Was: " + estr);
                                                }
                                        }
                                }
                        }
                }
        }

Not sure how this is crashing at all, as I've tried dropping several different variations of the checks over the local exception object before doing anything with it, and every time this function crashes the program that its running inside when called from the function callback section, when called in the main script compilation however it works as intended without any issues.


--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to