You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am seeing the NullReferenceException below when unit tests are being executed concurrently. It appears some reordering might be causing the double locking that is in place to not behave as expected.
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
at Jint.Runtime.Interop.DefaultTypeConverter.TryConvert(Object value, Type type, IFormatProvider formatProvider, Object& converted)
at Jint.Runtime.Descriptors.Specialized.IndexDescriptor..ctor(Engine engine, Type targetType, String key, Object item)
at Jint.Runtime.Interop.ObjectWrapper.<>c__DisplayClass9_0.<ResolveProperty>b__3(Engine engine, Object target)
at Jint.Runtime.Interop.ObjectWrapper.GetOwnProperty(String propertyName)
at Jint.Native.Object.ObjectInstance.Get(String propertyName)
at Jint.Engine.GetValue(Reference reference, Boolean returnReferenceToPool)
at Jint.Runtime.Interpreter.Expressions.JintBinaryExpression.JintGenericBinaryExpression.EvaluateInternal()
at Jint.Runtime.Interpreter.Expressions.JintExpression.GetValue()
at Jint.Runtime.Interpreter.Expressions.JintExpression.BuildArguments(JintExpression[] jintExpressions, JsValue[] targetArray)
at Jint.Runtime.Interpreter.Expressions.JintCallExpression.EvaluateInternal()
at Jint.Runtime.Interpreter.Expressions.JintExpression.GetValue()
at Jint.Runtime.Interpreter.Statements.JintExpressionStatement.ExecuteInternal()
at Jint.Runtime.Interpreter.JintStatementList.Execute()
at Jint.Engine.Execute(Program program)
I can confirm that the problem is not reproducible when using a ConcurrentDictionary<string, bool> instead of Dictionary<string, bool> with locking. I will submit a PR with these changes for your consideration.
The text was updated successfully, but these errors were encountered:
alexmg
added a commit
to alexmg/jint
that referenced
this issue
Apr 12, 2019
I am seeing the
NullReferenceException
below when unit tests are being executed concurrently. It appears some reordering might be causing the double locking that is in place to not behave as expected.I can confirm that the problem is not reproducible when using a
ConcurrentDictionary<string, bool>
instead ofDictionary<string, bool>
with locking. I will submit a PR with these changes for your consideration.The text was updated successfully, but these errors were encountered: