encodings and character sets

Janine Sisk at Furfly has been working hard to migrate her customers to the latest AOLserver 4.0.x release, which has been helping the project find bugs and answer migration questions. This has been incredibly helpful and the most recent issue involved encoding and character set settings.

Her problem, in a nutshell, is that users are entering data into the system originally authored in Microsoft Word which uses the Microsoft Windows Codepage 1252 character set which contains codepoints for things like en-dashes (0x96 = U+2013), ellipses (0x85 = U+2026), and some other elements. However, if you treat CP1252-encoded data as UTF-8 (RFC 2279), it won’t render correctly: all bytes in the range of 0x80-0xFF, which contains en-dashes and ellipses, are encoded using two bytes instead of just one. In this particular case, the en-dashes become transcoded from 0x96 to the sequence 0xC2 0x96. The 0xC2 looks like this — Â or 쎂 — depending on which one your browser rendered correctly. You may recognize it and wonder how it got in your own pages and how to remove it, too.

For Janine, her solution was to instruct AOLserver to use the ISO-8859-1 character set as the output character set, which would mean the inputs by the users originally in CP1252 would get output from the server as ISO-8859-1 which is a close enough match, I guess. The configuration might look like this:

ns_section "ns/parameters"
ns_param OutputCharset iso-8859-1

I’m not sure what she has the other related encoding and character set settings set to, but I’ve asked and hopefully will find out and update this entry with the details.

who’s your daddy?

I’m a big fan of Steve Buscemi, but this morning I saw something very disturbing on Google News … a picture of Macaulay Culkin.

Now, in and of itself, that’s not very scary. What’s scary is the double-take I did when I first saw the picture. I thought to myself, “Boy, that must be a really young picture of Steve Buscemi …” until I realized it wasn’t him! See for yourself:

Macaulay CulkinSteve Buscemi

For appropriate photo credit, here’s the original article where Macaulay gets smacked down for dope posession and the picture of Steve.

Just makes you wonder … is Macaulay actually Steve’s love-child? Hmm …

Update: Alex at Martini Republic beat me to it by two days … damn! Great minds think alike, or fools rarely differ.

hanging on by a thread

I’ve been doing a lot of core dump analysis at work on Solaris, digging deep into the bag of coder kung-fu using adb, which is a debugger that is not for the faint of heart.

So, trying to help someone troubleshoot a problem with AOLserver on Linux, I asked the simple question of “did it drop a core file”? The answer was, “No, it didn’t.” That prompts the next question, “Did you set ulimit -c unlimited?” The affirmative answer surprised me: how is it not dropping a core file? Ahh, that’s when it occurred to me: Linux has had issues with threads (same info, more polished) for a long time now. So, I decided to do some hacking on my own Debian Linux box running my own hand-compiled 2.6.7 kernel.

Apparently, there are some kernel patches to implement multithreaded core dumps which suggests that the patches were merged into the 2.5.47 kernel. So, why isn’t AOLserver writing a core file when it segfaults?

After making dinner and putting the kids to bed, I thought about it and wrote a little test program that starts a thread then aborts in the thread. It wrote out a core file just fine! Then it dawned on me: AOLserver does a setuid to drop root privileges — Linux, by default, won’t write a core file out if the process has changed uid/euid. Figuring I wasn’t the first person to want Linux to behave like every other Unix out there, I found my answer in the unofficial comp.os.linux.development.* FAQ: How can I make a suid executable dump core? Making the change in nsd/nsmain.c, adding the prctl(PR_SET_DUMPABLE) call, I can now get AOLserver to dump a core file on Linux. Yay.

I’ve just filed SF Bug #1031599, attached the diff’s and committed the change.

While this doesn’t solve the original problem of why this person’s AOLserver is crashing, at least now I might be able to get a core file to look at …

breaking these chains of love

OK, I don’t know how I possibly missed this, but last month Computer Associates has released its Ingres r3 database product as open source software!

Now, I’ve been using MySQL for many years, and have been recently considering using PostgreSQL in order to get features that MySQL is still lacking (views, stored procedures, etc.) — but now, I can use Ingres instead!

You can download Ingres r3 today! (Requires free site registration.) The current source tarball is ~76MB. I’ll be downloading it tonight … expect to see an AOLserver nsingres module soon.

I don’t know if you can tell … but damn, I’m excited …

sex, lies and masking tape

Kelly Burgener wrote an article for Speak Up, a discussion blog for graphic designers, titled Pornography Perils. I couldn’t resist the urge to leave a comment, which I’m going to repeat here as well:

“an industry of extreme manipulation, coercion, profiteering, and addiction”

Sounds like the Advertising and Mass-media industries, which designers hone their skills to participate in.

Frankly, the business of sex (which includes pornography) has always driven the economy. To try and undermine it is like cutting off your nose to spite your face.

“Like most designers, I believe that graphic design can be a powerful tool against ignorance, exploitation, and manipulation.”

You want to help change the world? Spend your effors to counter the products and by-products of the mass media. The hate, ignorance, manipulation and fear it promotes.

Only then, will our largely ignorant, fearsome and manipulated population not feel the need to turn to the sex business for comfort, solace, entertainment and escape.

is sparc dead?

David S. Miller, a world-reknowned Linux kernel hacker, key contributor to the sparclinux/sparc64 port, and all-around nice guy, wrote to debian-sparc a great message that starts:

You can laugh and call it Wintendo all you want, but even the I/O performance of modern x86 (and Opteron) systems blows Sparc away.

Later on, he writes:

[…] If I’m setting up a high end web server,
I don’t think I’d be using Sparc thanks :)

