Kwakkelflap: tools for the IT pro

Wednesday, March 19, 2008

Code signing, part two

I just received word from Comodo. Seems I can't use their certificate in Vista making it useless for me. You'd think companies would adapt to a new OS after a year. Too bad they didn't tell me about this a week ago. Better yet: warn me when ordering the certificate that it can't be used on Vista. I received a refund the minute I asked about it, so no complaints there.

I'll be checking other certificates, but I don't think I'll postpone the Service - O - Matic release.

Labels: ,

Monday, March 17, 2008

Code signing

Code signing is more important than ever with the release of Windows Vista. People that use your software get a scary warning message when starting your application if the code isn't signed. This might scare potential customers which isn't a good idea.

So I decided to sign all my software. I bought a certificate from Comodo a week ago. It was the cheapest solution and I've read it doesn't matter much where you get your certificate from. But maybe I was wrong.

First they had me send them my ID and two other documents to prove I'm legit. Then they tried to install the certificate. This didn't quite work cause I always use Firefox. Seems they can only install it in Internet Explorer. A warning would have been nice. So I tried it a second time and the certificate was installed. The certificate had the wrong name on it (why did I send those 3 documents?). Also, I couldn't sign my software with this certificate. Contacted support again. They asked me to create several files and try again. Didn't work. Then they asked me to order again right until the payment step. Didn't work.

So a week later I'm still not able to sign my software. I'm testing release candidate 1 of the new Service - O - Matic and I'm eager to release it. But I still have to wait until I can sign it before I can actually release.

Labels: , ,

Sunday, March 09, 2008

RentACoder

I'm swamped with work. I've released a new version of Fping this weekend which should have been released a month ago. And I'm working on a new Service - O - Matic and Watchdog - O - Matic release at the same time.

I also need to add some features to Fping. Basically I want Fping to ping IPv6 addresses. I don't know where I'm going to find the time to do this so I thought I'd contact someone else to do it for me.

I went to RentACoder, a site that helps getting developers together. Basically you post a software project you want to create and people will place bids. Then you can choose the bid you like most and they can get to work.

I have 5 different bids after 48 hours. 3 of them seem interesting, most of them charging around $100 which is very cheap if you ask me. How can someone earn a living if they estimate 5 days of work at $100 total, living in the US?

I'm not sure if I'll take any bid. I fear I'll have a serious amount of work telling the developer what I want, creating a platform they can work with and checking the work when it's finished. It's probably easier and less time consuming to do it myself and I know I'll have what I want for sure. But it might be a good test for bigger projects later on.

Labels: ,

Saturday, February 02, 2008

Vista Reliability Monitor crash information

I'm sure everyone has programs crashing on their computer. Our Watchdog – O – Matic application can help out. But how can you check which programs crashed, and when?

Windows Vista has a program called 'Performance and Reliability Monitor' which tracks the crashes on your system. You can track how stable your computer is, based on the number of crashes. The graph like you see below includes information on various system failures.



So all you need to do is check the Reliability Monitor to discover which programs are crashing and create a new watchdog for each crashing program. With Watchdog – O – Matic these programs won't crash anymore so you won't see these items in the Reliability Monitor. This proves that your system will be more reliable and stable.

Labels: , ,

Saturday, December 22, 2007

Site uptime monitoring

It seems I'm not the only one with hosting problems. Andy points out a good tool to monitor your website. I've signed up right away.

Labels:

Thursday, October 18, 2007

AdWords problems

I was fiddling with my adds one day. After adding some keywords to one of my campaigns, they all suddenly stopped working. I contacted Google, and received a default answer: are you bidding high enough? Did you pause the campaigns? That sort of thing. It didn't surprise me that the first mail was a default mail. I mailed them back right away writing I simply added keywords and ALL of my campaigns stopped working, not simply the one I changed.

The next mail I receive is 3 days later. They want to know if I'm happy with the support I received. I nearly fell out of my chair. No I'm not happy. All I got was a standard mail back and all my campaigns are still not functioning.

