Vestibular Dysfunction, or, How I Went Half Deaf

This part doesn't work anymoreTwo weeks ago I had a severe inner-ear episode, presumed to be an infection. One moment I was 100% healthy and then, ten minutes later, I was deaf in one ear, with severe vertigo. The word ‘vertigo’ doesn’t quite capture the horrific nausea and vomiting that ensued as my lunch guest drove me to immediate care, nor does it capture the six uncomfortable days that followed.

I’m doing much better now and I thought I’d share the recovery timeline:

Continue reading

Posted in Fun, Unicycling | Tagged , , | 14 Comments

Everything Old is New Again, and a Compiler Bug

“What’s an EXCEPTION_FLT_STACK_CHECK exception?” one of my coworkers said. I said “It’s a weird and rare crash. Why do you ask?”

It turns out that one of these weird and rare crashes had started showing up in Chrome (M54 branch, not the stable branch that consumers are running). We began looking at it together until I decided it made more sense to assign the bug to myself. Partly I did this because the crash analysis required some specialized knowledge that I happened to have, but mostly because I was curious and I thought that this bug was going to be interesting. I was not disappointed.

  • The crash was in a FPU that Chrome barely uses
  • The instruction that crashed Chrome was thousands of instructions away from the one that triggered the exception
  • The instruction that triggered the exception was not at fault
  • The crash only happened because of third-party code running inside of Chrome
  • The crash was ultimately found to be caused by a code-gen bug in Visual Studio 2015

Continue reading

Posted in Debugging, Floating Point | Tagged | 27 Comments

ETW Flame Graphs Made Easy

A bit over three years ago I wrote about how to use flame graphs to visualize CPU Usage (Sampled) data from ETW, and a year ago I added flame graph support to UIforETW. However these techniques are clumsy and slow and what I really wanted – what I asked for – was flame graph support in Windows Performance Analyzer (WPA), Microsoft’s ETW trace viewer.

And with the 10.0.14393 (Windows 10 Anniversary Edition) version of Windows Performance Toolkit (WPT) I finally got my wish! WPA can now natively display data as flame graphs, and it is good.

Disclaimer: WPT 10.0.14393 requires Windows 8 or above. If you install it on Windows 7 or below it will crash. UIforETW v1.42 will install the latest WPT on Windows8 or above, but will install the previous version on Windows 7. If you want flame graphs on ‘ancient’ operating systems you’ll need to stick to the old-fashioned methods.

Continue reading

Posted in Performance, uiforetw, xperf | Tagged , , | 17 Comments

Zeroing Memory is Hard (VC++ 2015 arrays)

Quick, what’s the difference between these two C/C++ definitions of initialized local variables?

char buffer[32] = { 0 };
char buffer[32] = {};

One difference is that the first is legal in C and C++, whereas the second is only legal in C++.

Okay, so let’s focus our attention on C++. What do these two definitions mean?

Continue reading

Posted in Performance, Programming, Visual Studio | Tagged , , | 22 Comments

DNA-Free Dining Made Easy

Recent studies have confirmed that more than 80% of Americans support labeling of foods containing DNA.

And why not? DNA is genetic material. DNA is used for reproduction, so eating another animal’s DNA is uncomfortably close to bestiality.

Plant DNA isn’t much better. After all, who wants to risk having a corn stalk sprouting from your arm?

And if you want more proof of the dark dangers of genetic material then look no further than the Zika virus – this microcephalitic plague demon is almost 100% RNA which is DNA’s faithful messenger boy.

Continue reading

Posted in Uncategorized | Tagged , , , | 13 Comments

UIforETW is No Longer a CPU Hog

A few months ago I wrote about how many processes on my system were waking up and wasting CPU time for no good reason, thus wasting battery power, electricity, and CPU power. I was surprised that nobody called me out on the hypocrisy of my complaints because UIforETW, my open-source ETW trace recording and management tool, was not well behaved when idle.

This has now been fixed.

Continue reading

Posted in Performance, uiforetw, xperf | Tagged , | 6 Comments

Compiler Bugs Found When Porting Chromium to VC++ 2015

WinDirStat of Chromium, no generated codeMoving a big software project to a new compiler can be a lot of work, and few projects are bigger than Chromium. In addition to the main Chromium repository, which includes all of Blink, there are over a hundred other open-source projects which Chromium incorporates by reference, totaling more than 48,000 C/C++ files and 40,000 header files. Porting Chromium on Windows to VC++ 2015 requires getting all of these projects to build and run.

As of March 11th 2016 Chromium for Windows has switched from VC++ 2013 to VC++ 2015, and it doesn’t look like it’s switching back. This will give us more C++ 11 features, new security options, much faster LTCG/PGO builds, and other advantages.

The tracking bug for this project currently has over 330 comments on it, with contributions from dozens of developers. Writing about all of those changes would require an entire book. So I’m going to focus on my favorite part of this project – compiler bugs. In particular, bugs where the compiler silently generates incorrect code.

Continue reading

Posted in Programming, Visual Studio | Tagged , , , | 34 Comments