Interpreting report

A null value was encountered where this forum description was required.
Post Reply
IngeJones
Reactions:
Posts: 32
Joined: November 11th, 2013, 6:00 pm

Interpreting report

Post by IngeJones » June 5th, 2013, 4:25 am

Is there any documentation on how to read the error report? Eg "
#1: 0x0008d callvirt in Sims3.Gameplay.ActorSystems.Sims3.Gameplay.ActorSystems.InteractionQueue:InsertInteraction (Sims3.Gameplay.Interactions.InteractionInstance,int) (10B1D780 [5E2FC138] [0] )

I'd like to know what all the numbers represent, if that's possible, to help me trace my script error.

User avatar
twallan
Reactions:
Posts: 270
Joined: December 26th, 2011, 6:00 pm

Post by twallan » June 5th, 2013, 1:29 pm


Well, you load up that routine in whatever reflection program you are using, switch over to displaying the raw CIL, and then take your best guess.

The line numbers almost never line up properly, so it becomes more of an art attempting to determine where the error occurred in larger routines.

If that log happens to be a "System.NullReferenceException" error, my guess would be that "mActor.Autonomy" is null.

:)

User avatar
twallan
Reactions:
Posts: 270
Joined: December 26th, 2011, 6:00 pm

Post by twallan » June 5th, 2013, 1:36 pm


Ah, but you are being sneaky I see. "#1" is the second line in the stack trace, not the first one, so my interpretation would be incorrect.

Still the approach is the same, using the "#0" line instead.

Smaller routines are easier to interpret because the line numbers only start to diverge the further into the routine the error occurs.

For larger routines, adding additional logging information into the script error helps with tracking down the fault.

You will find logging of that nature throughout Traveler for instance. "NRaas.TravelerSpace.States.InWorldStateEx:Startup" is an example.

IngeJones
Reactions:
Posts: 32
Joined: November 11th, 2013, 6:00 pm

Post by IngeJones » June 5th, 2013, 2:23 pm

My scripts are generally littered with various debugging output, but the problem here is that the sim was running original EA code on my object where I had been expecting it to run my own. I was wanting to trace back through the stack and see what induced it to retrieve the base class and treat my object as the original bed. I *may* have partially found out now, so back to testing in game :)

I wasn't asking for a translation of the numbers so much as what they signify. For example, are the ones in brackets after the call (10B1D780 [5E2FC138] [0] ) the values of the parameters?

User avatar
twallan
Reactions:
Posts: 270
Joined: December 26th, 2011, 6:00 pm

Post by twallan » June 5th, 2013, 2:30 pm


In your example :
<ul><li>10B1D780 is the address to the object running the routine</li><li>[5E2FC138] is the address to the reference object passed into the first parameter</li><li>[0] is the value "0" passed as an integer</li></ul>

IngeJones
Reactions:
Posts: 32
Joined: November 11th, 2013, 6:00 pm

Post by IngeJones » June 5th, 2013, 2:48 pm

So that 0x0008d is therefore supposed to be the line number? (of course I know it won't match as it doesn't take into account comment lines etc).

User avatar
twallan
Reactions:
Posts: 270
Joined: December 26th, 2011, 6:00 pm

Post by twallan » June 5th, 2013, 2:52 pm


Comment lines are not compiled into CIL. You would need to view the original compilation to find where line "8D" is might to reside.

For instance, here is .NET Reflector's interpretation of that function :
<!-- ws:start:WikiTextCodeRule:0:
<pre class="text">.method private hidebysig instance bool InsertInteraction(class Sims3.Gameplay.Interactions.InteractionInstance entry, int32 index) cil managed<br/>{<br/> .maxstack 4<br/> .locals init (<br/> [0] object[] objArray)<br/> L_0000: ldarg.1 <br/> L_0001: callvirt instance bool Sims3.Gameplay.Interactions.InteractionInstance::get_Autonomous()<br/> L_0006: brfalse.s L_002c<br/> L_0008: ldarg.1 <br/> L_0009: callvirt instance class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.Interactions.InteractionInstance::get_InstanceActor()<br/> L_000e: callvirt instance bool Sims3.Gameplay.Actors.Sim::get_IsSelectable()<br/> L_0013: brfalse.s L_002c<br/> L_0015: ldc.i4 0x23d<br/> L_001a: ldnull <br/> L_001b: ldarg.1 <br/> L_001c: callvirt instance uint64 Sims3.Gameplay.Interactions.InteractionInstance::get_GroupId()<br/> L_0021: newobj instance void Sims3.Gameplay.EventSystem.GuidEvent`1&lt;uint64&gt;::.ctor(valuetype Sims3.Gameplay.EventSystem.EventTypeId, class Sims3.Gameplay.Interfaces.IActor, !0)<br/> L_0026: call class Sims3.Gameplay.EventSystem.Event Sims3.Gameplay.EventSystem.EventTracker::SendEvent(class Sims3.Gameplay.EventSystem.Event)<br/> L_002b: pop <br/> L_002c: ldarg.0 <br/> L_002d: ldfld class [mscorlib]System.Collections.Generic.List`1&lt;class Sims3.Gameplay.Interactions.InteractionInstance&gt; Sims3.Gameplay.ActorSystems.InteractionQueue::mInteractionList<br/> L_0032: callvirt instance int32 [mscorlib]System.Collections.Generic.List`1&lt;class Sims3.Gameplay.Interactions.InteractionInstance&gt;::get_Count()<br/> L_0037: ldc.i4 0xc8<br/> L_003c: blt.s L_0083<br/> L_003e: ldarg.0 <br/> L_003f: ldfld class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.ActorSystems.InteractionQueue::mActor<br/> L_0044: callvirt instance void Sims3.Gameplay.Abstracts.GameObject::SetObjectToReset()<br/> L_0049: ldc.i4.4 <br/> L_004a: newarr object<br/> L_004f: stloc.0 <br/> L_0050: ldloc.0 <br/> L_0051: ldc.i4.0 <br/> L_0052: ldstr &quot;Too many interaction queue entries (&quot;<br/> L_0057: stelem.ref <br/> L_0058: ldloc.0 <br/> L_0059: ldc.i4.1 <br/> L_005a: ldarg.0 <br/> L_005b: ldfld class [mscorlib]System.Collections.Generic.List`1&lt;class Sims3.Gameplay.Interactions.InteractionInstance&gt; Sims3.Gameplay.ActorSystems.InteractionQueue::mInteractionList<br/> L_0060: callvirt instance int32 [mscorlib]System.Collections.Generic.List`1&lt;class Sims3.Gameplay.Interactions.InteractionInstance&gt;::get_Count()<br/> L_0065: box int32<br/> L_006a: stelem.ref <br/> L_006b: ldloc.0 <br/> L_006c: ldc.i4.2 <br/> L_006d: ldstr &quot;) and trying to insert &quot;<br/> L_0072: stelem.ref <br/> L_0073: ldloc.0 <br/> L_0074: ldc.i4.3 <br/> L_0075: ldarg.1 <br/> L_0076: stelem.ref <br/> L_0077: ldloc.0 <br/> L_0078: call string [mscorlib]System.String::Concat(object[])<br/> L_007d: newobj instance void [mscorlib]System.ApplicationException::.ctor(string)<br/> L_0082: throw <br/> L_0083: ldarg.0 <br/> L_0084: ldfld class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.ActorSystems.InteractionQueue::mActor<br/> L_0089: callvirt instance class Sims3.Gameplay.Autonomy.Autonomy Sims3.Gameplay.Actors.Sim::get_Autonomy()<br/> L_008e: ldarg.1 <br/> L_008f: ldfld class Sims3.Gameplay.Autonomy.InteractionObjectPair Sims3.Gameplay.Interactions.InteractionInstance::InteractionObjectPair<br/> L_0094: callvirt instance void Sims3.Gameplay.Autonomy.Autonomy::AssignTraitDeterminingLastDecision(class Sims3.Gameplay.Autonomy.InteractionObjectPair)<br/> L_0099: ldarg.1 <br/> L_009a: brtrue.s L_009e<br/> L_009c: ldc.i4.0 <br/> L_009d: ret <br/> L_009e: ldarg.1 <br/> L_009f: callvirt instance class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.Interactions.InteractionInstance::get_InstanceActor()<br/> L_00a4: brfalse.s L_00b4<br/> L_00a6: ldarg.1 <br/> L_00a7: callvirt instance class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.Interactions.InteractionInstance::get_InstanceActor()<br/> L_00ac: ldarg.0 <br/> L_00ad: ldfld class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.ActorSystems.InteractionQueue::mActor<br/> L_00b2: pop <br/> L_00b3: pop <br/> L_00b4: ldarg.1 <br/> L_00b5: callvirt instance bool Sims3.Gameplay.Interactions.InteractionInstance::Test()<br/> L_00ba: brtrue.s L_00ca<br/> L_00bc: ldarg.1 <br/> L_00bd: ldarg.1 <br/> L_00be: callvirt instance class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.Interactions.InteractionInstance::get_InstanceActor()<br/> L_00c3: callvirt instance void Sims3.Gameplay.Interactions.InteractionInstance::CallCallbackOnFailure(class Sims3.Gameplay.Actors.Sim)<br/> L_00c8: ldc.i4.0 <br/> L_00c9: ret <br/> L_00ca: ldarg.0 <br/> L_00cb: ldfld class [mscorlib]System.Collections.Generic.List`1&lt;class Sims3.Gameplay.Interactions.InteractionInstance&gt; Sims3.Gameplay.ActorSystems.InteractionQueue::mInteractionList<br/> L_00d0: ldarg.2 <br/> L_00d1: ldarg.1 <br/> L_00d2: callvirt instance void [mscorlib]System.Collections.Generic.List`1&lt;class Sims3.Gameplay.Interactions.InteractionInstance&gt;::Insert(int32, !0)<br/> L_00d7: ldarg.1 <br/> L_00d8: callvirt instance void Sims3.Gameplay.Interactions.InteractionInstance::OnAddedToQueue()<br/> L_00dd: ldarg.0 <br/> L_00de: call instance void Sims3.Gameplay.ActorSystems.InteractionQueue::RemoveLowerPriorityInteractions()<br/> L_00e3: ldarg.1 <br/> L_00e4: ldarg.0 <br/> L_00e5: ldftn instance void Sims3.Gameplay.ActorSystems.InteractionQueue::RemoveLowerPriorityInteractions()<br/> L_00eb: newobj instance void Sims3.Gameplay.Interactions.InteractionInstance/InteractionPriorityChanged::.ctor(object, native int)<br/> L_00f0: stfld class Sims3.Gameplay.Interactions.InteractionInstance/InteractionPriorityChanged Sims3.Gameplay.Interactions.InteractionInstance::InteractionPriorityChangedCallback<br/> L_00f5: ldarg.0 <br/> L_00f6: ldfld class Sims3.Gameplay.ActorSystems.InteractionQueue/QueueChangedCallback Sims3.Gameplay.ActorSystems.InteractionQueue::QueueChanged<br/> L_00fb: brfalse.s L_0108<br/> L_00fd: ldarg.0 <br/> L_00fe: ldfld class Sims3.Gameplay.ActorSystems.InteractionQueue/QueueChangedCallback Sims3.Gameplay.ActorSystems.InteractionQueue::QueueChanged<br/> L_0103: callvirt instance void Sims3.Gameplay.ActorSystems.InteractionQueue/QueueChangedCallback::Invoke()<br/> L_0108: ldc.i4.1 <br/> L_0109: ret <br/>}</pre>
-->
<style type="text/css"><!--
/**
* GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
* (http://qbnz.com/highlighter/ and http://geshi.org/)
*/
.text {font-family:monospace;}
.text .imp {font-weight: bold; color: red;}
.text span.xtra { display:block; }

-->
</style><pre class="text">.method private hidebysig instance bool InsertInteraction(class Sims3.Gameplay.Interactions.InteractionInstance entry, int32 index) cil managed
{
.maxstack 4
.locals init (
[0] object[] objArray)
L_0000: ldarg.1
L_0001: callvirt instance bool Sims3.Gameplay.Interactions.InteractionInstance::get_Autonomous()
L_0006: brfalse.s L_002c
L_0008: ldarg.1
L_0009: callvirt instance class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.Interactions.InteractionInstance::get_InstanceActor()
L_000e: callvirt instance bool Sims3.Gameplay.Actors.Sim::get_IsSelectable()
L_0013: brfalse.s L_002c
L_0015: ldc.i4 0x23d
L_001a: ldnull
L_001b: ldarg.1
L_001c: callvirt instance uint64 Sims3.Gameplay.Interactions.InteractionInstance::get_GroupId()
L_0021: newobj instance void Sims3.Gameplay.EventSystem.GuidEvent`1<uint64>::.ctor(valuetype Sims3.Gameplay.EventSystem.EventTypeId, class Sims3.Gameplay.Interfaces.IActor, !0)
L_0026: call class Sims3.Gameplay.EventSystem.Event Sims3.Gameplay.EventSystem.EventTracker::SendEvent(class Sims3.Gameplay.EventSystem.Event)
L_002b: pop
L_002c: ldarg.0
L_002d: ldfld class [mscorlib]System.Collections.Generic.List`1<class Sims3.Gameplay.Interactions.InteractionInstance> Sims3.Gameplay.ActorSystems.InteractionQueue::mInteractionList
L_0032: callvirt instance int32 [mscorlib]System.Collections.Generic.List`1<class Sims3.Gameplay.Interactions.InteractionInstance>::get_Count()
L_0037: ldc.i4 0xc8
L_003c: blt.s L_0083
L_003e: ldarg.0
L_003f: ldfld class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.ActorSystems.InteractionQueue::mActor
L_0044: callvirt instance void Sims3.Gameplay.Abstracts.GameObject::SetObjectToReset()
L_0049: ldc.i4.4
L_004a: newarr object
L_004f: stloc.0
L_0050: ldloc.0
L_0051: ldc.i4.0
L_0052: ldstr "Too many interaction queue entries ("
L_0057: stelem.ref
L_0058: ldloc.0
L_0059: ldc.i4.1
L_005a: ldarg.0
L_005b: ldfld class [mscorlib]System.Collections.Generic.List`1<class Sims3.Gameplay.Interactions.InteractionInstance> Sims3.Gameplay.ActorSystems.InteractionQueue::mInteractionList
L_0060: callvirt instance int32 [mscorlib]System.Collections.Generic.List`1<class Sims3.Gameplay.Interactions.InteractionInstance>::get_Count()
L_0065: box int32
L_006a: stelem.ref
L_006b: ldloc.0
L_006c: ldc.i4.2
L_006d: ldstr ") and trying to insert "
L_0072: stelem.ref
L_0073: ldloc.0
L_0074: ldc.i4.3
L_0075: ldarg.1
L_0076: stelem.ref
L_0077: ldloc.0
L_0078: call string [mscorlib]System.String::Concat(object[])
L_007d: newobj instance void [mscorlib]System.ApplicationException::.ctor(string)
L_0082: throw
L_0083: ldarg.0
L_0084: ldfld class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.ActorSystems.InteractionQueue::mActor
L_0089: callvirt instance class Sims3.Gameplay.Autonomy.Autonomy Sims3.Gameplay.Actors.Sim::get_Autonomy()
L_008e: ldarg.1
L_008f: ldfld class Sims3.Gameplay.Autonomy.InteractionObjectPair Sims3.Gameplay.Interactions.InteractionInstance::InteractionObjectPair
L_0094: callvirt instance void Sims3.Gameplay.Autonomy.Autonomy::AssignTraitDeterminingLastDecision(class Sims3.Gameplay.Autonomy.InteractionObjectPair)
L_0099: ldarg.1
L_009a: brtrue.s L_009e
L_009c: ldc.i4.0
L_009d: ret
L_009e: ldarg.1
L_009f: callvirt instance class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.Interactions.InteractionInstance::get_InstanceActor()
L_00a4: brfalse.s L_00b4
L_00a6: ldarg.1
L_00a7: callvirt instance class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.Interactions.InteractionInstance::get_InstanceActor()
L_00ac: ldarg.0
L_00ad: ldfld class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.ActorSystems.InteractionQueue::mActor
L_00b2: pop
L_00b3: pop
L_00b4: ldarg.1
L_00b5: callvirt instance bool Sims3.Gameplay.Interactions.InteractionInstance::Test()
L_00ba: brtrue.s L_00ca
L_00bc: ldarg.1
L_00bd: ldarg.1
L_00be: callvirt instance class Sims3.Gameplay.Actors.Sim Sims3.Gameplay.Interactions.InteractionInstance::get_InstanceActor()
L_00c3: callvirt instance void Sims3.Gameplay.Interactions.InteractionInstance::CallCallbackOnFailure(class Sims3.Gameplay.Actors.Sim)
L_00c8: ldc.i4.0
L_00c9: ret
L_00ca: ldarg.0
L_00cb: ldfld class [mscorlib]System.Collections.Generic.List`1<class Sims3.Gameplay.Interactions.InteractionInstance> Sims3.Gameplay.ActorSystems.InteractionQueue::mInteractionList
L_00d0: ldarg.2
L_00d1: ldarg.1
L_00d2: callvirt instance void [mscorlib]System.Collections.Generic.List`1<class Sims3.Gameplay.Interactions.InteractionInstance>::Insert(int32, !0)
L_00d7: ldarg.1
L_00d8: callvirt instance void Sims3.Gameplay.Interactions.InteractionInstance::OnAddedToQueue()
L_00dd: ldarg.0
L_00de: call instance void Sims3.Gameplay.ActorSystems.InteractionQueue::RemoveLowerPriorityInteractions()
L_00e3: ldarg.1
L_00e4: ldarg.0
L_00e5: ldftn instance void Sims3.Gameplay.ActorSystems.InteractionQueue::RemoveLowerPriorityInteractions()
L_00eb: newobj instance void Sims3.Gameplay.Interactions.InteractionInstance/InteractionPriorityChanged::.ctor(object, native int)
L_00f0: stfld class Sims3.Gameplay.Interactions.InteractionInstance/InteractionPriorityChanged Sims3.Gameplay.Interactions.InteractionInstance::InteractionPriorityChangedCallback
L_00f5: ldarg.0
L_00f6: ldfld class Sims3.Gameplay.ActorSystems.InteractionQueue/QueueChangedCallback Sims3.Gameplay.ActorSystems.InteractionQueue::QueueChanged
L_00fb: brfalse.s L_0108
L_00fd: ldarg.0
L_00fe: ldfld class Sims3.Gameplay.ActorSystems.InteractionQueue/QueueChangedCallback Sims3.Gameplay.ActorSystems.InteractionQueue::QueueChanged
L_0103: callvirt instance void Sims3.Gameplay.ActorSystems.InteractionQueue/QueueChangedCallback::Invoke()
L_0108: ldc.i4.1
L_0109: ret
}</pre>


IngeJones
Reactions:
Posts: 32
Joined: November 11th, 2013, 6:00 pm

Post by IngeJones » June 5th, 2013, 2:54 pm

Ugh!! But thanks anyway. I'll see if I can pluck up the courage :D

User avatar
twallan
Reactions:
Posts: 270
Joined: December 26th, 2011, 6:00 pm

Post by twallan » June 5th, 2013, 2:54 pm


However, as you can see, its interpretation does not have a "L_008d" line number, so they don't really line up.

So one takes a reasonable guess as to where the line number is supposed to be, either based on the type of error that was received, or based on the next stack frame.

User avatar
J4Ks
Reactions:
Posts: 2580
Joined: September 7th, 2013, 6:00 pm
Location: SomewhereNearYou:-)

Post by J4Ks » January 8th, 2014, 10:51 am

REVIEW FOR DOCUMENTATION, handy for someone who wants to learn more about reading errortraps

Post Reply