Join GitHub today
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Object obj; When we do obj = new object ; Then a new object is created on the heap and the reference to that newly created object is assigned to variable obj. If obj contains null and you try to perform any operation on object obj you will get a NUll referenceException or Object reference not set to an instance of an object.
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upHave a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
commented Oct 1, 2018 • edited
edited
I'm getting an intermittent AmqpException being thrown, where the exception message is 'Object reference not set to an instance of an object' thrown from SenderLink.Async(Message, TimeSpan). I haven't been able to figure out the source of the exception because the exception and line number reported don't align with the current version of the source code - possibly because it's compiled for Release rather than Debug? The only exception info that I have is below. Amqp.AmqpException: Object reference not set to an instance of an object. at Amqp.SenderLink.SendAsync(Message message, TimeSpan timeout) in C:Usersmqtrepoamqpnetlite.relsrcNetTaskExtensions.cs:line 218 The exception tends to be thrown after 10 minutes or so of sending under load. I'm using the latest version (v2.1.4) of AMQPNetLite.Core and AMQPNetLite.Serialization. |
commented Oct 2, 2018
Okay, I've done a bunch more analysis to find where the exception is occurring. The exception being thrown in the SenderLink.Async(Message, TimeSpan) method is actually at line 211 in TaskExtensions.cs: However, the originating exception is actually being thrown in ReceiverLink.cs at line 540: From there it's bubbling up to the Connection object. The stack trace I get is: From there, it seems to make its way to be an Outcome of a SendTask, passed as the outcome parameter of the OnOutcome callback method in the SendTask class in TaskExtensions.cs at line 289. The OnOutcome method then finds that the descriptor code of the outcome is Rejected.Code and then invokes: Line 211 in TaskExtensions.cs then throws this exception, and this also explains why there is no stack trace in the exception beyond the SendAsync method call on line 211 of TaskExtensions.cs. So it seems that the timer field in the ReceiverLink class isn't guaranteed to be non-null when Signal(Message) is invoked. |
added a commit that referenced this issue Oct 3, 2018
commented Oct 3, 2018
Thanks for finding the bug. You are right. A message could arrive before the timer is initialized in the waiter. |
commented Oct 12, 2018
Is it possible to get a new release containing this fix? |
commented Oct 12, 2018
Release 2.1.5. |
commented Oct 13, 2018
Thank you! |
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment