Friday, September 25, 2009

CPAN error: Recursive dependency detected

Yesterday I updated my RedHat Enterprise system with the latest security fixes, after which my primary Perl scripts stopped working.

I went into the CPAN shell and started with 'install Bundle::CPAN', which yielded the following errors:

Recursive dependency detected:
Test::Harness
=> A/AN/ANDYA/Test-Harness-3.17.tar.gz
=> File::Spec
=> S/SM/SMUELLER/PathTools-3.30.tar.gz
=> Scalar::Util
=> G/GB/GBARR/Scalar-List-Utils-1.21.tar.gz
=> Test::More
=> M/MS/MSCHWERN/Test-Simple-0.94.tar.gz
=> Test::Harness.
Cannot continue.

I found several other references to this problem, none of which provided a solution for me.

I traced the problem back to List::Util. One low-level module required version 1.21 (which was installed), but gave an error that version 1.19 was installed. I traced the problem to the fact that my Perl installation had two separate directories where List::Util was stored:

/usr/lib/perl5/5.8.8/List/Util
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/List/Util

The first directory contained version 1.21, the second directory contained version 1.19.

I solved the problem by removing the multi-thread directories for List and for Scalar:

/usr/lib/perl5/5.8.8/i386-linux-thread-multi/List
/usr/lib/perl5/5.8.8/i386-linux-thread-multi/Scalar

After this, I was able to install Bundle::CPAN.

Monday, August 31, 2009

PathMatchSpec Problems

Today I was debugging a problem in my application where a wildcard name failed to match. I traced the problem to significant issues with the implementation of PathMatchSpec() in the Windows API.

In short, do not expect this function to work like the command interpreter Cmd.exe. This function does not handle many boundary conditions, nor does it properly handle empty extensions.

The simplest example is this command, which correctly finds the Windows directory on all versions of Windows and MS-DOS 6.x:

dir c:\windows.*

However, this API call returns false on Vista:

BOOL b = ::PathMatchSpec("C:\\Windows", "C:\\Windows.*");

Other inconsistencies are shown in the table below. The "right" answer to these scenarios is unclear because MS-DOS did not support long filenames or spaces in filenames. Although various versions of Windows are themselves inconsistent, PathMatchSpec() does not agree with any of them. I would argue that the correct behavior is what Windows Vista does.

Command::PathMatchSpec("C:\\Windows", xxx);MS-DOSWin 9xWin NT
dir c:\windows.*FalseDisplays directory nameDisplays directory nameDisplays directory name
dir c:\windows.FalseDisplays directory contentsDisplays directory contentsDisplays directory contents
dir c:\windows...FalseDisplays directory nameDisplays directory contentsFail
dir "c:\windows "

(Note the trailing space)
Falsen/aDisplays directory contentsFail
dir "c:\windows ."

(Note the trailing space followed by a period.)
Falsen/aDisplays directory contentsFail

And yes, I did actually install MS-DOS to create this chart :-)

Thursday, August 27, 2009

Setting the default Windows SDK

Every time I install a new Windows SDK (or worse, a new copy of Visual Studio), I've gone through the painful process of updating all of the project directories for the Windows SDK include directory, lib directory, etc.

Visual Studio 2005 and 2008 are both smart enough to look in the version of the Windows SDK included with those compilers, but I'd never found a way to change the default version. Until now.

The Windows SDK comes with a utility called the Windows SDK Configuration Tool. You can find it in your Start menu.

When you run this, you can set the default SDK to be whichever version you want. Then Visual Studio will automatically reference that version of the SDK without any need to manually update project directories.

[Update 8/31/2011]
Visual Studio 2010 does not seem to pay attention to the Configuration Tool. Instead, this appears to be set on a project-by-project basis in Configuration Properties/Platform Toolset. After doing so, you may be able to fix some schizophrenic behavior by updating the MSBuild information too. Take a look at the following registry entries. (Thanks to the tip from http://geekswithblogs.net/rob/archive/2010/09/17/integrate-the-windows-sdk-v7.1-with-vs2010.aspx)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0
  • FrameworkSDKRoot (REG_SZ)
    • $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A@InstallationFolder)
  • SDK35ToolsPath (REG_SZ)
    • $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx35Tools-x86@InstallationFolder)
  • SDK40ToolsPath (REG_SZ)
    • $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools-x86@InstallationFolder)

