Wednesday, February 28, 2007

Quick MaraDNS and Chortle font update

I am looking at the code that allocates and frees memory in MaraDNS' recursive cache. The code is a little complicated because there are three cases to account for:

  • A standard DNS query stored in the cache. (This is further divided in to CNAME and non-CNAME answers)
  • A NS reference stored in the cache.
  • A "This name does not exist" stored in the cache.

Each of these is stored in the cache slightly differently, and needs to be deallocated differently. To make things worse, I wasn't aware of all these permutations when I first wrote the cache, so things are a little messy in the code.

I still have to catch up on support email; as of yesterday, I had one unanswered email. I may have more today; I'm only on the internet for 30 minutes today to download some files for my class tomorrow, so I don't have time to check it.

I have done all 200+ glyphs for the 15-pixel size version of the Roman (non-bold and non-italic) font for Chortle. I am now working on the 15-pixel bold version, which is difficult, especially with the upper case letters with diagonal strokes, such as "A", "M", "N", "V", "W", "X", "Y", and "Z". The problem, especially with "M" and "W", is that, if I make the strokes two pixels wide, these letters look heavier than other letters. If I make some of the strokes one pixel wide, the letters look funny. So, I've been making all of the strokes two pixels wide; while the letters are darker than other letters, this seems to be the best solution.

Tuesday, February 27, 2007

MaraDNS update; Chortle 0.11 released

Well, the testing for the 20070226 snapshot of MaraDNS shows that, while the code does not crash anymore, it leaks memory like a seive. It's time for me to overhaul the relevant code that allocates and frees memory. I will work on this tonight.

I have released version 0.11 of my Chortle font today. The big change is that the vertical spacing is a little tighter and most accents are no longer clipped. Å is still slightly clipped at the top; since this is a letter I never use and one which I think is fairly rare, I will live with this, so that Chortle can have rougly the same vertical spacing as the Verdana font. The way Verdana handles Å is by moving the ring down so that it touches the top of the "A".

The other changes are that the version number has been corrected and updated in all .ttf files, and the "big bullet" character has been removed from the Unicode version of the font and a little more spacing has been put around this character.

I'm currently working on the bitmap versions of the Chortle font at various resolutions; it takes me two or three days to do all of Chortle's glyphs at a given resolution and font weight.

Monday, February 26, 2007

Chortle fonts released; MaraDNS updates

As I mentioned in a previous blog entry, I am very happy with the Charis SIL font except for a couple of annoyances:

  • The vertical line spacing is to high.
  • The font does not look good on the screen.

I have installed the wonderful Fontforge program and have begun work on a font called Chortle, which is a derivitive of Charis SIL that will address the two problems.

Since classic TrueType hinting can not be done without violating an Apple patent, the way I will make this font readable on the screen is by using FontForge's ability to edit both bitmap and vector versions of the sam font. Basically, I will correct, by hand, the bitmap versions of Charis Chortle at a few different pixel sizes. Since this is very labor intensive, I have reduced the number of glyphs in Charis from thousands to about 200. This also has the advantage of reducing the size of the font and making it more suitable for use in embedded systems.

There is quite a bit to do with this font; I still need to tidy up the ascent and descent values and put some space around the bullet. I may also put a dot in the "0" character to make it distinct from "O".

For people who are interested, the Chortle font can be downloaded here:

An update to the MaraDNS roadmap that I just posted to the list:

I have already done all of the changes to the csv2 parsing code to use tilde as record separators while being compatible with MaraDNS 1.2 csv2 zone files. I have also already added the bind_port and upstream_port variables, have made it possible to customize the nameserver used to recursively resolve a given subdomain, but have not rewritten udpany() yet.

I haven't touched the Python script to convert BIND zone files in to MaraDNS 1.3 zone files since 2006. My next MaraDNS project is to finish this script.

I have also made the final changes to the memory allocation so that Valgrind will always report that MaraDNS is not leaking memory. I am doing some stress testing right now, as I am typing this, to make sure MaraDNS' memory allocation is airtight.

I have found and fixed the problem with MaraDNS 20070219 crashing. Right now, as I am typing this, I am stress testing the MaraDNS 20070226 snapshot to make sure it is airtight.

I have just answered all support mail people have sent me the last few days. I will probably take a few days to answer mail that comes in.

- Sam

Friday, February 23, 2007

mp3 submarine patent

OK, Microsoft licenses, for a pretty penny ($16 million), the right to use the mp3 format with Microsoft Windows. So, what happens. Alcatel Lucent claim that there are other patents that affect the mp3 format that they own. So, they sue Microsoft. and win the case

Keep in mind:
  • Alcatel's issue should not be with Microsoft, but with Thomson, who claimed that Microsoft (and Apple and all the people who make digital music players) had a mp3 license.
  • This affects anything and everything that can play mp3
  • This is a classic submarine patent. For years Alcatel/Lucent had this patent. Now, finally, they sue years after mp3 has basically dominated the compressed music market
  • This is another case for using Vorbis a non-patented music format that sounds better than mp3 at the same bitrate, but, alas, doesn't have portable player support.

Anyway, this decision makes me very angry. The patent law has to be reform to stop this kind of submarine patent litigation. I hope Microsoft wins on appeal.

Support update; another minor bug

I have answered all of the support email sent to me earlier this week. There are two emails sent more recently that I have not had time to address yet.

One person pointed out that a different format for MaraDNS 1.3 zone files that don't use a tilde between records would be more aestically pleasaing. I agree. However, I also have to consider MaraDNS 1.2 zone file compatibility and ease of zone file parsing by UNIX scripts. It's water under the bridge at this point; the new tilde separated parsing code is completed and I'm moving on to improving the memory allocation so Valgrind never complains.

When testing things for the second support concern, I found a bug in the CSV2 parsing of zone files.If a zone name ends in a percent, the RR has to be explicitly stated for A records. In other words, this is incorrectly a syntax error:


Note that this does work:

As does this:

www.% A

The workaround is to make sure all records ending with a percent have an explicit rr type.

- Sam

Tuesday, February 20, 2007

If I could only have three fonts...

If I could only have three fonts, the fonts would be:

  • Microsoft's very beautiful Verdana font (Download) designed by Matthew Carter. This is the most readable true type fonts at the low resolutions current computer displays have. In order to take full advantage of this font in Linux, you need to enable autohinting in FreeType; a process that requires a recompile of FreeType and may violate some patents.

  • The Summer Institute of Linguistics Charis SIL font. This is a derivitive of another one of Matthew Carter's typefaces: Bitstream Charter. This is a True Type conversion of the original, free Bitstream Charter font. Charis SIL has excellent multilingual support, and, more importantly for my uses, has all of the special characters linguists need to transcribe the sounds of words in IPA (a special character set that directly transcribes how a word sounds). I use this font in my English classes to show people how to say different words.

    For some reason, the Charis font has noticably thicker stokes than the original Charter font, like the font was very slightly bold. The font also has a couple of annoyances. One is that the spacing between lines is very large; this is so the font can fit complex litagures used with some IPA transcriptions. The other annoyance is one it shares with Bitstream Charter: The font looks unattractive when rendered on a low-resolution screen. Even anti-aliasing does not completely resolve the issue. Interestingly enough, once I make a .pdf file from a document using the Charis SIL font, the .pdf looks fine on a computer screen. In fact, all of my English lessons use the Charis SIL font.

  • The Unicode versions of the old X11 "Misc fixed" fonts. These are very readable fonts that I have been using in some form or another since 1993; they are very readable bitmap fixed-width fonts. They are far easier on my eyes than any courier derivitive. The main disadvantage of these fonts is that they areonly available in a few point sizes, and that they only work (as far as I know) in the X11 environment for Linux and UNIX systems.

All three of these fonts are freely downloadable, and I have mirrored the fonts here.

Note that both the Verdana and the Fixed fonts look excellent without using any anti-aliasing. I don't like anti-aliased fonts; they give me headaches. In particular, since the fonts look a little blurry, my eyes always try to refocus on them; this hurts after looking at them for a while.

The MaraDNS support mail is starting to pile up again. I'll probably catch up with today's emails tomorrow.

Monday, February 19, 2007

MaraDNS snapshots updated

First of all, I have added MaraDNS to the MaraDNS Sourceforge page.

Second of all, Daniel has already contributed a Slackware package of MaraDNS Slackware users are encouraged to upgrage as soon as possible.

Finally, I have uploaded some new snapshots of MaraDNS today:

  • I have backported the connect()/send()/recv() changes to the recursive code in the the 1.0 branch. I will release MaraDNS 1.0.40 in a few days. This snapshot can be found here
  • I have updated the FAQ and other documentation in the stable branch of MaraDNS. This snapshot can be found here
  • I am working on improving the memory allocation with MaraDNS 1.3. The 20070219 snapshot should not be used unless you are willing to assist me with these changes. If you want to download a usable development snapshot, download the 20070216 snapshot instead.

Saturday, February 17, 2007

MaraDNS released

I have just released MaraDNS, which is a stable release of MaraDNS. This is a bugfix release; a couple of important bugs with MaraDNS have been fixed with this release.

The bugs fixed are important bugs; distributors of MaraDNS are encouraged to update to this version of MaraDNS as soon as possible.

