\

DLL that was not present in memory despite not being formally unloaded

103 points - today at 9:53 AM

Source
  • masfuerte

    today at 12:38 PM

    Part two:

    https://devblogs.microsoft.com/oldnewthing/20260626-00/?p=11...

      • Someone1234

        today at 1:02 PM

        Part 1 was interesting; it isn't clear why he split that into a Part 2 since it adds little to the story and is a paragraph long.

          • londons_explore

            today at 2:07 PM

            I assume the fact it is a third party application means debugging gets harder, and the business case for doing so is weaker/none.

            But I would hope that some kind of reverse debugger triggered on one of these crashes would make it pretty simple to say "who wrote this 01".

              • microgpt

                today at 3:22 PM

                You could also look at modules loaded into all of those processes that crashed this way.

            • rramadass

              today at 4:49 PM

              Part-2 is more than a paragraph and is logically distinct from Part-1. In this, Raymond actually gets the crucial clue from another colleague's debugging efforts which leads him to identify that the bottom byte of HMODULE of the DLL gets overwritten by <something> which is the root cause of the bug; viz.

              The “DLL unmapped from memory” crash is just an alternate manifestation of the “somebody is writing 01 bytes to places they shouldn’t” bug. The original bug had a larger bucket spray than we initially thought.

              Part-2 is the essence of the solution while Part-1 is a series of investigations and inferences.

              • taneq

                today at 1:17 PM

                Might have been an “I need to look into this” segueing into “ never mind”?

        • zabzonk

          today at 12:27 PM

          > The good news for the shell32 team is that they are off the hook; they are the victim. The bad news is that we don’t know who the culprit is.

          The story of software development through the ages.

            • brookst

              today at 1:09 PM

              When you’ve eliminated all possible explanation, it’s time to pack it in.

                • taneq

                  today at 1:19 PM

                  Oh man, my journey from idealistic “there is always an explanation” youth to “some days it do be like that, and we may never know why” in a nutshell.

                  • zabzonk

                    today at 3:04 PM

                    Or, as the original article suggests, blame someone else.

            • rwmj

              today at 1:31 PM

              What MSFT support policy do you need to have the legendary Raymond Chen take a look at it?

              I say this because we've reported a bunch of Windows bugs (mainly running Windows under virtualization) and getting them to pay attention at all is an up-hill battle.

                • hackyhacky

                  today at 1:49 PM

                  > What MSFT support policy do you need to have the legendary Raymond Chen take a look at it?

                  If you have to ask, you can't afford it.

                  • DANmode

                    today at 6:28 PM

                    Perhaps it’s a matter of subjective interest!

                    Often that’s how these things go.

                • 1970-01-01

                  today at 2:33 PM

                  >I asked for the 100 most recent crashes in that third party program and put them into a pivot table so I could see the distribution.

                  Always wondered if crash reporting is some kind of shady business. It's good to know it does, at minimum, do what it promises and give valuable crash data to MS.

                    • DANmode

                      today at 6:31 PM

                      Shady, as in, where does that data end up after MS collects it, and why?

                  • kumarvvr

                    today at 12:48 PM

                    I see posts like this, this deep dive into the call stacks and am always humbled and reminded of the limits of my knowledge about computers and programs.

                      • rramadass

                        today at 4:31 PM

                        These sort of bugs require a lot of knowledge about a) Windows Internals b) Tools to debug at that level. Most application-level programmers won't need nor are exposed to these.

                        However, if you are interested in knowing what is all involved, see; Advanced Windows Debugging by Mario Hewardt and Daniel Pravat - https://advancedwindowsdebugging.com/

                        Review of the book by Raymond Chen himself! - https://devblogs.microsoft.com/oldnewthing/20071218-01/?p=24...

                        • dist-epoch

                          today at 1:10 PM

                          Goes both ways, author probably knows little about FPGA programming, React or PyTorch.

                          • Panzer04

                            today at 1:02 PM

                            Not a programmer?

                              • kumarvvr

                                today at 1:18 PM

                                I am, for 20 years now. I do embedded stuff too. Still.

                                  • Panzer04

                                    today at 1:35 PM

                                    I'm a bit surprised you don't run into things like this then :). Do you use GDB and the like at all?

                                    Or do you mean all the windows specific stuff etc, I guess I was more imaging the call stack etc.

                                    No insult was intended XD

                                      • FartyMcFarter

                                        today at 1:49 PM

                                        As someone who has debugged his fair share of tricky low-level issues, the parts that I find impressive in his blog posts are things such as "then we look at the bytes in memory and oh yeah, this looks like an exception record". I would usually not think to do that (or be able to recognise it as easily as I presume he did).

                                          • Chu4eeno

                                            today at 6:14 PM

                                            I assume it's mostly just something you learn to recognize after decades of poking at the same things. I remember being impressed with Thiago (Qt developer) being able to immediately tell if a pointer was heap allocated, invalid/unaligned, etc. until I spent more time poring over /proc/*/maps and in gdb. Never figured out how he could tell someone's Qt version just from an strace excerpt, though.

                                        • kumarvvr

                                          today at 1:43 PM

                                          I have done everything from desktop apps to web apps and a bunch in between. Regular debugging is good enough for me. Never had the need to go down into call stack level.

                                          Even with embedded programming, regular C debugger has always been enough.

                                          • today at 2:19 PM

                            • defrost

                              today at 12:24 PM

                              That's some doggedly determined back tracing to uncover an unexpected heisenbug (loose meaning).

                                So a total of 46% of the crashes were due to this rogue force-unload of a DLL. This is a case of bucket spray, where a single underlying cause generates a large number of different types of crashes.

                                • chrisjj

                                  today at 12:35 PM

                                  We've not yet seen sufficient evidence this is any type of heisenbug.

                                    • brookst

                                      today at 1:10 PM

                                      Looking more closely would resolve it one way or the other.

                                        • defrost

                                          today at 1:23 PM

                                          My hat.

                                      • defrost

                                        today at 1:22 PM

                                        It's not, by the article, in a strict taxonomy.

                                        In a wider sloppier sense some use the term for bugs that are hard to pin down and exhibit wide behaviours.

                                • nopurpose

                                  today at 2:09 PM

                                  How big and important third-party vendor must be for Raymond Chen to dissect its coredumps?

                                    • FartyMcFarter

                                      today at 2:17 PM

                                      Given his seniority, it could also be that he picks whatever bugs he wants to work on. Whether that is from personal interest, frequency of crashes or any other criteria.

                                      When you're at that level in a company, it's rare that someone would be micromanaging what you work on at all times.

                                  • IChooseY0u

                                    today at 2:56 PM

                                    Windows COM is super weird and way over engineered.

                                      • rpeden

                                        today at 3:06 PM

                                        I actually think COM is an amazing bit of engineering considering its intended use case.

                                        It still feels like a much more advanced way of sharing compiled libraries between different languages than the current default of "export a C ABI and communicate across the barrier via primitive sticks and stones."

                                        COM isn't perfect but I still find it impressive especially since COM/OLE are 40 years old at this point.

                                          • microgpt

                                            today at 3:24 PM

                                            It basically is that. It's a standardized sticks and stones. Plus objects for some reason. But I don't think the objects are a bad thing - it allows multiple implementations of sometimes to co-exist - consider using two different GPUs from different vendors at the same time. It took a really long time and a bunch of hacks to make OpenGL support that, but DirectX could always do it (at least at the API level) by just creating two different ID3DDevice objects backed by different code from different DLLs both loaded at the same time.

                                            OpenGL basically loads the GPU driver DLL that directly implements the OpenGL functions while Direct3D uses a COM object with a vtable so it can easily have two different ones.

                                    • hackrmn

                                      today at 2:56 PM

                                      The fact that Raymond Chen is debugging these kind of issues, tells me Microsoft is short on staff that has his particular set of skills, handing him the hairiest issues from the annals of Windows. The new hires are probably all about .NET and JavaScript and what have you -- whatever Microsoft is about these days. I doubt it's C/C++. Chen is probably on standby and is paid handsomely as a de-facto VIP consultant. He is a legend, but he's becoming somewhat of a vintage developer.

                                        • today at 3:52 PM

                                          • forestry

                                            today at 4:29 PM

                                            Managed dump analysis in windbg was a thing. It’s been many years since I’ve needed it, though. Service telemetry improved quickly thereafter.

                                        • antonvs

                                          today at 4:33 PM

                                          Feed the info and code to Claude, it'll diagnose and fix this. You're welcome, Microsoft.