Friday, July 24, 2009

Dangers of Buying Laptops Parts on eBay

I've bought several laptops on eBay. All of them were Thinkpads coming off of lease, and all of them have worked well. My most recent purchase was a Thinkpad T42/p to run Windows 7, which, as I mentioned in an earlier post, has been very successful.

However, a five-year old Thinkpad T40 died on me recently. I bought some parts on eBay to try and fix the problem, and it's been an eye-opening experience.

Part #1 - New motherboard. Included one week warranty. Motherboard worked, but intermittently. By the time I figured out what was actually wrong, the warranty was expired. If I was more savvy fixing Thinkpad motherboards, I would have caught the problem earlier, but I ended up getting stuck with a $130 piece of junk.

Part #2 - New display. Billed as being in "Excellent Condition." Actual condition - display worked, but had significant damage to the bottom of the display that was visible once you turned the display on. However, these displays are relatively large (not like a DIMM module, for example) and paying the postage to send it back would have cost more than the display was worth. It turns out that PayPal doesn't care about fraudulent sellers - it's always the buyer's fault. Apparently, you can send somebody a 50 pound box of bricks instead of the laptop, and the buyer will still be responsible for paying the return postage in order to make a claim. PalPal refuses to talk to you unless you have the tracking number for the returned item.

Part #3 - Laptop, bought for parts, advertised as not booting. Result: seller lied about just about everything (except the part of the laptop not booting.) The battery wasn't new, it was five years old. The DVD was bad. The hard drive and the memory were both half of the advertised sizes.

All in all, I've had a 100% failure rate on all of the parts I ordered, even though all of these sellers had positive feedback of 99% or better.

A sample size of three isn't very large, but given my 100% success rate buying complete laptops and 100% failure rate buying parts, I'd place a strong warning on buying laptops parts via online auction.

Sunday, May 17, 2009

Why I Custom Build My Computers

For the last fifteen years I've built all of my own computers. The recipe has been straightforward:
  • Intel CPU at the "elbow" of the curve for price/performance.
  • ASUS motherboard with good fan control.
  • Hard drive recommended by StorageReview.com on their Leader Board.
  • Zalman CPU fan.
  • RAM with good reviews on NewEgg.
  • Namebrand power supply. For the last five years it's been a SeaSonic.
  • A fanless video card, usually an XFX nVidia card. (Nothing against ATI, I just know the nVidia quirks inside and out.)
The most important features to me are reliability, fan control and BIOS control. Reliability because I make my living based on these systems and BIOS control so that I can set the system up without compromise. I don't overclock, but BIOS control can be the critical difference when faced with non-Windows operating environments (which are often used by disaster recovery tools.)

Fan control is a biggy. I really, really hate fan noise. Only in the last few years of manufacturers started to work on this as computers have become home theater accessories. Fans have been made quieter and have been put under the control of the motherboard to slow them down as the cooling requirements drop.

I've ordered the last couple of new systems from EndPcNoise.com. They follow my "recipe" for everything except the hard drive. They also assemble it, test it, route and tie all of the cables, and add additional sound damping devices as requested. The systems I've bought from them have been the best I've ever owned. (I have no financial interest in this company, I'm just a happy customer.)

Last week I bought a used computer system for our test lab. Most of the lab computers are cast-offs from developers, so most of the lab systems follow my recipe. However, we needed a modern system for 64-bit testing, so I bought a used Gateway FX7026, a mid-range consumer system.

My expectations were appropriate for this system. I expected comparatively louder fan noise, poor documentation and shovelware installed with the operating system. I'm pleased to say that I was right on all of these. Unfortunately, things went downhill from there. I was reminded in no uncertain terms why I don't buy systems from vendors like Dell, HP and Gateway.

The first problem is figuring out what's in the computer. The documention doesn't really discuss it. As an example of someone who does this right, if you type a system's serial number into the IBM/Lenovo site, you'll be given all of the relevant build information for that particular system. Gateway doesn't give you any of that, so you have to find the components by searching the web or by tearing the system apart and trying to read part numbers.