If I wanted a fast machine with good cpu performance and a fast disk
and networking, I’d get a 3+ Ghz Xeon or an Opteron with PCI-X or
perferably PCI Express. […]

Read the whole message to get a good explanation of why he feels this way and the numbers behind his assertions.

comments are back again

Okay, I’ve gone and implemented some ghetto user registration functionality and hooked it up to the blog’s comment submission code, so you can leave comments on the blog again!

If you run into any kinks or errors, well, please let me know by sending me email. Thanks!

nsopenssl 3.0 beta stuck in a busy loop

Back on August 7th, Nathaniel Haggard reports a problem with nsopenssl where it repeatedly sends a bunch of stuff into the server log. Janine Sisk confirms that she is also seeing the same thing. However, neither were really able to put a finger on why it was happening or how to reproduce it, so I couldn’t really do much about it at the time. On August 12th, I identified one issue with the sample config. that ships with nsopenssl having to do with “SSLv2” being omitted from the “protocols” list but being (incorrectly) included in the “ciphersuite” list which would result in the server crashing when SSL clients attempt a SSLv2 connection. But, this wasn’t the root cause of the problem.

Then, almost a week later on August 18th, Bruno Mattarollo brought up the issue again, but this time was different. Bruno indicated that he was able to reproduce the problem fairly reliably! He said,

What I did, that
triggered the error was click on a link and immediately click on
another link without giving the server time to actually return the
page, so I guess what’s happening is that there is no socket for
nsopenssl to send the results to … right?

Bruno and I spent the next few days trying to diagnose the problem — he even blogged about it. Along the way, I found some other unrelated issues which I logged at SourceForge in Bug #1012892 along with patches against AOLserver 4.0.8a and 4.1.0a that address them. However, continuing to try and get at the root cause of our nsopenssl issue, I realized that fixing the problem would not be a trivial change. The nsopenssl code needed some serious clean-up — I was having a hard time getting a grasp of what it was doing (or, more importantly, what it wasn’t doing).

So, today, I sat down and began to clean up the nsopenssl code. After several cigarettes and some head-scratching, I got the code to a state where I could really start tracing it in the debugger and see what was happening. And, what I found was that when the remote client abruptly terminates the SSL connection, the server notices (because SSL_write() fails) but because the browser requested an HTTP Keep-Alive connection, the server returns the connection to the pool to read the next HTTP request. When it goes to read, it fails on SSL_read() (because there’s no peer connected) and so begins the error loop. I managed to clean up the code and ensure that when an error occurs, we mark the SSL connection as “shut down” so the driver knows not to use it for Keep-Alive and thus will properly close the connection. I announced the fix at 4:13 PM today, and around 9:01 PM, Bruno logged in, applied the patch to nsopenssl, tested and verified that he can no longer reproduce the problem!

I’m going to wait a few days for others to apply and test the patch, then I’ll commit the patches in Bug #1012892 to CVS. Noah Robin asked if a similar fix could be backported to nsopenssl 2.x which I said could be possible if folks verify the fix to nsopenssl 3.0 to be complete, that I would look into backporting the fix.

Overall, I’m hoping this makes nsopenssl 3.0 beta stable enough for us to consider the upcoming nsopenssl 3.0 beta 22 a release candidate. We’ll see …

don’t throw out your manager just yet

As a long-time fan and practitioner of Extreme Programming (a lightweight or “Agile” software development methodology), I ran across an excellent article in Software Development magazine entitled You’re Still Needed (free registration req’d) by Esther Derby and Diana Larsen.

Esther and Diane do a great job of describing specific ways a traditional “manager” in a software development team can (must?) change their role and activities to best mesh with an Agile team. For anyone who’s a manager in the field now who’s feeling threatened by the whole Agile movement, I strongly suggest you read this article.

need more wool for those eyes?

Living in New Jersey, I try and keep abreast of timely issues. What’s hot right now? Governor James McGreevy came out of the closet as a homosexual and announced his resignation.

What I find funny (or, perhaps sad) is the reaction and response to this from the general public. The LGBT groups have jumped on the bandwagon worshipping him as another “out” public figure. The media has been busy working up the scandal of his alleged affair with Golan Cipel. But, that’s all just a load of wool and the public’s eyes have been covered, it seems.

Steve Yuhas wrote an article that comes close to the real issue, but misses the point, too.

So, what is the point? What question should we be occupied with? In Socratic style, I’ll start with a question:

What will become of the position of Governor in NJ?

McGreevy hasn’t resigned. He has only announced his resignation. Quoting the CNN article linked above:

His resignation will take effect November 15, and State Senate President Richard Codey, a fellow Democrat, will serve the the remainder of his term, which ends in January 2006.

If McGreevey’s resignation had taken effect before September 15, state law would have required a special gubernatorial election on November 2.

Essentially, the Democrats get to appoint Richard Codey as NJ Governor through January 2006 without the chance of an election. How convenient. So, what of this Codey fellow? Here’s a statement he made following the McGreevy announcement. Here’s a quote from an interesting blurb about him:

[…] Codey is extremely knowlegable about both harness and thoroughbred racing and has backed racing related legislation in the past.

Codey’s brother, Don, is the general manager of Freehold Raceway in New Jersey.

The common element here is both McGreevy and Codey using their positions to protect their personal interests. What about serving the State of New Jersey?

I’m no fan of our former Republican Governors like Christine Whitman, but we need someone who will work to bring more big businesses into New Jersey and create real jobs in big companies instead of just upgrading folks from welfare up to minimum wage jobs. After 9/11, I wouldn’t be surprised if companies are more seriously considering NJ for their offices over instead of Manhattan. Lets make NJ really attractive to them so their decision becomes trivially easy to make.