•   Posted in:
  • .NET

Our application is written in 3 languages and very often it is hard to get a full call stack. We are constantly improving it but, in some cases, it is really hard to find the source of the problem.

Very often I had to investigate crash dump without any visible .NET stack in it. Usually in this case, I want to see if there are any .NET exceptions and their call stack. For this, I use the following command in WinDbg:

!DumpHeap -type Exception

Typically it will print any object that has the word “Exception” in their name. Something like this:

7ffcbebbc7f8     1        80 System.Collections.Generic.Dictionary<NLog.Config…
7ffcbfeeed68     2        80 System.Lazy<System.Collections.Generic.IEqualityComparer<System.Exception>>
7ffcbeb71088     1       112 NLog.LayoutRenderers.ExceptionLayoutRenderer
7ffcb918f328     1       128 System.OutOfMemoryException
7ffcb918f428     1       128 System.StackOverflowException
7ffcb918f528     1       128 System.ExecutionEngineException
7ffcb92be9c0     4       256 System.Windows.Threading.DispatcherUnhandledExceptionEventHandler

  •   Posted in:
  • .NET

A few weeks after we converted our application to .NET I received an email that states that there are a lot of network exceptions thrown by our application during normal work. None of them are visible to the customer and it just a lot of exceptions.

Obviously, I started my investigation and after some time I found a way to reproduce them. All I needed was to enable all Exceptions in Visual Studio and tell our application to establish a network connection to any server. And after some execution stopped with System.IO.IOException and message: “Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..”

  •   Posted in:
  • .NET

I was porting our application to .NET 8 and I found that some 3rd party library throwing InvalidProgramException with the message “Common Language Runtime detected an invalid program”. It is not something that you see often and I started investigating.

The code looks like this:

…
ilgenerator.Emit(OpCodes.Brtrue_S, (sbyte)(OpCodes.Newobj.Size + 4 + OpCodes.Throw.Size));
ilgenerator.ThrowException(typeof(ArgumentOutOfRangeException));
…

That 3rd party library trying to generate IL code that checks a boolean condition and if it is false then throw an exception and otherwise skip that block and continue execution. I reviewed the code it tries to generate and I didn’t find anything suspicious.

At that moment, I had an assumption that the IL code was not valid and newer version

As I wrote some time ago, we were porting our application to .NET 6. One weird stuff that we were still compiling everything as a .NET Framework application but executing it in .NET 6 runtime.

Pretty much everything works just fine but some 3rd party assemblies do not work because they are using something that is absent in .NET 6. One such assembly was the System.Data.Odbc. And we didn’t reference it as a package and this assembly was simply present in our application directory.

Typically for these cases, I would download a package from nuget.org, open it as a zip archive, then go to the lib directory, find the appropriate version, and replace the version

Finally, CrowdStrike released a full report of what happened and you can find it here. There are quite a few interesting topics there. Firstly we will check what is interesting in this report.

1. “Rapid Response Content is delivered through Channel Files and interpreted by the sensor’s Content Interpreter, using a regular expression based engine”.  If this is a true regular-expression engine, then it is really bad. As you probably know, Windows drivers are typically written in C, and I would never put a C-based regular expression engine into the driver. It is just too risky.

There are multiple issues with regular expression libraries. Firstly, it is hard to prove that it is working correctly. Typically there are many

Recently I watched this video about Windows 8. Basically, the author claimed that this version of Windows almost killed Microsoft. I was professionally using Windows 8 and Windows 8.1 for many years and I can state that this is just somewhat a clickbait.

Yes, Microsoft made a mistake and there was too much focus on tablet mode. But it is easy to tell now when we know that tablet PC didn’t become a thing. But at that time conception of the tablet PC looked logical.

Plus idea of having the same Windows with the same UI everywhere was also quite appealing. You write your application once and you can run it on the phone, PC, and XBOX. And I’m

I was vacuuming the back of my fridge, and my vacuum cleaner stopped working. I switched it off, moved it over the countertop and when I was trying to power it on it didn’t work at all. Initially, I thought that the power button stopped working and was trying to disassemble the handle but thanks to this video I realized that probably it was just power connection was lost somewhere.

So I disconnected the hose that has wire to the handle to allow the power button to work. Then I pressed every contact with the screwdriver to make sure that every sping was working and viola, it came back to life.

I hope it helps someone.

There is a phrase that is often attributed to British Prime Minister Benjamin Disraeli, and it goes: "There are three kinds of lies: lies, damned lies, and statistics". This phrase perfectly describes how Elon Musk talks about the safety of full self-driving.

Basically, he stated that according to their statistics self-driving crashes way less than when a human is controlling a vehicle. Thus, everybody should use self-driving because it is simply safer.

Let’s assume that statistics is correct. In this case, it sounds like good news for self-driving and everybody should use it, right? Absolutely not, because it is just a different form of lies. Let me explain what I mean.

At the beginning, I must state that in many

Our company has a lot of legacy code and one of them is WCF clients. I was personally against using it a long time ago, but people who were responsible for that part went with it anyway.

The WCF was easy to use but there was a lot of complexity underneath and REST API was already popular when we decided to use WCF and it was tricky to do RESET with WCF. These were reasons I was against using it. But anyway we are using it right now and there are problems when we are migrating it to .NET 6.

One of these issues was a certificate check. We would like our customers to use self-signed certificates for testing and