From the changelog:

  • LOC records with a precision that is a multiple of 10 now work.

  • Memory leak found by Rani Assaf plugged.

  • Recursive server now more robust against certain DOS attacks.

  • Documentation updates.

This release has not been uploaded to sourceforge yet; the release can be found here:

Friday, February 16, 2007

Cool fonts

Here are some cool freely downloadable fonts:

  • Charis SIL. This is an update to the excellent Bitsream Charter font by Matthew Carter, who later on made Verdana and other WebFonts for Microsoft. The original free Bitstream Charter was never translated in to TTF; this is a TTF translation that includes many more charaters, mainly characters of interest for linguists. The license is a very liberal Open Font license. The font's only problems are that it puts a lot of space between lines (this can be worked around by setting up formatting to force lines to be 12 points apart when using writing with 12 point text), and that it looks unattractive on the screen when writing documents with it (it looks fine on the screen once the document is made a pdf file). I use this font for all of my English lessons.
  • Delicious and three others (look at the toolbar on the left)
  • Smeltery has a few free fonts (Same license as the Delicious font)
  • Lido STF
  • Day roman The BabelFish translation of its license is "The fonts on this site acres freeware and CAN used as they acres in any context without by mission from Apostrophic Laboratories, except ton produce material that is racist, criminal and/or illegaly into nature. It is prohibited tons modify any Apostrophic Laboratories font(s) for repackaging and/or the RH releases without at express written authorization by the designer (s) of OF the font(s) or Apostrophic Laboratories. Under NO circumstance shall any Apostrophic Laboratories Design or font Design pay or purchased."

There are many other fonts listed in other blogs, such as here, here, and here.

New MaraDNS snapshot

I have released a new snapshot of MaraDNS today. In this snapshot, the recursive code has been updated to connect() to the remote DNS server. Rani pointed out to me that you can actually connect with a UDP connection; I looked at the relevant POSIX spec, and, lo and behold, he's right. This is useful because it makes certain DOS attacks more difficult; by connecting() and using send() and recv() instead of sendto() and recvfrom(), the only IP address allowed to connect to an open port is the IP address we are connected() to.

I have also verified that these changes work without problem in OpenBSD, Linux, and Win32. I have also done some basic stress testing of the MaraDNS server.

I have snapshots for both the stable and development versions of MaraDNS available:


I will release MaraDNS early next week after I do some more testing.

- Sam

Wednesday, February 14, 2007

MaraDNS 1.3.03 released; hash function tarball updated

Rani Assaf found a memory leak in MaraDNS' code that my SQA setup didn't catch. I have revised my SQA process to catch this particular leak, and have plugged the leak.

In addition, since Roy asked me to compile the Win32 port of MaraDNS with the "-pipe" switch to speed things up, I made the appropriate change to the Win32 makefile. Alas, "-pipe" seems to, if anything, slightly slow down the compiling of MaraDNS in win32.

There are a number of other bugfixes and enhancments which are in the post-1.3.02 development branch, such as it now being possible to have "." by itself being a hostname. Read earlier snapshop announcments for details.

MaraDNS 1.3.03 is available here:

MaraDNS 1.3.03

For a few years now, I have had a tarball with various cryptographic hash algorithms available. This tarball hasn't been updated since 2001. Now, with the NIST starting to work on getting a new hash function out there, there have been some new hash primitives developed, including RadioGatun and LASH. In addition, I have found a couple of interesting hash functions which never got mainstream interest: Michael Johnson created a 256-bit hash function called Sapsum a few years ago, and last year a suite of encrpytion primitives, including a hash function, is included with the FastFlex suite.

This in mind, I have finally updated the suite of hash functions, removing some broken algorithms (MD4, MD5, the CRC and UNIX sums, etc.), and adding some new algorithms. The revised suite is available here:


Happy Valentine's day everyone!

Tuesday, February 13, 2007

OK, I'm caught up with MaraDNS support email

I have finally answered all of the MaraDNS support email I got in the last few days. Like I said before, it sometimes takes me up to a week to answer email. If you sent a support email before today and it isn't answered, please resend it.

There are a couple of bugs that people reported in support emails:
  • Zone files sometimes act funny if the last character is not a newline. This is something where I will have to go through the RR parsing code for each record type and make sure they can end with either a newline/space or with a EOF.
  • There is a reported memory leak. The reporter was even kind enough to tell me where the memory that causes the leak is allocated. I have already downloaded and installed valgrind. I will look in to this leak in the next day or two.
One support email asked about BIND zone file support. We're very close to getting support; the CSV2 parse code has already been revised to make it easier for me to finish my python script, and to have CSV2 zone files, as much as possible, have the same formatting as the converted BIND zone file. Now I just have to finish up the parsing script. Then the testing will begin.

