A brief overview of the Solaris 10 nvpair library

Solaris 10 code often uses a data structure called nvpairs (or nvlists),including all throughout the ZFS code, even in the kernel. There doesn'tseem to be a good overview of the libnvpair library, and since I've justspent the past couple of weeks up to my elbows in the OpenSolaris ZFScodebase it seems like a good time to write down what I've learned aboutnvlists and nvpairs before I forget it.

The basic overview is that an nvlist is a list, possibly nested


Some trivia about Python frame objects

Since I've been poking around in this area of CPython lately, here's some triviaassociated with frame objects.

First, one might wonder if code executing at the module level literallyhas a CPython frame struct with f_locals being the same as f_globals , or if the C code just leaves f_locals null and fixesthings up behind the scenes when you look from Python code. Theanswer turns out to be that CPython frame structures always havea real f_locals (Python) dictionary


Exploring the frame object f_builtins member

As I noted in passing , Python frame objects alsohave a vaguely mysterious f_builtins member. On one level, frameobjects have this member because they are more or less representationsof the CPython (code) frame structure, and the C-level code framestructure has an f_builtins field. So, what is this field?

(Quite a lot of the Python internal objects work this way; they have themembers that they do mostly because they're Python representations of Cstructures).

We can


Why kernel packaging is so bad in Debian and Ubuntu

I've written before about Ubuntu'ssubstandard kernel update management; what I didn't say then (partlybecause I didn't fully understand it) is that this is just amanifestation of a general problem with kernel packaging in Ubuntu (andDebian, which it inherits from).

The fundamental problem for packaging kernels on Debian and Ubuntu isthat there are two unfortunate design choices in dpkg , the Debianpackage system: you can only every have one version of a packageinstalled at once, and there


Why I am not a fan of hardware acceleration

I am generally not a fan of hardware accelerators of various sorts (thestereotypical example is hardware RAID cards). One of the reasonswhy is that historically (with one important exception), hardwareaccelerators generally just haven't been very good.

By not very good I mean that, well (generally):

  • they haven't accelerated things very much.
  • they haven't sped up actual important bottlenecks , except in rare circumstances.
  • they almost invariably cost a significant amount of money.
  • even when they manage to

Are you sure it's a C string?

Here's a recent Ubuntu security alert about KDE:

It was discovered that KDE did not properly handle certificateswith NULL characters in the Subject Alternative Name field of X.509certificates. An attacker could exploit this to perform a man inthe middle attack to view sensitive information or alter encryptedcommunications.

Let me translate this for you:

KDE put a text field in a C string without making sure that itactually was a C string. It turns out that it wasn't.

This is not just


A trick to testing https setups on test machines

Suppose that you are building a new version of an existing machine thatruns a https web server (perhaps you are rebuilding it under a differentbase OS version). Of course you want to test it before you switch itinto production, which means that it needs a new temporary name of somesort. And a different name means problems with the SSL certificates foryour https web server instances.

(There are people who will tell you, in all seriousness, that you shouldhave a completely independent, isolated test network


Some kernel lockd NFS error messages explained

As before , suppose that your machine is anNFS client. Periodically, it logs kernel messages that look like this:

do_vfs_lock: VFS is out of sync with lock manager!

The kernel has a generic system to handle local file lockingfor POSIX and flock() locks, implemented in the VFS . Roughlyspeaking, the NFS client code handles locking by first asking the NFSserver for a (remote) lock, then registering the lock locally by callingthe kernel VFS locking routines. If the attempt


Listing file locks on Solaris 10

Suppose that you want to find out what files are locked on your Solaris10 machine, perhaps because it is an NFS server and you really want aglobal view of what locks you have . On aLinux machine (or a sufficiently old Solaris one) you could use lslk ,but it's never been ported to Solaris 10; instead you need to use ' mdb-k ', the kernel debugger.

The 'simple' command to get a list of files with file locks is:

echo '


Forwarding emails without false positives

Here is a modest suggestion for email clients: when you forward amessage, you should put some marker of this at the front of the Subject: header. Similarly, if you are configuring your email clientand you have a choice, you should set it up this way.

(Some but not all clients do this today.)

Many anti-spam systems that I've seen put a spam status marker at thestart of the Subject: line; it's a relatively obvious place, andputting it