The second problem is updating drivers. My definition of "simple reinstall" also comes from the IBM/Lenovo Thinkpad. Boot the "Restore CD." Walk away for 90 minutes. Come back, install the IBM System Update utility, let it install the latest required drivers. Install updates for Windows. Done.

Gateway used to have such a utility. They still recommend using it on all driver download pages. But the utility is no longer supported and does not work with any system built since 2004. So you have to manually go through the Downloads page, download each update, extract it, install it, reboot, and move on to the next update. Elapsed time - several hours. And you'd better have a second computer to help you with this because the drivers for the network chip are not built into XP.

I avoided most of these problems by installing Windows 7 RC, which has a remarkable inventory of drivers built into. There were only two red X's in the Device Manager after installation.

After Windows 7 booted, I was surprised to look in Task Manager and see that the network card maxed out at 100Mbps. This was a surprise because I had researched the G33 motherboard before purchasing the system and all models of the G33 include gigabit networking. I'd find out the cause shortly.

Next I tried to install the Windows 7 update that enabled Virtual PC and Windows XP. Except that the update refused to install, complaining that Virtualization extensions weren't supported. I knew that the processor supported them. This was a critical issue and I had read Intel's spec sheets before buying the computer.

I learned that Virtualization extensions required BIOS support. No problem, I'd get the latest BIOS from Intel. I had specifically bought this computer because it had a standard Intel motherboard. Gateway refers to the motherboard model as "Shroedoer Town" but doesn't list the exact model. I eventually found out from a handy article that it's a DG33SXG2. Shrewd readers will note that there is no such motherboard on Intel's site.

And here's the final insult. Gateway took Intel's bottom-of-the-line G33 motherboard - and detuned it with cheaper hardware! Gateway removed the GigE ethernet. They removed the ability to use standard Intel BIOS upgrades. They removed the support for virtualization extensions. And Gateway had the temerity to call it a "mid-level" system. I call it cheap.

So Gateway has now made sure that they will never, ever get more business from me. Poor documentation, poor hardware, poor driver updating - there really isn't a lot more to get wrong.

For me, this is a sad thing to see. The first computer I bought after I graduated college was a Gateway 486. I used the famous cow box as a coffee table in my apartment. The monitor was the very first 15" monitor on the market that was "affordable." There was a lot of innovation in that system and it lasted me for years.

P.S. I never did get the fan controls on the FX7026 to work. That's a standard feature of the G33 motherboard, so I can't tell if Gateway broke that too or if there were other factors at play. I also couldn't find any third party software, including SpeedFan, that supported the G33 fan and temperature controllers. Even Intel's software didn't work because I was running a 64-bit operating system.

Wednesday, April 15, 2009

AppCrash in StackHash_1703

I've wasted an hour solving this one. Here's the symptom. Your application crashes on Windows Vista almost immediately after it starts. If you look at the "Details", you see something like:

Problem signature
Problem Event Name: APPCRASH
Application Name: xxxxx
...
Fault Module Name: StackHash_1703
Fault Module Version: 0.0.0.0

The problem is that there's no such module as "StackHash_1703", so this appears to be some special case in Windows. I tried turning off antivirus and enabling compatibility mode, but the application still would not work.

The problem was that I had DEP (Data Execution Protection) enabled. For whatever reason, the error message gave me the AppCrash error above instead of the standard message about "DEP has closed the program."

To solve the problem, I added the application to the DEP exclusion list and everything worked again.

If the application that's crashing is video related (such as MovieMaker or Media Player), then your problem is probably caused by an old versions of Nero or an old video Codec.

Monday, March 9, 2009

Dell 1815dn Printer Review: Stay Far Far Away

I bought a Dell 1815dn multifunction laser printer a while back. I've absolutely hated the thing. Everything it does, it does the hard way. I would write more about how bad this printer is, but I've found someone else who beat me to it:

http://www.yelsew.com/dell-1815dn-review.html

I agree 110% with every single thing in this article. I could go on and on, except none of the language is printable in a family blog.