2 Days after I get another mail saying they are looking into it. So I wait another 4 days before I mail back to figure out if they finally found something. The answer is rather surprising: I received another default mail telling me they suspended my AdWords account because they believe someone else logged into my account.

I have a Vista machine and an OpenSuse machine on my desk, and I log into my account from both depending on what I'm doing. I even log in using my wife's laptop which has Windows XP and uses a different IP cause I'm using a wireless connection. This probably raised a flag in their system blocking my account.

Adds are back up after 2 weeks. Sales where a little slow, so I hope they will pick up again.

Labels: ,

Wednesday, October 03, 2007

Hosting problems

Some of you might have noticed: the Kwakkelflap website was down for the last couple of hours. I've had some downtime before, but never as long as the last one. So I decided to pull the plug and switch to a new hosting service. I'm still uploading and installing everything on the new server, so part of the website might be down. E.g. the forum is down cause I'm having problems with installing the MySQL database. I'll try to get it fixed ASAP.

Labels:

Thursday, September 13, 2007

Small progress update

Things are looking good for the new Watchdog - O - Matic release. I've received 1 bug report. Most users shouldn't encounter it and I'll be releasing a fix later this week (probably in the weekend). The 64 bit update of Service - O - Matic and Sniff - O - Matic are moving along nicely. I'll probably be able to release Sniff - O - Matic 1.07 in a few days. Service - O - Matic will have to wait cause I also need to implement some new features.

One of the disadvantages of the 64 bit versions is that the setup program is more than 2 times as big. The Watchdog - O - Matic trial went from 2 MB to 4.3 MB. Still very small compared to other downloads if you ask me (download takes less than a minute with a decent connection). But my server bandwidth usage is through the roof. I've contacted my web host and they assured me that it won't be any problem. Fingers crossed.

Labels: ,

Friday, July 20, 2007

x64 Versions and setup

I'm porting our Watchdog application to VC++ 2005. It's a lot of work, and the end result should be no difference for the user. But it's a step I'd have to take eventually.

One advantage of this port is that I'll be able to create 64bit versions of my applications. Some people think it's to early to worry about 64bit, but I don't believe it is. Every new PC sold nowadays is capable of 64bit. And I see a rise in people using a 64bit operating system. Also, it doesn't hurt to be prepared. It's something every misv will have to do eventually, so why not do this early on.

One thing I don't want is a separate download for 32 and 64 bit versions. The installer should check the operating system and install the 32bit or 64bit version. Maybe create an option to install the 32bit version on a 64bit system for compatibility. So I checked Inno setup and apparently they have everything I need (again). Simply set that x86 and x64 are allowed and your setup will automatically detect a 32 or 64bit install. Then, separate the 32bit and 64bit files and add a check with the IsWin64 function to install the correct file. That's all. The setup itself stays 32bit, but that shouldn't be a problem.

It will take some time to create the 64bit versions, and I'll need to test the new system on 32bit and 64bit operating systems. But you can expect 64bit versions of the Kwakkelflap programs in the near future.

Labels: , ,

Tuesday, July 17, 2007

Try, catch or miss?

I'm porting my applications from VC++ 6.0 to VC++ 2K5. Vista and VC++ 6.0 are not the best friends. I just finished porting Fping, where I had some linking problems cause I overloaded the printf() function. In the end, I simply renamed the function and each call to printf(). Next on my list was a simple MFC GUI application: the crash test application that comes with Watchdog – O – Matic.

The intent of this program is to generate first chance and second chance exceptions. To generate a first chance exception I have this code:

CDialog* pDialog = NULL;
try
{
pDialog->Detach();
}
catch(CException* e)
{
e->Delete();
}
catch(...)
{
}


Everything works fine when compiled with VC++ 6.0. The exception is handled. But when I compile this with VC++ 2K5, the exception isn't handled, and I have a second chance exception (a crash). Vista displays a dialog box, and Watchdog – O – Matic detects a crash instead of a first chance exception. I'm still looking for a solution. Hope there aren't many of these problems when converting...

