Attach to process .net core azure function runtime

Hi,
Im trying to attach to the azure function runtime which is running my console app. When its trying to attach I see

~> Attached to func.
~> The process failed to start with the following error: System.Exception: Could not find the .NET Core dbgshim library at /usr/local/share/dotnet/shared/Microsoft.NETCore.App/6.0.3
~>   at RemObjects.Oxygene.CoreDebugEngine.CLR.DotNetCorUtilities.GetInfo (System.String aPath) [0x0003e] in <0bd7c041af3e46cebf0d4165a9e2641b>:0 
~>   at RemObjects.Oxygene.CoreDebugEngine.CLR.DotNetCorUtilities.AttachProcess (System.String aDotNetPath, System.UInt32 pPid, System.Action`2[T1,T2] aCallback) [0x00014] in <0bd7c041af3e46cebf0d4165a9e2641b>:0 
~>   at RemObjects.Oxygene.CoreDebugEngine.CLR.CLRDebugEngine.Start () [0x00249] in <0bd7c041af3e46cebf0d4165a9e2641b>:0 
~>   at a.a (System.String[] a) [0x004c8] in <a7ec39832c3045f0bffb6f92d2e0c579>:0

In the debug window.

I see libdbgshim.dylib in that folder, should it be trying to use that ?

Cheers,
John

So /usr/local/share/dotnet/shared/Microsoft.NETCore.App/6.0.3/libdbgshim.dylib exists, but is not being used/? is it maybe the wring architecture?

Im running m1 and I only have the arm versions of the sdk and runtime installed. Would the architecture of the azure function runtime make a difference ? I dont know what that is

I also get the same issue with just a regular .net core console app. If I attempt to attach to dotnet it gives the same issue.

Regular debugging works by the way. This is the console app I created to test

DontStopConsoleApplication.zip (163.6 KB)

Wait, maybe i’m confused as to what you’re actually doing.

Ah so this is unreated to Azure, realty, it’s just thjatb regular debugging works, but attaching doesn’t?

Yes sorry I realized I made it more complex I should of just created a regular console app and tried attaching to that.

1 Like

I’ll have Elena have a look and get back to you.

Hello, John!

You could try the new build uploaded for you. The issue is fixed.

I started a new build with Water, jic.

Hi,

Thanks. Would this one be ok from Firehose ?

[20220420-144758-fire-develop]

Cheers,
John

TBH, probably, but not sure. lemme start a new Fire for you just in case.

Build for 20220421-115741-fire-develop succeeded on gazorpazorp, took 37 minutes, 15 seconds. Files are available here.

should be fine

1 Like

It still seems to give the same error

~> Attached to dotnet.
~> The process failed to start with the following error: System.Exception: Could not find the .NET Core dbgshim library at /usr/local/share/dotnet/shared/Microsoft.NETCore.App/6.0.3
~>   at RemObjects.Oxygene.CoreDebugEngine.CLR.DotNetCorUtilities.GetInfo (System.String aPath) [0x0003e] in <0bd7c041af3e46cebf0d4165a9e2641b>:0 
~>   at RemObjects.Oxygene.CoreDebugEngine.CLR.DotNetCorUtilities.AttachProcess (System.String aDotNetPath, System.UInt32 pPid, System.Action`2[T1,T2] aCallback) [0x00014] in <0bd7c041af3e46cebf0d4165a9e2641b>:0 
~>   at RemObjects.Oxygene.CoreDebugEngine.CLR.CLRDebugEngine.Start () [0x00249] in <0bd7c041af3e46cebf0d4165a9e2641b>:0 
~>   at a.a (System.String[] a) [0x004c8] in <a7ec39832c3045f0bffb6f92d2e0c579>:0

To be safe, you sure you’re not using an external compiler that wasn’t updated to match?

I turned off the external compiler but didnt update it, should I have updated it ?

No. if you used external, you’d have to update it to see the fix. if you are not, then you should be fine.

I tried with the latest external and that also appears to not work.

Ok, thanx. Looks like @elenap has more work to do on this :wink:

Do you have the arm64 or x86_64 version of .NET Core installed?

i just retested here; i see Elena’s fix working, but it styill fails due toa versy similar error

~> Attached to dotnet.
~> The process failed to start with the following error: System.Exception: Could not load .the NET Core dbgshim library at /usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.0-preview.3.22175.4/libdbgshim.dylib. Error: dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.0-preview.3.22175.4/libdbgshim.dylib, 0x0102): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.0-preview.3.22175.4/libdbgshim.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
~>   at RemObjects.Oxygene.CoreDebugEngine.CLR.DotNetCorUtilities.LoadLibrary (System.String s) [0x0005c] in <f97ba959aa2b4dc5aac7794ecad7dd02>:0 
~>   at RemObjects.Oxygene.CoreDebugEngine.CLR.DotNetCorUtilities.GetInfo (System.String aPath) [0x00044] in <f97ba959aa2b4dc5aac7794ecad7dd02>:0 
~>   at RemObjects.Oxygene.CoreDebugEngine.CLR.DotNetCorUtilities.AttachProcess (System.String aDotNetPath, System.UInt32 pPid, System.Action`2[T1,T2] aCallback) [0x00014] in <f97ba959aa2b4dc5aac7794ecad7dd02>:0 
~>   at RemObjects.Oxygene.CoreDebugEngine.CLR.CLRDebugEngine.Start () [0x00263] in <f97ba959aa2b4dc5aac7794ecad7dd02>:0 
~>   at a.a (System.String[] a) [0x004c8] in <f9baa078cc1940749c28ddb71dfc188d>:0

but note that the path includes the .dylib name; id didn;t for you, and that part is what should have been fixed.

 Could not load .the NET Core dbgshim library at /usr/local/share/dotnet/shared/Microsoft.NETCore.App/7.0.0-preview.3.22175.4/libdbgshim.dylib. 

vs

Could not find the .NET Core dbgshim library at /usr/local/share/dotnet/shared/Microsoft.NETCore.App/6.0.3

The build started now has this issue fixed; i’d appreciate if you could retest with that one to see if maybe that also takes care of your issue, especially if you are on an arm64 Mac.