Discussion:
ICorProfilerInfo::SetFunctionReJIT causes deadlock
(too old to reply)
Marc Eaddy
2004-09-05 08:19:05 UTC
Permalink
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?
Jonathan Keljo [MS]
2004-09-07 17:32:40 UTC
Permalink
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-***@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?
|
Marc Eaddy
2004-09-08 02:41:05 UTC
Permalink
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
Post by Jonathan Keljo [MS]
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
| 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.
|
|
|
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?
|
Jonathan Keljo [MS]
2004-09-08 16:39:11 UTC
Permalink
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-***@microsoft.com>
<***@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-***@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-***@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?
| > |
| >
| >
|

Loading...