Please enjoy the new eco-friendly printers, now arguably less eco-friendly
Some years ago, the IT department replaced the printers multifunction devices with new reportedly eco-friendly models. One feature of the new devices is that when you send a job to the printer, it...
View ArticleWhen you think you found a problem with a function, make sure you're actually...
A customer reported that the DuplicateยญHandle function was failing with ERROR_INVALID_HANDLE even though the handle being passed to it seemed legitimate: // Create the handle here m_Event =...
View ArticleCorrupted file causes application to crash; is that a security vulnerability?
A security vulnerability report came in that went something like this: We have found a vulnerability in the XYZ application when it opens the attached corrupted file. The error message says,...
View ArticleThe curse of the redefinition of the symbol HLOG
A customer was running into a compiler error complaining about redefinition of the symbol HLOG. #include <pdh.h> #include <lm.h> ... The result is lmerrlog.h(80): error C2373: 'HLOG'...
View ArticleThe Itanium processor, part 1: Warming up
The Itanium may not have been much of a commercial success, but it is interesting as a processor architecture because it is different from anything else commonly seen today. It's like learning a...
View ArticleThe Itanium processor, part 2: Instruction encoding, templates, and stops
Instructions on Itanium are grouped into chunks of three, known as bundles, and each of the three positions in a bundle is known as a slot. A bundle is 128 bits long (16 bytes) and always resides on a...
View ArticleThe Itanium processor, part 3: The Windows calling convention, how parameters...
The calling convention on Itanium uses a variable-sized register window. The mechanism by which this is done is rather complicated, so I'm first going to present a conceptual version, and then I'll...
View ArticleThe Itanium processor, part 4: The Windows calling convention, leaf functions
Last time, we looked at the general rules for parameter passing on the Itanium. But those rules are relaxed for leaf functions (functions which call no other functions). Before we start, I need to...
View ArticleThe Itanium processor, part 3b: How does spilling actually work?
Answering some interesting questions that arose yesterday. I didn't know the answers either, so I went and read the manual, specifically Volume 2 (IA-64 System Architecture), chapter 6 (IA-64 Register...
View ArticleThe Itanium processor, part 5: The GP register, calling functions, and...
We saw a brief mention of the gp register last time, where we saw it used when we calculated the address of a global variable. The only addressing mode supported by the Itanium processor is register...
View ArticleThe Itanium processor, part 6: Calculating conditionals
The Itanium does not have a flags register. A flags register creates implicit dependencies between instructions, which runs contrary to the highly parallel model the Itanium was designed for. Instead...
View ArticleThe Itanium processor, part 7: Speculative loads
Today we'll look at speculative loads, which is when you load a value before you even know whether the value should be loaded. (A related but distinct concept is advanced loading, which we'll look at...
View ArticleThe Itanium processor, part 8: Advanced loads
Today we'll look at advanced loads, which is when you load a value before you're supposed to, in the hope that the value won't change in the meantime. Consider the following code: int32_t...
View ArticleThe Itanium processor, part 9: Counted loops and loop pipelining
There is a dedicated register named ar.lc for counted loops. The br.cloop instruction acts like this: if (ar.lc != 0) { ar.lc = ar.lc - 1; goto branch; } Consider this loop to increment every 32-bit...
View ArticleThe Itanium processor, part 10: Register rotation
Last time, we looked at counted loops and then improved a simple loop by explicitly pipelining the loop iterations. This time, we're going to take the pipelining to the next level. Let's reorder the...
View ArticleWhat if I have two programs that are logically a single application, and I...
Suppose you have two programs that are logically one application, and you want them to be treated as a single group on the taskbar, share jump lists, and all that stuff. Basically, even though they...
View ArticleThe changing fortunes of being the last program on the Start menu
One of the thing I didn't mention during my discussion lo many years ago on how Windows XP chooses what goes on the front page of the Start menu is that the the last-place position is actually kind of...
View ArticleThe ARM processor architecture: Somebody else's introduction
While you wait for me to write the Alpha AXP processor architecture overview,ยน I'd like to direct your attention to the ARM processor architecture overview written up by Marion Cole over at the NT...
View ArticleWhy does the taskbar icon for grouped windows change to something weird?
This question came in from two customers. I'm pretty sure it was two customers rather than one customer going on a fishing expedition because the questions came six months apart, and the scenarios...
View ArticleCrashes in the I/O stack tend to occur in programs which do the most I/O
A customer was diagnosing repeated blue screen errors on their system. They shared a few crash dumps, and they all had a similar profile: The crash occurred in the file system filter stack as the I/O...
View Article