RSSAmplifier

Blog

minidump.net

Recent content on minidump.net

minidump.netRSS feed ↗57 posts

Latest posts

Writing a .NET Garbage Collector in C#  - Part 10: Finalizers

Using NativeAOT to write a .NET GC in C#. In this part, we add support for finalization.

Writing a .NET Garbage Collector in C#  - Part 9: Frozen segments and new allocation strategy

Using NativeAOT to write a .NET GC in C#. In this part, we look at what the GC must do to properly handle frozen segments, and we change the allocation strategy to make it more efficient.

Writing a .NET Garbage Collector in C#  - Part 8: Interior pointers

Using NativeAOT to write a .NET GC in C#. This time, we look at what interior pointers are and why they’re so challenging for the GC. We also introduce the concept of brick table.

Too good to be true: an unexpected profiler trap

Sometimes the most convincing performance gains deserve a second look. A reminder that profiling data can be more subtle than it first appears.

Writing a .NET Garbage Collector in C#  - Part 7: Marking handles

Using NativeAOT to write a .NET GC in C#. In the seventh part, we scan and update the handles during the mark phase of the garbage collection.

Writing a .NET Garbage Collector in C#  - Part 6: Mark and Sweep

Using NativeAOT to write a .NET GC in C#. In the sixth part, we start implementing the mark phase of the garbage collection.

Investigating a deadlock in Visual Studio

A short investigation that showcases one of the most common problem faced when writing a profiler.

Using profiler function hooks in .NET with Silhouette

In this article, we see what are function hooks, and how to use them in .NET with Silhouette. We also learn how to statically link a library with NativeAOT.

Measuring UI responsiveness in Resharper

A walkthrough of how I built a custom profiler to measure UI responsiveness, using .NET and Silhouette.

Writing a .NET Garbage Collector in C#  -  Part 5

Using NativeAOT to write a .NET GC in C#. In the fifth part, we learn how to decode the GCDesc to find the references of a managed object.

Pro .NET Memory Management 2nd Edition

Pro .NET Memory Management 2nd Edition is available! What should you expect from it? Should you buy it if you already own the 1st edition?

Writing a .NET Garbage Collector in C#  -  Part 4

Using NativeAOT to write a .NET GC in C#. In the fourth part, we see how walk the heap and how to keep track of allocation contexts.

Writing a .NET Garbage Collector in C#  -  Part 3

Using NativeAOT to write a .NET GC in C#. The third part adds some tooling to inspect the objects stored on the heap.

Writing a .NET Garbage Collector in C#  -  Part 2

Using NativeAOT to write a .NET GC in C#. The second part builds the simplest possible GC that can run basic .NET applications.

Writing a .NET Garbage Collector in C#  -  Part 1

First part of a series of articles about writing a .NET Garbage Collector in C# using NativeAOT. This part sets the expectations and setups the project, dealing with the first difficulties.

Writing a .NET profiler in C#  -  Part 5

Part 5 of the series about using NativeAOT to write a .NET profiler in C#. We have all the foundations, we’re finally writing an actual profiler.

Using Windows Error Reporting in .NET

A look into how to use Windows Error Reporting to collect crash information for your .NET apps.

Crash in the crash-analyzer

When the tool you write to debug crashes crashes. A story of advanced printf-debugging.

GummyCat - Visualize the activity of the .NET garbage collector

A new tool to visualize the activity of the .NET garbage collector.

Dumping the managed heap in C#

Using unsafe hacks to walk the managed heap from within a .NET application, without relying on the debugging API.

Exploring .NET frozen segments

Exploring a little-known API allowing to allocate managed objects outside of the managed heap.

Memory alignment of doubles in C#

A deep dive into the weird tricks used by the .NET allocator to align arrays of doubles.

SuppressGCTransition

Deep-dive into the SuppressGCTransition attribute introduced in .NET 5.

Writing a .NET profiler in C# — Part 4

Part 4 of the series about using NativeAOT to write a .NET profiler in C#, learning many things about native interop in the process. In this part, we learn how to call methods from ICorProfilerInfo .

VerificationException in .NET Framework when using structs

A surprising error occuring when using C# 7.3 with partial trust.

Writing a .NET profiler in C#   — Part 3

