RE: ICorProfilerInfo::SetFunctionReJIT causes deadlock

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jonathan Keljo [MS] (jkeljo_at_online.microsoft.com)
Date: 09/08/04


Date: Wed, 08 Sep 2004 16:39:11 GMT

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: <132B42E7-935A-401B-8E2D-9DF275E582C3@microsoft.com>
<tF0FyCQlEHA.2516@cpmsftngxa10.phx.gbl>
| Subject: RE: ICorProfilerInfo::SetFunctionReJIT causes deadlock
| Date: Tue, 7 Sep 2004 19:41:05 -0700
| Lines: 72
| Message-ID: <76CDE565-F409-4A21-8EDA-78AECA1C160B@microsoft.com>
| 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: <132B42E7-935A-401B-8E2D-9DF275E582C3@microsoft.com>
| > | 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?
| > |
| >
| >
|



Relevant Pages

  • RE: Accessing the CLR Heap at runtime?
    ... I am not aware of how the .Net Memory Profiler is implemented. ... "The .NET Profiling API and the DNProfiler Tool " ... ..Net CLR team also created a CLR Profiler with profiling API, ...
    (microsoft.public.dotnet.framework.clr)
  • Re: SQL Deadlock?
    ... If you want a concise analysis of the deadlock, there is a DBCC command that ... gives you the nitty-gritties which aren't included in the profiler output. ... This logs deadlock analysis reports to the sql log which you can interpret ...
    (microsoft.public.sqlserver.programming)
  • URGENT deadlock question
    ... Deadlock Chain ... SQL: Statement Completed ... Profiler is running and another Deadlock occurs 10 minutes later. ... In my SQL Error Log, there are about 30 lines of info per deadlock. ...
    (microsoft.public.sqlserver.server)
  • =?ISO-8859-1?Q?Re=3A_Deadlock_bei_Tabelle_bef=FCllen?=
    ... den Ladeprozess mitprotokollieren und sich den Deadlock Graphen ausgeben ... Ich werde das mit dem Profiler versuchen - ich habe zwar noch nie ...
    (microsoft.public.de.sqlserver)
  • Re: SQL 2205, Profiler and Deadlocks
    ... Profiler probably DID record some useful information. ... trace that generated the deadlock trace before you can open the file. ... Deadlock Graph Event and I set the Events Extraction ...
    (microsoft.public.sqlserver.tools)