arcade icon indicating copy to clipboard operation
arcade copied to clipboard

Update CLRMD in RemoteExecutor

Open danmoseley opened this issue 3 years ago • 11 comments

This utility, used by the libraries tests, uses clrmd for creating dumps and logging info out of them when a (child) process hangs:

https://github.com/dotnet/arcade/blob/49750c02e63d0ad3a77d035bba7498a0b1acd218/src/Microsoft.DotNet.RemoteExecutor/src/RemoteInvokeHandle.cs#L178-L211

It's using Microsoft.Diagnostics.Runtime 1.0.5 - I went to update it to the latest but I see a bunch of API has changed/gone.

@leculver I see you did a lot of work for 2.0.x -- are there improvements in 2.0.x that might be worth us updating this? Note that it’s wired up to only work on Windows right now – it would be interesting to have it work on Unix.

Otherwise I’ll leave as is.

cc @stephentoub who added it

danmoseley avatar Feb 18 '22 01:02 danmoseley

ClrMD 2.0 does work on Unix (both linux and os x), and overall it's a much better product. I think some of those specific apis (IsThreadpool*) are missing, but IIRC that's just an oversight. If you decide to do an update of the tool I can add those APIs to 2.0 and ship a new build. There's already an issue for those missing apis...

leculver avatar Feb 22 '22 18:02 leculver

@leculver it is working fine, so low priority, but if and when you do plug those gaps let me know and I'll make the update.

danmoseley avatar Mar 03 '22 05:03 danmoseley

Just to note. The version of Microsoft.Diagnostics.Runtime currently used makes it impossible to use RemoteExecutor in a project referencing BenchmarkDotNet 13.0.10 due to API changes.

System.MissingMethodException : Method not found: 'Microsoft.Diagnostics.Runtime.DataTarget Microsoft.Diagnostics.Runtime.DataTarget.AttachToProcess(Int32, UInt32)'.

JimBobSquarePants avatar Dec 04 '23 04:12 JimBobSquarePants

Ah I forgot about this issue. It wasn't assigned to me so it wasn't on my radar. The missing pieces should be there in ClrMD 3.1. They are just under the thread's status. If I remember, I will take a look at this when I'm back from vacation on the 20th.

leculver avatar Dec 04 '23 13:12 leculver

That would be awesome!

JimBobSquarePants avatar Dec 06 '23 11:12 JimBobSquarePants