[BUG] Application crashes as soon as it loads a satellite assembly
See original GitHub issueAPM Agent version
Nuget packages and CLR agent have version 1.15.0
Environment
Windows
.NET 6.0.201
Describe the bug
As soon as an application with the profiler attached tries to load a satellite assembly with localized resources the whole application crashes.
This issue describes the same problem as already reported in #1635 but the problem still exists in version 1.15.
In my minimal repro I used the FSharp.Core library (which is localized) but it seems to happen with any satellite assembly.
To Reproduce
Steps to reproduce the behavior:
- Clone the repo with a minimal sample from here: https://github.com/pihai/apm-agent-satellite-assembly-crash
- This repo should contain everything that is needed to reproduce the error: console application, profiler binaries, launchSettings.json with the required environment variables
- Run:
dotnet run --project .\ConsoleApp\
- The application crashes with the following stacktrace:
[2022-05-18T11:32:12.074605000+02:00] [DEBUG] ModuleLoadFinished: 140729700776640 FSharp.Core.resources app domain 2733837995088 clrhost
[2022-05-18T11:32:12.075114400+02:00] [DEBUG] ModuleLoadFinished: stored metadata for 140729700776640 FSharp.Core.resources app domain 2733837995088 clrhost
[2022-05-18T11:32:12.075417500+02:00] [TRACE] ModuleLoadFinished: tracking 21 module(s)
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: NulError(0, [0, 0, 0])', src\elastic_apm_profiler\src\interfaces\imetadata_assembly_import.rs:346:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', src\elastic_apm_profiler\src\profiler\mod.rs:1110:43
stack backtrace:
0: 0x7ffea58f1154 - rust_eh_personality
1: 0x7ffea58a3baa - DllGetClassObject
2: 0x7ffea58ef9c8 - rust_eh_personality
3: 0x7ffea58f01a2 - rust_eh_personality
4: 0x7ffea58ef3f2 - rust_eh_personality
5: 0x7ffea58f79c5 - rust_eh_personality
6: 0x7ffea58f791f - rust_eh_personality
7: 0x7ffea58f78bf - rust_eh_personality
8: 0x7ffea5906440 - rust_eh_personality
9: 0x7ffea5906bd3 - rust_eh_personality
10: 0x7ffea5899d11 - DllGetClassObject
11: 0x7ffe8f122609 - GetCLRRuntimeHost
12: 0x7ffe8ef29d93 - MetaDataGetDispenser
13: 0x7ffe8eee2ea9 - <unknown>
14: 0x7ffe8eee4df8 - <unknown>
15: 0x7ffe8eee42ac - <unknown>
16: 0x7ffe8eee400b - <unknown>
17: 0x7ffe8f01b705 - coreclr_shutdown_2
18: 0x7ffe8f01a6d3 - coreclr_shutdown_2
19: 0x7ffe8ef0d3f0 - MetaDataGetDispenser
20: 0x7ffe8ef0d39c - MetaDataGetDispenser
21: 0x7ffe8ef70ce1 - MetaDataGetDispenser
22: 0x7ffe8f10ba07 - GetCLRRuntimeHost
23: 0x7ffe8f0ccb15 - GetCLRRuntimeHost
24: 0x7ffe8f0a94e0 - coreclr_shutdown_2
25: 0x7ffe8efb368d - MetaDataGetDispenser
26: 0x7ffe8efb38f7 - MetaDataGetDispenser
27: 0x7fff04e120cf - _chkstk
28: 0x7fff04dc1454 - RtlRaiseException
29: 0x7fff04dc11a5 - RtlRaiseException
30: 0x7fff02a94f69 - RaiseException
31: 0x7ffe8f020630 - coreclr_shutdown_2
32: 0x7fff04e11456 - RtlCaptureContext2
33: 0x7ffe8ef0642a - MetaDataGetDispenser
34: 0x7ffe8efc7557 - coreclr_execute_assembly
35: 0x7ffe8effff4b - coreclr_execute_assembly
36: 0x7ffe2f4ad6ab - <unknown>
37: 0x7ffe2f4ad5f0 - <unknown>
38: 0x7ffe2fc13aa4 - <unknown>
39: 0x7ffe2fc13539 - <unknown>
40: 0x7ffe2fc131e9 - <unknown>
41: 0x7ffe2f847fc0 - <unknown>
42: 0x7ffe2f847c59 - <unknown>
43: 0x7ffe2f847338 - <unknown>
44: 0x7ffe2fc122a3 - <unknown>
45: 0x7ffe2f48c01f - <unknown>
46: 0x7ffe8f01a6d3 - coreclr_shutdown_2
47: 0x7ffe8ef1ff16 - MetaDataGetDispenser
48: 0x7ffe8ef91077 - MetaDataGetDispenser
49: 0x7ffe8ef90ef6 - MetaDataGetDispenser
50: 0x7ffe8ef90da5 - MetaDataGetDispenser
51: 0x7ffe8ef90b66 - MetaDataGetDispenser
52: 0x7ffe8efc52c2 - coreclr_execute_assembly
53: 0x7ffec52496db - <unknown>
54: 0x7ffec5249a0c - <unknown>
55: 0x7ffec524a3a7 - corehost_main
56: 0x7ffed2edb539 - hostfxr_close
57: 0x7ffed2ede506 - hostfxr_close
58: 0x7ffed2ee0821 - hostfxr_close
59: 0x7ffed2edeb62 - hostfxr_close
60: 0x7ffed2ed82ab - hostfxr_main_startupinfo
61: 0x7ff60ee324b8 - <unknown>
62: 0x7ff60ee3282b - <unknown>
63: 0x7ff60ee33cd8 - <unknown>
64: 0x7fff04b07034 - BaseThreadInitThunk
65: 0x7fff04dc2651 - RtlUserThreadStart
thread panicked while panicking. aborting.
Expected behavior
The application should load the satellite assembly with the localized resources just fine.
Actual behavior
The whole application crashes.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Concurrency issue when loading satellite assembly?
It seems that the culprit was a test that was using the Buildalyzer.Workspaces package (v3.2.3) which in turn uses Roslyn ( Microsoft.
Read more >Satellite assembly references 4.0 of mscorlib instead of 2.0
Something appears to be wrong with the version of "mscorlib" generated for a satellite assembly in a standard WinForms app.
Read more >VS2022 crashes with version 17.5.2 (as it did with 17.5.1)
Restarting VS makes it even worse: after the solution is fully loaded, VS crashes completely. In the ActivityLog.xml is this error:.
Read more >Common issues with Satellite 6 upgrade or installation
Unable to enable Red Hat Satellite 6.2 repositories using subscription-manager, fails with "Error: rhel-7-server-satellite-6.2-rpms is not a ...
Read more >Troubleshoot Satellite - Network Automation
This topic applies to a Classic NA installation. ... This section covers all the satellite specific troubleshooting topics.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
From my point of view the issue seems to be fixed with the new binaries.
Many thanks for the quick fix everyone!
v1.16.1 is released which has the fix: https://github.com/elastic/apm-agent-dotnet/releases/tag/v1.16.1
Thanks everyone, closing this now.