Search:
Namespaces
Discussions
.NET v1.1
Feedback
ICorProfilerInfo::SetFunctionReJIT causes deadlock
Messages
Related Types
This message was discovered on
microsoft.public.dotnet.framework.clr
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...
Marc Eaddy
I've implemented a CLR Profiler using ICorProfilerCallback and the Profiler
API. I'm calling ICorProfilerInfo::SetFunctionReJIT() from a separate
thread. However, ICorProfilerCallback::JITCompilationStarted() doesn't get
called. Instead, when the function that should be ReJIT'd is called, the
CLR Runtime hangs.
You can find a great description of the problem from here:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=O6I4CoegDHA.1932
%
40TK2MSFTNGP11.phx.gbl&rnum=2&prev=/groups%3Fq%3DSetFunctionReJIT%26hl%3Den%
26lr%3D%26ie%3DUTF-8%26selm%3DO6I4CoegDHA.1932%2540TK2MSFTNGP11.phx.gbl%26rnum%
3D2
Does Microsoft have a workaround for this?
Reply to this message...
Jonathan Keljo [MS] (VIP)
Sadly, no, we do not have a workaround for this. SetFunctionReJIT was never
really implemented, but also was never made to return E_NOTIMPL. :-(
We're hoping to implement SetFunctionReJIT in a future release, but
unfortunately it will not be in v2.0. (Though it will return E_NOTIMPL
rather than hanging your process.)
Jonathan
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Thread-Topic: ICorProfilerInfo::SetFunctionReJIT causes deadlock
| thread-index: AcSTIQID9Of9PvEIQXqpx6m9OxqttA==
| X-WBNR-Posting-Host: 66.108.183.152
| From: "=?Utf-8?B?TWFyYyBFYWRkeQ==?=" <me133 [at] columbia [dot] edu
REMOVE_IF_NOT_SPAM>
| Subject: ICorProfilerInfo::SetFunctionReJIT causes deadlock
| Date: Sun, 5 Sep 2004 01:19:05 -0700
| Lines: 14
| Message-ID: <
Click here to reveal e-mail address
>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.clr
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.clr:11787
| X-Tomcat-NG: microsoft.public.dotnet.framework.clr
|
| I've implemented a CLR Profiler using ICorProfilerCallback and the
Profiler
| API. I'm calling ICorProfilerInfo::SetFunctionReJIT() from a separate
| thread. However, ICorProfilerCallback::JITCompilationStarted() doesn't
get
| called. Instead, when the function that should be ReJIT'd is called, the
| CLR Runtime hangs.
|
| You can find a great description of the problem from here:
|
|
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=O6I4CoegDHA.1932
%
|
40TK2MSFTNGP11.phx.gbl&rnum=2&prev=/groups%3Fq%3DSetFunctionReJIT%26hl%3Den%
26lr%3D%26ie%3DUTF-8%26selm%3DO6I4CoegDHA.1932%2540TK2MSFTNGP11.phx.gbl%26rn
um%
| 3D2
|
| Does Microsoft have a workaround for this?
|
Reply to this message...
Marc Eaddy
Dear Jonathan,
Thanks for your reply. I was able to kludge this to work using a workaround
similar to the one Patrick Grawehr used. I really hope MSFT gets this to
work in 2.0. SetFunctionReJIT is extremely important for dynamic languages,
dynamically updateable software, aspect-oriented programming, interception,
you name it! Its an amazingly cool function!
Cheers,
\\Marc
""Jonathan Keljo [MS]"" wrote:
[Original message clipped]
Reply to this message...
Jonathan Keljo [MS] (VIP)
Most of what you mention--"dynamic languages, dynamically updateable
software, aspect-oriented programming"--I don't recommend implementing via
the profiling API. The profiling API is intended for diagnostic
purposes--"profiling," to use the term a bit loosely. Using it to implement
AOP or self-modifying code is an interesting experiment, but should not be
done for production code. For one thing, the requirement of having a
profiler in the process for the correct operation of the application will
make it impossible to attach a real performance or memory profiler when you
have perf issues, or to use other diagnostic tools that are
profiling-API-based. Eventually we hope to support AOP and such through
less kludgey means, but that's a ways off yet.
Jonathan
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Thread-Topic: ICorProfilerInfo::SetFunctionReJIT causes deadlock
| thread-index: AcSVTUluHGKp1GWfThWS1AFKctiT/g==
| X-WBNR-Posting-Host: 66.108.183.152
| From: "=?Utf-8?B?TWFyYyBFYWRkeQ==?=" <me133 [at] columbia [dot] edu
REMOVE_IF_NOT_SPAM>
| References: <
Click here to reveal e-mail address
>
<
Click here to reveal e-mail address
>
| Subject: RE: ICorProfilerInfo::SetFunctionReJIT causes deadlock
| Date: Tue, 7 Sep 2004 19:41:05 -0700
| Lines: 72
| Message-ID: <
Click here to reveal e-mail address
>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.clr
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.clr:11807
| X-Tomcat-NG: microsoft.public.dotnet.framework.clr
|
| Dear Jonathan,
|
| Thanks for your reply. I was able to kludge this to work using a
workaround
| similar to the one Patrick Grawehr used. I really hope MSFT gets this to
| work in 2.0. SetFunctionReJIT is extremely important for dynamic
languages,
| dynamically updateable software, aspect-oriented programming,
interception,
| you name it! Its an amazingly cool function!
|
| Cheers,
|
| \\Marc
|
| ""Jonathan Keljo [MS]"" wrote:
|
| > Sadly, no, we do not have a workaround for this. SetFunctionReJIT was
never
| > really implemented, but also was never made to return E_NOTIMPL. :-(
| >
| > We're hoping to implement SetFunctionReJIT in a future release, but
| > unfortunately it will not be in v2.0. (Though it will return E_NOTIMPL
| > rather than hanging your process.)
| >
| > Jonathan
| >
| > This posting is provided "AS IS" with no warranties, and confers no
rights.
| >
| > --------------------
| > | Thread-Topic: ICorProfilerInfo::SetFunctionReJIT causes deadlock
| > | thread-index: AcSTIQID9Of9PvEIQXqpx6m9OxqttA==
| > | X-WBNR-Posting-Host: 66.108.183.152
| > | From: "=?Utf-8?B?TWFyYyBFYWRkeQ==?=" <me133 [at] columbia [dot] edu
| > REMOVE_IF_NOT_SPAM>
| > | Subject: ICorProfilerInfo::SetFunctionReJIT causes deadlock
| > | Date: Sun, 5 Sep 2004 01:19:05 -0700
| > | Lines: 14
| > | Message-ID: <
Click here to reveal e-mail address
>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.clr
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
| > | Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.clr:11787
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.clr
| > |
| > | I've implemented a CLR Profiler using ICorProfilerCallback and the
| > Profiler
| > | API. I'm calling ICorProfilerInfo::SetFunctionReJIT() from a
separate
| > | thread. However, ICorProfilerCallback::JITCompilationStarted()
doesn't
| > get
| > | called. Instead, when the function that should be ReJIT'd is called,
the
| > | CLR Runtime hangs.
| > |
| > | You can find a great description of the problem from here:
| > |
| > |
| >
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=O6I4CoegDHA.1932
%
| > |
| >
40TK2MSFTNGP11.phx.gbl&rnum=2&prev=/groups%3Fq%3DSetFunctionReJIT%26hl%3Den%
| >
26lr%3D%26ie%3DUTF-8%26selm%3DO6I4CoegDHA.1932%2540TK2MSFTNGP11.phx.gbl%26rn
| > um%
| > | 3D2
| > |
| > | Does Microsoft have a workaround for this?
| > |
| >
| >
|
Reply to this message...
Marc Eaddy
Thanks for your reply. I really appreciate your feedback.
The main reason why the Profiling API is used is 1) transparent and dynamic
interception/aspect-weaving, and 2) performance. I would love to see a
managed API that supported these features. Or alternatively, a Profiling API
that supported multiple profilers, perhaps by chaining profilers.
The way I plan to work around around the two-profiler problem is to add
"normal" profiling functionality to my implementation. There are publicly
available sources on MSDN for both performance and memory profilers using the
Profiler API. If worse comes to worse, I can disable my profiler if I need
to use a different one.
Can you think of any other reasons why using the Profiling API for
DL/DUS/AOP isn't recommended for production code?
""Jonathan Keljo [MS]"" wrote:
[Original message clipped]
Reply to this message...
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com