One thing I am very seriously considering doing is starting to sell commerical level support for MaraDNS. There are some things I want to finish up with MaraDNS first however: The BIND zone support, and the rewrite of the recursive resolver.

Another support email asked for help with making a distribution-specific package for MaraDNS. Quite frankly, this goes beyond the boundaries of support I offer for MaraDNS. I offer both a CentOS/RHEL distribution-specific package of MaraDNS, and a Windows 32 native binary (which is a partial port). Kai makes a Debian/Ubuntu package, Alex makes a FreeBSD port, and Daniel makes a Slackware package. If you run anything else, I can't really help you because I only run Win32, CentOS 3, and Ubuntu 6.06.

That said, I am willing to make a package for your distribution if you're willing to pay me to do it. :-) If MaraDNS doesn't compile on whatever modern *nix you're trying to run MaraDNS on, if you give me a remote account for the *nix in question, I will make the necessary changes so that MaraDNS will compile.

- Sam

Monday, February 12, 2007

New MaraDNS snapshots; Marahash 1.1 released

I have released two new MaraDNS snapshots today; a new snap for both the stable and development branches of MaraDNS. The development snapshot of MaraDNS has the most significant improvments: I have updated the CSV2 parser to allow TXT records with multiple fields to be in the more BIND-compatible 'field 1' 'field 2' format in addition to the 'field 1';'field 2' format MaraDNS 1.2 zone files use. This only works if the ~ is used to separate records, and will make finishing up the bind zone file to csv2 zone file conversion script easier.

In the stable snapshot, I have added the patch file that fixes the bug where a host name can not be a '.' by itself (the root DNS node). I will include this patch with the next stable release of MaraDNS, but will not apply this patch until I am sure this bugfix doesn't introduce any new bugs. I do not want to repeat the mistake I made with the 1.0.33/1.1.50 releases of MaraDNS, where a bug fix resulted in other bugs being created.

The workaround in MaraDNS 1.2 is to use a '%' in a zone file for the root node (csv2["."]) to get a DNS root node.

In both snapshots, the manpage reference PDF file has been updated. I finally got ghostscript 8.54 working on my system. Compiling and installing from the ghostscript 8.54 source was not enough; I also had to copy all of the fonts ghostscript wants from /usr/share/fonts/default/Type1/ and /usr/share/fonts/default/ghostscript/ in to the directory /usr/local/share/ghostscript/8.54/lib.

For a few years now, there has been a program hidden in tools/misc called Marahash. This is a program that uses the MaraDNS random number generator (an AES variant, as it turns out) as a compression function to make a 128-bit cryptographic hash. I recently discovered that the 1.2 security updates to MaraDNS' random number generator made the hash too slow to be usable. Since this hash is something useful to have, I have taken the Marahash code, replaced the MaraRNG with the older pre-1.2 MaraRNG core (the security improvments are not needed when using this core as a hash compression function), and made some usability improvments.

This resulted in Marahash. I then made some usability improvments to Marahash. Instead of being able to hash just a single file, Marahash now takes a list of files and directories as command line arguments. If a given command line argument is a directory, Marahash will recursively find all files in the directory and all sub-directories, and output their hashes. The output format for Marahash is now the hash followed by the filename. One can make a hash of all files in the current directory and all subdirectories with this command:

marahash . > MARASUMS

This is useful for making a file that can be used to verify file integrity on burned CDs and DVDs.

Marahash is not the fastest hash: it is about six times slower than SHA-1 and 10 times slower than MD5. It also has a digest size of only 128 bits. Despite these limitations, it is still a useful hash to have around.

I have both Linux/Unix source code and Windows binaries for Marahash available here:

marahash-1.1.tar.bz2 Sig (Linux/Unix source) Sig(Windows 32bit binary)

Monday, February 5, 2007

MaraDNS snapshots released

I am slowly but surely getting closer and closer to having BIND zone file support. In the current 1.3 snapshot, I have made it possible to have freeform line breaks in WKS and LOC records if the ~ is used to separate records.

I have also update the documentation, and have a couple of minor bug fixes.

  • There was a minor problem with LOC processing that affects both the 1.2 and 1.3 releases of MaraDNS. The 1.3 snap fixes this release, and I have also made a 1.2 snap that backports the fix to 1.2. I plan on releasing a new 1.2 release in two weeks (this is a very minor bug)
  • MaraDNS 1.3.02 did not compile with GCC 2.96. Fixed.
Anyway, the 1.3 snapshot can be downloaded here:

Next: I'm a little behind on support email.

- Sam