**Bug** in jitter

  • Thread starter Thread starter Lee Alexander
  • Start date Start date
L

Lee Alexander

Hello,
I have spent the past four days nailing down what looks to me like a bug in
the jitter.

Problem
~~~~~~
When my program is run without the debugger attached in release an object is
disposed of whilst execution is still in one of it's methods. I have a C#
application talking to a managed C++ data access layer that then talks to a
managed/unmanaged data access engine. It's whilst in the unmanaged portion
that the object is incorrectly disposed via a system triggered GC.

Workaround
~~~~~~~~~
I have turned off via the linker optimisations for the offending module.

Reproducible code
~~~~~~~~~~~~~
I have a reproducible console based test application that demonstrates the
problem. Unfortunately because it uses the data access engine I cannot post
the code directly here. I only have authorisation to email the source / test
app to a MS employee.

Regards
Lee
 
Lee Alexander said:
Hello,
I have spent the past four days nailing down what looks to me like a bug in
the jitter.

Problem
~~~~~~
When my program is run without the debugger attached in release an object is
disposed of whilst execution is still in one of it's methods. I have a C#
application talking to a managed C++ data access layer that then talks to a
managed/unmanaged data access engine. It's whilst in the unmanaged portion
that the object is incorrectly disposed via a system triggered GC.

Sounds like a known issue:

http://blogs.gotdotnet.com/cbrumme/commentview.aspx/e55664b4-6471-48b9-b360-f0fa27ab6cc0
http://blogs.gotdotnet.com/anathan/commentview.aspx/8ec0b7b2-6290-4500-a8c7-1b6c677214cb

Ken
 
Ken,

Thanks very much for that. GC.KeepAlive fixed it! Unbelievable I never would
have thought that the GC could collect an object whose methods are still
running. I'll have to run some of these debug probes on my application.

Thanks again

Regards
Lee
 
Back
Top