How to break on First-chance exception Microsoft C++ exception: Js::JavascriptExceptionObject at memory location 0x03CEE0E4 RRS feed

  • Question

  • I see some 

    First-chance exception at 0x74AB56C4 in WWAHost.exe: Microsoft C++ exception: Js::JavascriptExceptionObject at memory location 0x03CEE0E4.

    in the debug output when debugging native code. Is there a way to break into the debugger right at the moment this exception is thrown?

    Monday, April 16, 2012 1:15 PM

All replies

  • Hi Phil,

    Yes, change your debugging type to C++ and you can enable 1st chance exceptions.

    Right click on your project and choose properties.

    In the configuration Properties, Debugging section set the Debugger Type to 'Native Only'.

    Then from the Debug menu choose Exceptions, you can add your exception or break on all exceptions when thrown.


    Jeff Sanders (MSFT)

    Tuesday, April 17, 2012 2:07 PM
  • Found the symbols... Now I am getting this:

     	KernelBase.dll!RaiseException()	Unknown
     	msvcrt.dll!_CxxThrowException()	Unknown
     	jscript9.dll!Js::JavascriptExceptionOperators::ThrowExceptionObjectInternal(class Js::JavascriptExceptionObject *,class Js::ScriptContext *,bool,bool,void *)	Unknown
     	jscript9.dll!Js::JavascriptExceptionOperators::ThrowExceptionObject(class Js::JavascriptExceptionObject *,class Js::ScriptContext *,bool,void *)	Unknown
     	jscript9.dll!Js::JavascriptExceptionOperators::Throw(void *,class Js::ScriptContext *)	Unknown
    >	jscript9.dll!Js::JavascriptError::ThrowWinRTError(class Js::ScriptContext *,long,struct tagEXCEPINFO *,struct IErrorInfo *,struct Js::RestrictedErrorStrings *,bool)	Unknown
     	jscript9.dll!__chkstk()	Unknown
     	jscript9.dll!Js::JavascriptErrorDebug::MapAndThrowErrorWithInfo(class Js::ScriptContext *,long)	Unknown
     	jscript9.dll!Projection::FastPathOut<1,struct Projection::RuntimeClassTraits>(void *,struct Js::CallInfo,...)	Unknown
     	jscript9.dll!amd64_CallFunction()	Unknown
     	jscript9.dll!Js::JavascriptFunction::CallFunction(class Js::RecyclableObject *,void * (*)(class Js::RecyclableObject *,struct Js::CallInfo,...),struct Js::Arguments)	Unknown
     	jscript9.dll!Js::JavascriptFunction::CallFunction(struct Js::Arguments)	Unknown
     	jscript9.dll!Projection::ProjectionWriter::DelayedFunctionOfSignatureThunk(void *,struct Js::CallInfo,...)	Unknown
     	jscript9.dll!amd64_CallFunction()	Unknown
     	jscript9.dll!Js::InterpreterStackFrame::OP_CallCommon<struct Js::OpLayoutDynamicProfile<struct Js::OpLayoutCallI_OneByte> >(struct Js::OpLayoutDynamicProfile<struct Js::OpLayoutCallI_OneByte> const *,class Js::RecyclableObject *,unsigned int)	Unknown
     	jscript9.dll!Js::InterpreterStackFrame::Process(void)	Unknown
     	jscript9.dll!Js::InterpreterStackFrame::OP_TryCatch(unsigned char const * &,struct Js::OpLayoutTry const *)	Unknown
     	jscript9.dll!Js::InterpreterStackFrame::Process(void)	Unknown
     	jscript9.dll!Js::InterpreterStackFrame::InterpreterThunk<1>(class Js::JavascriptCallStackLayout *)	Unknown
     	000000d19f6c0a43()	Unknown
     	jscript9.dll!amd64_CallFunction()	Unknown
     	jscript9.dll!Js::JavascriptFunction::CallFunction(class Js::RecyclableObject *,void * (*)(class Js::RecyclableObject *,struct Js::CallInfo,...),struct Js::Arguments)	Unknown
     	jscript9.dll!Js::JavascriptFunction::CallFunction(struct Js::Arguments)	Unknown
     	jscript9.dll!Projection::Delegate::Invoke(struct Projection::StackVarArg *,unsigned long *)	Unknown
     	jscript9.dll!Projection::CUnknownImpl::CallIndirect(unsigned long,void *,unsigned long *)	Unknown
     	jscript9.dll!IndirectMethodInvoker()	Unknown
     	rpcrt4.dll!Invoke()	Unknown
     	rpcrt4.dll!NdrStubCall2()	Unknown
     	rpcrt4.dll!NdrStubCall3()	Unknown
     	combase.dll!CStdStubBuffer_Invoke()	Unknown
     	combase.dll!SyncStubInvoke(struct tagRPCOLEMESSAGE *,struct _GUID const &,class CIDObject *,void *,struct IRpcChannelBuffer *,struct IRpcStubBuffer *,unsigned long *)	Unknown
     	combase.dll!CCtxComChnl::ContextInvoke(struct tagRPCOLEMESSAGE *,struct IRpcStubBuffer *,struct tagIPIDEntry *,unsigned long *)	Unknown
     	combase.dll!ComInvokeWithLockAndIPID(class CMessageCall *,struct tagIPIDEntry *)	Unknown
     	combase.dll!ComInvoke(class CMessageCall *)	Unknown
     	combase.dll!ThreadDispatch(class CMessageCall *)	Unknown
     	combase.dll!CComApartment::ASTAHandleMessage(class IMessageParam *)	Unknown
     	combase.dll!ASTAWaitContext::Wait(unsigned int,void * const *,unsigned long,struct ASTAWaitContext::ProcessEventsMsgWaitParams *,unsigned long *)	Unknown
     	combase.dll!ASTAWait(enum BlockingReason,unsigned int,void * const *,unsigned long,unsigned long,unsigned long,unsigned int *,unsigned long *)	Unknown
     	combase.dll!ASTAThreadWaitForCall(class CMessageCall *)	Unknown
     	combase.dll!ThreadSendReceive(class CMessageCall *)	Unknown
     	combase.dll!CRpcChannelBuffer::SendReceive2(struct tagRPCOLEMESSAGE *,unsigned long *)	Unknown
     	combase.dll!CCtxComChnl::SendReceive(struct tagRPCOLEMESSAGE *,unsigned long *)	Unknown
     	combase.dll!NdrExtpProxySendReceive(void *,struct _MIDL_STUB_MESSAGE *)	Unknown
     	rpcrt4.dll!NdrpClientCall3()	Unknown
    Do I have to worry?
    looks like a calling convention missing/wrong

    • Edited by phil_ke Tuesday, April 17, 2012 3:22 PM
    Tuesday, April 17, 2012 3:16 PM
  • That looks like a JS exception to me. I'd switch back to script debugging to figure out what it is. When dealing with hybrid apps I often flip back and forth between debugging script and debugging native. Writing a bunch of unit tests for your native component can help a lot here.

    I think it is possible to VS and another debugger like WinDBG (http://msdn.microsoft.com/en-us/windows/hardware/gg463009) if you attach VS to the Script side first and then attach WinDBG to the native side of things. Of course, just be aware that you can get yourself into situations like the above where WinDBG breaks at a first chance exception that you'd really want to handle with your script debugger.



    Tuesday, April 17, 2012 3:58 PM
  • Switching to JS debugger does not show any exception.

    I am slowly tracking this down. Found already a suspicious behaviour of Windows.Storage.ApplicationData.current.localFolder. See here http://social.msdn.microsoft.com/Forums/en-US/winappswithhtml5/thread/845dfa42-db7d-4f98-bcf1-8836ee9ee076

    Tuesday, April 17, 2012 4:24 PM
  • Can you get us a simple repro of this Phil?

    Jeff Sanders (MSFT)

    Tuesday, April 17, 2012 4:28 PM
  • Not yet, Jeff. I am hunting down the exact source of this exception right now. Meanwhile I have found another strange exception that is thrown:


    Tuesday, April 17, 2012 4:35 PM