Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / December 2004

Tip: Looking for answers? Try searching our database.

NullReferenceException when assigning to out parameter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
flaming asparagus - 14 Dec 2004 18:17 GMT
I've got an intermittent exception that occurs roughly once every 80
hours, (once per 14 million calls of this routine).

I had the following line throwing on me:
objectResult = m_queue.Dequeue();

I broke up the lines into two:
object o = m_queue.Dequeue();
objectResult = o;

And saw the exception coming from the second line.
I added a retry loop around the assignment to objectResult, and I've
since reproduced the problem once, and the first retry failed again,
the second retry worked.

WTF?

Dual CPU machine w/ HT-enabled, 4 logical processors.
Running the "normal", non-server version of the CLR (bad idea?)

The out parameter exists on the client side like this:
object oResult;
WaitForResult( out oResult );

The out parameter gets passed through 4 functions which delegate to
other functions passing the out along the way. I've reproduced this in
both debug and release mode.

Thanks a ton,
-ken
rlander [MSFT] - 16 Dec 2004 22:36 GMT
I sent a link to this post the the CLR Stress team. They are going to
take a look at this. It will be at least 80 hours before I hear back
from them ;) Seriously, I'm not sure when I'll hear from them. If there
is a problem here, it will be fixed in the Whidbey product.
thanks -- rich
flaming asparagus - 27 Dec 2004 11:15 GMT
Thanks,

After switching to Server CLR this problem has not occured in 200+
hours.
Also, the NullReferenceException which is thrown sometimes re-throws a
NullReferenceException when ToString is called on it. I've seen this
before with exceptions coming out of unmanaged code, so I never call
ToString on exceptions directly, but I thought it might be indicative
of something.

-ken
Ravichandran J.V. - 17 Dec 2004 10:02 GMT
It could possibly be due to so many references to the Out parameter that
may have something to do with Garbage Collection because the object is
being allocated memory on the heap.

with regards,

J.V.Ravichandran
Signature

- http://www.geocities.com/
 jvravichandran
- http://www.411asp.net/func/search?
 qry=Ravichandran+J.V.&cob=aspnetpro
- http://www.southasianoutlook.com 
- http://www.MSDNAA.Net 
- http://www.csharphelp.com
- http://www.poetry.com/Publications/
 display.asp?ID=P3966388&BN=999&PN=2
- Or, just search on "J.V.Ravichandran"
 at http://www.Google.com


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.