Labels: ,

Tuesday, July 10, 2007

Source Control

As a developer, you need a source control system. Even if you're the only developer.

  • It's great if you have to solve bugs when working on a new version.
  • You can always check the history of each source file to see what happened.
  • Merging different source files is easy.

I used SourceSafe cause it came with the development environment, but never liked it. I don't think it even qualifies as a real Source Control program. So I switched to Perforce a while ago. I love their system. Easy to install, and the GUI is very intuitive. And the best part is: it's free for 2 developers (and 5 client workspaces).

So if you're a developer and you don't use a source control (or even if you do), I advise you to check Perforce. And no, they don't pay me anything to say this. I'm just a very happy user.

Labels: ,

Wednesday, June 20, 2007

Customer map

Plimus sales reports have a great feature: they automatically create a map with your customers location. I thought it would be interesting to share this information with you.

This is not a complete map of all my customers. I have 2 credit card processors, and this data is only from one of them (Plimus). Also, not all customers are shown on the map for some reason (e.g. most UK addresses seem to be a problem). So only half of my customers are on the map, and I'll only show the data for 2007. Anyway, these images should give you an idea.

The World:



It's clear that most of our customers live in the US or Europe.

The USA:



New York area:



Europe:

Labels: ,

Tuesday, May 08, 2007

Finding crash information using the MAP file

This is an article previously published on the code project. It might be a little outdated, but it's still a good read.

Introduction

Programming neat applications is one thing. But when a user informs you your software has crashed, you know it's best to fix this before adding other features. If you're lucky enough, the user will have a crash address. This will go a long way in solving the problem. But how can you determine what went wrong, using this crash address?

Creating a MAP file

Well first of all, you'll need a MAP file. If you don't have one, it will be nearly impossible to find where your application crashed using the crash address. So first, I'll show you how to create a good MAP file. For this, I will create a new project (MAPFILE). You can do the same, or adjust your own project. I create a new project using the Win32 Application option in VC++ 6.0, selecting the 'typical "Hello Word!" application' to keep the size of the MAP file reasonable for explanation.

Once created we need to adjust the project settings for the release version. In the C/C++ tab, select "Line Numbers Only" for Debug Info.



Many people forget this, but you'll need this option if you want a good MAP file. This will not affect your release in any way. Next is the Link tab. Here you need to select the "Generate mapfile" option. Also, type the switches /MAPINFO:LINES and /MAPINFO:EXPORTS in the Project Options edit box.



Now, you're ready to compile and link your project. After linking, you will find a .map file in your intermediate directory (together with your exe).

Reading the MAP file

After all this dull work, now comes the neat part: how to read the MAP file. We'll do this by using a crash example. So first: how to crash your application. I did this by adding these two lines at the end of the InitInstance() function:

char* pEmpty = NULL;
*pEmpty = 'x'; // This is line 119


I'm sure you can find other instructions which will crash your application. Now recompile and link. If you start the application, it will crash and you'll get a message like this: 'The instruction at "0x004011a1" referenced memory at "0x00000000". The memory could not be "Written".' .

Now, it's time to open the MAP file with notepad or something similar. You MAP file will look like this:

