Yay! Heller Affirmed!
Today the Supreme Court released its decision affirming Heller v. District of Columbia, finding the Second Amendment protects an individual right to own and possess a handgun for defensive purposes in one’s home.
The finding of an individual right has been widely expected in the gun rights community since oral arguments earlier this year, but the results were still a bit surprising, at least to me.
First, the court was divided 5-4, with all four liberals dissenting. If Justice Kennedy had gone the other way, we’d have a SCOTUS precedent for the collective rights interpretation of the 2A! If any gun rights supporters stay home in November to protest McCain’s various liberal experiments or the GOP’s feckless and spendthrift ways, well, let posterity forget that ye were our countrymen!
The dissenting opinions are the usual anti-gun crap, notable only because it’s coming from sitting Supreme Court justices. The majority opinion, written by Justice Scalia, is very narrow, and leaves the door wide open for future legal battles over gun registration, gun licensing, bans on classes of weapons like “assault weapons”, bans on concealed carry, bans on carry in “sensitive” government building, etc. All of those foolish posts on gun boards over the last few months predicting the immediate and total destruction of all gun laws post-Heller will be sorely disappointed.
Overall, it’s a good day for freedom in America. We now have a Supreme Court precedent finding an individual right to gun ownership for defense. However, there’s still a long way to go, and we’ll need Constitutionalist justices to get there. If you care about gun rights, stay as far away from Obama as possible, support that lesser-evil son-of-a-bitch McCain, and encourage others to do the same.
Way to go Ireland. Britain, you suck.
Two unrelated but nonetheless telling bits of information came to me today.
First, the Irish, being as they are not team players, just had to run the Lisbon Treaty past their citizens, even though every other EU nation was smart enough to limit the decision to their respective elite Eurocrats. It turns out the Irish, upon reflection, aren’t too keen on ceding their remaining sovereignty to Brussels, as the treaty ratification was voted down with extreme prejudice.
As an American, albeit an unusually politically active one, I don’t have a very firm grasp on European politics, but I can’t help but compare the EU with the formation of my own country back in the late 18th century. The thirteen colonies were all pretty independent, and our first attempt to organize into a nation, the Articles of Confederation, failed due to an excessive lack of cohesion. The successor document, the Constitution, attempted to balance the sovereignty of the colonies with the need for a central government to perform certain functions. Thus, the Federal model.
It seems to me the EU have made the opposite mistake, trying to centralize authority over nearly 500 million people in one place, eroding the sovereignty of its member nations incrementally. The French and Dutch voters shot down the EU treaty back in ’05, an experience which I must imagine informed the decision to skip the whole referendum thing this time around. The Irish seem particularly hostile to this latest consolidation of power, and I don’t blame them. I constantly bristle under the runaway size, scope, authority, and cost of our central government, and it (used to) be severely constrained by Constitutional limits, and still is today compared to the EU experiment.
Anyway, good on the Irish for standing up to Eurocrat elites and holding on to their country for a little longer.
Contrast this with the seemingly limitless supply of meddlesome statist chicanery streaming out of the UK. Last week is was the shocking revelation that gun bans don’t in fact lead criminals away from crime for want of a tool, but instead forces recourse to edged weapons. This week it’s even better; bans on hat-wearing.
It seems the Brits are working up to the ultimate homage to Orwell in the form of a perpetual live-action production of 1984, a component of which is their absurd Panopticon. One problem though; some assholes wear hats, which makes it harder for the CCTV cameras to get a good shot of their faces. Solution? Why, government diktat of course. New rule: you can’t wear hats in pubs. QED.
I have to wonder what could possibly be wrong with the people who gave us Blackstone, Churchill, and Thatcher, that they seem happy to return their hard-won democratic gains and descend once more into subjugation, for nothing more than some mumbled assurances of safety and the greater good. What the hell is wrong with these people, and what must we as Americans do to avoid ending up like them?
Visual C++ Apps Crashing in _chkstk Under Load
At work one of the devs was running into a weird problem. He could run a group of our unit tests on his dev box without any problem, but when the same tests ran on our build machine the test host process crashed with an unhandled exception. Thankfully we run all of our processes with an unhandled exception trap which generates a minidump before terminating, so we were able to determine the failure was in a C runtime function _chkstk called upon entry into a particular function that allocates alot of stuff on the stack.
At first, I was thinking stack overflow, but there wasn’t anywhere near 1MB of shit on the stack, which is the default maximum stack size. I thought about stack corruption, but the C-runtime stack checking routines provide an explicit message when stack corruption is detected. We commented out the large stack variables in the function that was being called, and that made the crashes go away, so clearly it was something stack related, but what?
I started Goggling about, and first ran into the Microsoft documentation for the _chkstk routine.aspx). There’s not much there:
Called by the compiler when you have more than one page of local variables in your function.
Remarks
_chkstk Routine is a helper routine for the C compiler. For x86 compilers, _chkstk Routine is called when the local variables exceed 4096 bytes; for x64 compilers it is 4K and 8K respectively.
Hmm, well, that explains why commenting out the large local variables made the problem go away; _chkstk isn’t even called without at least 4K on the stack. Still, that doesn’t explain why the crash is happening.
Then I ran across an article about debugging a stack overflow with WinDbg, the shitty not-at-all-intuitive debugger that ships with the Debugging Tools for Windows. That wasn’t interesting; what was interesting was the hypothetically stack overflow scenario they presented. It involved a mysterious crash in _chkstk!.
In the article’s example, the problem wasn’t too much stuff on the stack, it was a system committed page count very close to the max (that is, the amount of physical memory in the machine). You see, _chkstk grows the stack when needed by committing some of the pages previously reserved for the stack. If there is no more physical memory available for committed pages, _chkstk fails. Interestingly enough, the commited page count on our build machine was very near the max, while the committed page count on the developer’s box was low, which explains why he couldn’t repro it on his box.
The article offers little more than a shrug and a “shit happens” as a workaround. It does suggest increasing the stack commit size (the portion of the reserved memory committed when a thread starts) as a workaround, which will cause the necessary memory to be committed at the time a thread starts, such that under low memory conditions the thread won’t start at all, rather than crashing in some unpredictable spot when the stack grows too much.
As a result, we explicitly set the stack reserve and commit sizes to 1MB in the Linker | System property page for all of our executable projects. That will increase the quantity of committed memory at application and thread startup, but only by 1MB. In return, it will make low-memory conditions cause more obvious thread start errors, which to my mind is worth the up-front memory hit.
Just when you think you have a pretty good handle on Windows development, something like this comes along to remind you how much you don’t know.