Part 3 of the series about using NativeAOT to write a .NET profiler in C#, learning many things about native interop in the process. In this part, we write a source generator to automatically generate the boilerplate code needed to implement the ICorProfilerCallback interface.

Reading .NET performance counters without the PerfCounter API

A faster and safer way to read .NET performance counters from within.

Writing a .NET profiler in C#  —  Part 2

Part 2 of the series about using NativeAOT to write a .NET profiler in C#, learning many things about native interop in the process. In this part, we improve the code from the previous article by using instance methods instead of static methods.

Using GC.KeepAlive in async methods

GC.KeepAlive may not work the way you intend when using it in async methods.

Why function pointers can't be used on instance methods in C#

The C# specification indicates that function pointers can only be used on static methods. This article explains why.

Writing a .NET profiler in C# - Part 1

Part 1 of the series about using NativeAOT to write a .NET profiler in C#, learning many things about native interop in the process. In this part, we will see how to mimic a COM interface in C#.

Writing native WinDbg extensions in C#

Using NativeAOT and ClrMD to write a native WinDbg extension in .NET.

Finding an instance of thread by id in WinDbg

How to find an instance of System.Threading.Thread by id in WinDbg, with a .NET Core memory dump.

Reading AsyncLocal values from a memory dump

This article explains how AsyncLocal values are stored in .NET and how to retrieve them from a memory dump.

Analyze your memory dumps in C# with DynaMD

Browse memory structures from a memory dump in C#, just like you would with ClrMD, but in a more fluent way.

Showing unresolved functions in PerfView

How to tell PerfView to stop grouping unresolved functions under the same “?!?” label.

An unconventional way of investigating a NullReferenceException

Digging into a bug in the .NET ARM64 runtime, learning about dispatch stubs, and using that knowledge to diagnose a NullReferenceException.

Debugging a native deadlock in a .NET Linux application

This story begins when one of our integrations tests started got stuck on one PR that seemingly impacted unrelated code. This is a nice excuse to cover some concepts I haven’t touched in my previous articles, such as downloading the .NET symbols on Linux.

AccessViolation in ObjectNative::IsLockHeld (part 2 of 2)

This is the second part of an investigation where I tried to understand why an application was randomly crashing with an AccessViolationException . This part starts when, as I ran out of easy things to try, I decided to map the assembly code of the IsLockHeld method to the original C++ code to understand exactly where it crashed.

AccessViolation in ObjectNative::IsLockHeld (part 1 of 2)

Investigating a crash in a .NET application, caused by an AccessViolationException when inspecting the state of a lock.

Investigating an InvalidProgramException from a memory dump (part 3 of 3)

In this series of article, we’re retracing how I debugged an InvalidProgramException , caused by a bug in the Datadog profiler, from a memory dump sent by a customer. This is the last part of the investigation, about figuring out what is wrong with the IL code.

Investigating an InvalidProgramException from a memory dump (part 2 of 3)

In this series of article, we’re retracing how I debugged an InvalidProgramException, caused by a bug in the Datadog profiler, from a memory dump sent by a customer. In this part, we extract the dynamic IL from the memory dump.

Investigating an InvalidProgramException from a memory dump (part 1 of 3)

In this series of article, we’re retracing how I debugged an InvalidProgramException, caused by a bug in the Datadog profiler, from a memory dump sent by a customer. The first part of the investigation is an introduction to using a memory dump from a .NET application to find the information you seek.

Tricked by WebRequest

Even with years of experience, WebRequest managed to surprise me.

Monitor GC stats with a startup hook

Using startup hooks to automatically fetch GC metrics from any .net core application.

Check what .net core GC keywords are enabled without a debugger

How to inspect arbitrary values in the memory of a .net process on Linux… And find an unexpected bug in the process.

Performance best practices in C#

Non-exhaustive list of code patterns to avoid in C#, either because they are risky or perform poorly.

.NET ThreadPool starvation, and how queuing makes it worse

Explaining the ThreadPool starvation issue, and how it can be made worse by the way work-items are queued.

Turning your training bike into a Speed remake

Inspiration for quarantine days: how to connect a Raspberry Pi to a training bike to stream the speed to a computer and pause a video when below 20 km/h

Switching back to the UI thread in WPF/UWP, in modern C#

Leveraging the async machinery to transparently switch to the UI thread when needed.