The top of the MAP file contains the module name, the timestamp indicating the link of the project, and the preferred load address (which will probably be 0x00400000 unless you're using a dll). After the header comes the section information that shows which sections the linker brought in from the various OBJ and LIB files.

MAPFILE

Timestamp is 3df6394d (Tue Dec 10 19:58:21 2002)

Preferred load address is 00400000

Start Length Name Class
0001:00000000 000038feH .text CODE
0002:00000000 000000f4H .idata$5 DATA
0002:000000f8 00000394H .rdata DATA
0002:0000048c 00000028H .idata$2 DATA
0002:000004b4 00000014H .idata$3 DATA
0002:000004c8 000000f4H .idata$4 DATA
0002:000005bc 0000040aH .idata$6 DATA
0002:000009c6 00000000H .edata DATA
0003:00000000 00000004H .CRT$XCA DATA
0003:00000004 00000004H .CRT$XCZ DATA
0003:00000008 00000004H .CRT$XIA DATA
0003:0000000c 00000004H .CRT$XIC DATA
0003:00000010 00000004H .CRT$XIZ DATA
0003:00000014 00000004H .CRT$XPA DATA
0003:00000018 00000004H .CRT$XPZ DATA
0003:0000001c 00000004H .CRT$XTA DATA
0003:00000020 00000004H .CRT$XTZ DATA
0003:00000030 00002490H .data DATA
0003:000024c0 000005fcH .bss DATA
0004:00000000 00000250H .rsrc$01 DATA
0004:00000250 00000720H .rsrc$02 DATA


After the section information, you get the public function information. Notice the "public" part. If you have static-declared C functions, they won't show up in the MAP file. Fortunately, the line numbers will still reflect the static functions. The important parts of the public function information are the function names and the information in the Rva+Base column, which is the starting address of the function.

Address Publics by Value Rva+Base Lib:Object

0001:00000000 _WinMain@16 00401000 f MAPFILE.obj
0001:000000c0 ?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z 004010c0 f MAPFILE.obj
0001:00000150 ?InitInstance@@YAHPAUHINSTANCE__@@H@Z 00401150 f MAPFILE.obj
0001:000001b0 ?WndProc@@YGJPAUHWND__@@IIJ@Z 004011b0 f MAPFILE.obj
0001:00000310 ?About@@YGJPAUHWND__@@IIJ@Z 00401310 f MAPFILE.obj
0001:00000350 _WinMainCRTStartup 00401350 f LIBC:wincrt0.obj
0001:00000446 __amsg_exit 00401446 f LIBC:wincrt0.obj
0001:0000048f __cinit 0040148f f LIBC:crt0dat.obj
0001:000004bc _exit 004014bc f LIBC:crt0dat.obj
0001:000004cd __exit 004014cd f LIBC:crt0dat.obj
0001:00000591 __XcptFilter 00401591 f LIBC:winxfltr.obj
0001:00000715 __wincmdln 00401715 f LIBC:wincmdln.obj
//SNIPPED FOR BETTER READING
0003:00002ab4 __FPinit 00408ab4
0003:00002ab8 __acmdln 00408ab8

entry point at 0001:00000350

Static symbols

0001:000035d0 LeadUp1 004045d0 f LIBC:memmove.obj
0001:000035fc LeadUp2 004045fc f LIBC:memmove.obj
//SNIPPED FOR BETTER READING
0001:00000577 __initterm 00401577 f LIBC:crt0dat.obj
0001:0000046b _fast_error_exit 0040146b f LIBC:wincrt0.obj


The public function part is followed by the line information (you got this if you used the /MAPINFO:LINES in the Link tab and selected the "Line numbers" in the C/C++ tab). After this, you will get the export information if your project contains exported functions and you included /MAPINFO:EXPORTS in the link tab.

Line numbers for .\Release\MAPFILE.obj(F:\MAPFILE\MAPFILE.cpp) segment .text

24 0001:00000000 30 0001:00000004 31 0001:0000001b 32 0001:00000027
35 0001:0000002d 53 0001:00000041 40 0001:00000047 43 0001:00000050
45 0001:00000077 47 0001:00000088 48 0001:0000008f 52 0001:000000ad
53 0001:000000b3 71 0001:000000c0 80 0001:000000c3 81 0001:000000c8
82 0001:000000ff 86 0001:00000114 88 0001:00000135 89 0001:00000145
102 0001:00000150 108 0001:00000155 110 0001:00000188 122 0001:0000018d
115 0001:0000018e 116 0001:0000019a 119 0001:000001a1 121 0001:000001a8
122 0001:000001ae 135 0001:000001b0 143 0001:000001cc 172 0001:000001ee
175 0001:0000020d 149 0001:00000216 157 0001:0000022c 175 0001:00000248
154 0001:00000251 174 0001:0000025f 175 0001:00000261 151 0001:0000026a
174 0001:00000287 175 0001:00000289 161 0001:00000294 164 0001:000002a8
165 0001:000002b6 166 0001:000002d8 174 0001:000002e7 175 0001:000002e9
169 0001:000002f2 174 0001:000002fa 175 0001:000002fc 179 0001:00000310
186 0001:0000031e 193 0001:0000032e 194 0001:00000330 188 0001:00000333
183 0001:00000344 194 0001:00000349


Now we will look up where the crash occurred. First, we'll determine which function contains the crash address. Look in the "Rva+Base" column and search the first function with an address bigger than the crash address. The preceding entry in the MAP file is the function that had the crash. In our example our crash address is 0x004011a1. This is between 0x00401150 and 0x004011b0 so we know the crash function is ?InitInstance@@YAHPAUHINSTANCE__@@H@Z . Any function name that starts with a question mark is a C++ decorated name. To translate the name, pass it as a command-line parameter to the Platform SDK program UNDNAME.EXE (in the bin dir). You won't need to do this most of the time as you might figure it out just by looking at it (here: InitInstance() in MAPFILE.obj).

This is a big step for bug tracking. But it gets even better: we can find out on which line the crash occurred! We need to do some basic hexadecimal mathematics, so people whom can't do this without a calculator: now is the time to use it. The first step is the following calculation: crash_address - preferred_load_address - 0x1000
Addresses are offsets from the beginning of the first code section, se we need to do this calculation. Subtracting the preferred load address is logical, but why do we need to substract another 0x1000? The crash address is an offset from the beginning of the code section, but the first part of the binary isn't the code section! The first part of the binary is the Portable Executable (PE), which is 0x1000 bytes long. Mystery solved. In our example, this is: 0x004011a1 - 0x00400000 - 0x1000 = 0x1a1

Now it's time to look in the line information section of the MAP file. The lines are shown like this: 30 0001:00000004. The first number is the line number, the second number is the offset from the beginning of the code section in which this line occurred. If we want to look for our line number, we just have to do the same thing we did for the function: determine the first occurrence of a bigger offset than the one we just calculated. The crash occurred in the preceding entry. In our example: 0x1a1 is before 0x1a8. So our crash occurred on line 119 in MAPFILE.CPP.

Keeping track of MAP files

Each release had it's own MAP file. It's not a bad idea to include the MAP file with the exe distribution. This way, you can be certain you have the correct MAP file for this exe. You could keep every MAP file with every exe on your system, but we all know this might give some troubles later on. The MAP file doesn't contain any information you wouldn't want the user to see (unless maybe class and function names ?) . A user would have no use with it, but at least you can ask for the MAP file if you don't have a copy yourself.

Labels: ,

Wednesday, May 02, 2007

Website facts

Some interesting facts from our website visitors:

  • 60% use Internet Explorer, while 35% use Firefox. Firefox is still rising slightly, but not as fast as it did before.
  • 80% use Windows XP, 7% use Vista. Windows 2000 and 2003 each take 5%. I'm surprised with how fast Vista is gaining popularity.
  • Most people have a screen resolution of 1280x1024 or 1024x768 (each 35%). Only 5% have a resolution below 1024x768.
  • 99% have java enabled

I am curious how many people have .net and which versions. Unfortunately, Google Analytics doesn't tell me.

Labels:

Friday, March 23, 2007

Spring Cleaning

Right now, I'm working on a new version of Watchdog - O - Matic. While I was implementing a new feature, I saw some things I wanted to change for a long time but never got around doing it. Particularly the UI and the way users create watchdogs was not clear and could be a lot easier. So I'm rewriting a lot of code, implementing almost everything in a different way. At almost 40000 lines of code right now, this is nothing to scoff at. Luckily the core debugging code can remain unchanged. The major overhaul is nearly complete, but I still need to implement the new features. I'm eager to release this version though, as it is a huge improvement for the user. Deadline is a month from now (this includes testing), and due to the huge improvements, we'll move to version 5.0 .

Labels: ,