Chris Quenelle is a tools developer at Oracle Corp. He's worked on performance and debugging tools at Sun and Oracle for over 15 years. He reads comic books and science fiction, and has more tivos than he can keep track of.

 

September 2010
S M T W T F S
« Jun    
 1234
567891011
12131415161718
19202122232425
2627282930  

On Iteration by Andrei Alexandrescu

I just finished reading a great article on iterators by Andrei Alexandrescu.  Mr. Alexandrescu is a contributor to the D programming language.  In this paper, he discusses the background of iterator implementations including C++ STL iterators, and then goes on to outline a new model for iterators.  It’s very readable, I recommend it.

http://www.informit.com/articles/article.aspx?p=1407357

To get a more readable all-in-one page, click on the “print” link on the page above, or go here:

http://www.informit.com/articles/printerfriendly.aspx?p=1407357

http://quenelle.org/unix/wp-content/plugins/sociofluid/images/digg_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/reddit_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/dzone_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/delicious_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/furl_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/technorati_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/facebook_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/twitter_24.png

Charles Stross on EBooks

I just read a nice essay by science fiction author Charles Stross about EBooks.  As usual, he presents a very lucid and entertaining look into the world of publishing.

CMAP #9: Ebooks

http://quenelle.org/unix/wp-content/plugins/sociofluid/images/digg_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/reddit_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/dzone_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/delicious_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/furl_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/technorati_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/facebook_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/twitter_24.png

Virtualization terms

Okay, before I forget, I’m writing it all down.

We have to test against all this stuff, and it’s becoming more and more convenient to use virtualization as a way to share lab resources, so I figured I’d go make sense of all the terminology that’s flying around.  I understood 80% of it, but I could never understand all of it at once.  A lot of this was extracted from Wikipedia.

Here are the things that affect my life: Xen, VirtualBox, VMWare, LDOMs, Zones, Containers.

Hypervisor : Software that emulates a hardware platform, so that Operating Systems can run on top of it, as if they had hardware to run on.

OS Virtualization: When you have one OS (one kernel) running multiple user-spaces. Applications think they are on separate machines.

There are two kinds of Hypervisors, some run directly on hardware (Type 1), and some run as applications (Type 2).

With those terms defined, here is a description of the technologies, features, products that I listed at the top:

  • Hypervisors:
    • Running on hardware – Type 1 Hypervisor
      • Xen: Hypervisor that runs on hardware, supports x86 (aka Sun xVM)
      • LDOMs: Hypervisor that runs on hardware, supports SPARC
    • Running as an application – Type 2 Hypervisor
      • VirtualBox: Hypervisor that runs as an application, supports x86
      • VMWare: Hypervisor that runs as an application, supports x86
  • OS Virtualization
    • Solaris Containers/Zones

The terms “zone” and “container” seem to interchangeable. I have not found a source that is both clear and authoritative that can tell me the difference.

Zones are capable of running different versions of Solaris inside one Global OS instance.

There are lots of things I glossed over here, but my goal was keep it short and sweet.

Trivia:

  • You can run a specific old version of Linux inside a Solaris zone.
  • The VMWare company probably supports products on other chips than x86
  • There are lots of differences between the features of Xen and LDOMs that I didn’t discuss
http://quenelle.org/unix/wp-content/plugins/sociofluid/images/digg_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/reddit_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/dzone_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/delicious_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/furl_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/technorati_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/facebook_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/twitter_24.png

Which version of Sun Studio do I have installed?

Recipes for supported packaging formats

Sun Studio is available on three different packaging systems. Here are some examples that show you how to get information about the Sun Studio packages on each kind of system.

  • IPS packaging system – on OpenSolaris
  • SYSV packages – on Solaris 10
  • RPMs – on SuSE and RedHat Linux

If you want to know what version of a Studio component you’re using, the steps are shown below.  The compiler or tool you’re interested in might be on your search path (you can find the location with “which cc”) or you might already know the full path.  Once you have the full path, here are the things you might want to find out:

  1. Find out the name of the package containing that binary.
  2. Dump out information about that package.
  3. Optionally look for other packages from the same Studio release, to see what else is installed.

Generally the multiple packages that make up Sun Studio will use a similar naming convention.  In the currently available releases, these package names are cryptic.

Sun Studio 12 update 1 installed on Solaris 10

What version is built into the binary?

% /opt/sunstudio12.1/bin/cc -V
cc: Sun C 5.10 SunOS_sparc 2009/06/03
usage: cc [ options] files.  Use 'cc -flags' for details

Which package is that binary in?

% pkgchk -l -p '/opt/sunstudio12.1/bin/cc'
NOTE: Couldn't lock the package database.
Pathname: /opt/sunstudio12.1/bin/cc
Type: symbolic link
Source of link: ../prod/bin/cc
Referenced by the following packages:
SPROcc
Current status: installed

What other packages are installed?

% pkginfo | grep SPRO
application SPROatd                          Sun Studio 12 update 1 Advanced Tools Development Module
application SPROcc                           Sun Studio 12 update 1 C Compiler
application SPROcmpl                         Sun Studio 12 update 1 C++ Complex Library
application SPROcpl                          Sun Studio 12 update 1 C++ Compiler
application SPROcplx                         Sun Studio 12 update 1 C++ 64-bit Libraries
...

Sun Studio 12 update 1 installed on OpenSolaris

What version is built into the binary?

% /opt/sunstudio12.1/bin/cc -V
cc: Sun C 5.10 SunOS_i386 2009/06/03
usage: cc [ options] files.  Use 'cc -flags' for details% /opt/sunstudio12.1/bin/cc -V

Which package is that binary in?

% pkg search -lp /opt/sunstudio12.1/bin/cc
PACKAGE                                   PUBLISHER
pkg:/developer/sunstudio12u1@12.1.1-0.111

What other packages are installed?

% pkg list | grep -i studio
developer/sunstudio12u1                       12.1.1-0.111    installed  -----

Sun Studio 12 update 1 installed on SuSE 11 Linux

What version is built into the binary?

% /opt/sun/sunstudio12.1/bin/cc -V
cc: Sun C 5.10 Linux_i386 2009/06/03
usage: cc [ options] files.  Use 'cc -flags' for details

Which package is that binary in?

% rpm -qf /opt/sun/sunstudio12.1/bin/cc
sun-cc-12.1-1

What other packages are installed?

% rpm -qa | grep sun- | head
sun-lang-12.1-1
sun-idext-12.1-1
sun-mr3m-12.1-1
sun-prfan-12.1-1
sun-stl4h-12.1-1
sun-cplx-12.1-1
sun-dbxx-12.1-1
sun-pls-12.1-1
sun-dwrfs-12.1-1
sun-rtmx-12.1-1
...

Notes

The excessively terse naming convention is because of the ancient restrictions in AT&T System V UNIX that limited package names to 9 characters.   Sun also made an early decision to prefix packages names with 4 letters to mark the part of the company that was releasing the packages.  In all fairness, Sun was trying to invent a scheme where outside software vendors could reasonably choose package names without accidentally conflicting with any of the Sun packages.  That’s difficult to do in only 9 characters.  On OpenSolaris, you can see that we merged everything into one package.  Because the friendly new packaging system is one of the highlights of OpenSolaris, we didn’t want to confuse new users with the multitude of small packages we have for Sun Studio.

Hopefully, this information will be useful in a variety of circumstances. Inside the Studio team, we need to go back and forth between all three packaging systems, and it’s not easy to remember the right system commands to work with the packages on a given system. In the support team, one of the first things they ask a customer is which version of the Sun Studio software they are running. It’s also possible to install subsets of Sun Studio, so you may want to know which tools are currently installed.

Note: Studio will actually run fine on lots of different versions of Linux, including distributions that don’t use RPM as their native package format (like Ubuntu).  The tarball downloads are useful for those Linux distributions.

http://quenelle.org/unix/wp-content/plugins/sociofluid/images/digg_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/reddit_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/dzone_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/delicious_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/furl_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/technorati_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/facebook_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/twitter_24.png

OpenSolaris VNC update

I use VNC connections as part of my regular daily routine, and I ran into another bug a few days ago, so I figured I’d post a summary of the current bugs that are currently afflicting me, and the workarounds for them.

First is a really interesting bug where the less-than-sign turns into a greater-than-sign.  Really.  I’m not joking. The comma and period work fine, it’s just the less-than-sign.  The public bugid for this is 14729. The workaround is to run xmodmap when you start your VNC session (I put it in ~/.vnc/xstartup).

xmodmap -e 'keycode 94 = comma less'

The second bug is that the server crashes whenever you turn OFF the capslock key.  The public bug for this one is 14397. The workaround I found for that is the following:

vncserver ... -RemapKeys 0xffe5->0x00

In other words, you try to disable the capslock key, and the result is a capslock key that works correctly.  I have no idea what the implementation is doing.

I’m using a Mac client these days as a desktop, so I’d be interested in hearing from anyone using windows VNC clients to see if they’ve hit these same bugs or not.  Of course, I do live on the bleeding edge of OpenSolaris.  The last few biweekly dev releases have been internal-only, but I think both of these bugs are in public OpenSolaris releases.

http://quenelle.org/unix/wp-content/plugins/sociofluid/images/digg_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/reddit_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/dzone_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/delicious_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/furl_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/technorati_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/facebook_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/twitter_24.png

Code Bubbles

This is the IDE for me.  They start talking about debugger functionality about 75% of the way through.  IDEs are all about navigating huge amounts of information. Code Bubbles (http://www.cs.brown.edu/people/acb/codebubbles_site.htm)

http://quenelle.org/unix/wp-content/plugins/sociofluid/images/digg_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/reddit_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/dzone_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/delicious_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/furl_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/technorati_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/facebook_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/twitter_24.png

Types, Objects and Generic Types

Assume the axiom that punctuation is evil.  Using multiple kinds of brackets for similar functionality in a language is unnecessarily complex.

The result is:

The relationship between a generic type and it’s concrete types should be expressed in the same way as for the relationship between a type and the objects that are instances of it.

In C++, constructors use: foo(object1, object2), but templates use Foo<Baz,Bar>

Can we unify the syntax for these similar concepts without making the language complex?

It’s completely clear to me why using different punctuation makes it easier to explain how the compiler is implemented, and easier to implement the compiler.  But I don’t think the distinction is necessary to make the source code easier to read and write.

Let’s say we only have “objects”. “Type” would be a role that on object plays with respect to another object. The compiler simply instantiates some objects at compile time, as part of the compilation process.  That seems like a clear concept for coders to understand.

The goal of a programming language is to facilitate the writing and maintaining of software.  It’s not to make the compiler’s job easier.

http://quenelle.org/unix/wp-content/plugins/sociofluid/images/digg_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/reddit_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/dzone_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/delicious_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/furl_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/technorati_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/facebook_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/twitter_24.png

Sun Studio uninstall problems

If you installed the initial release of Sun Studio 12 update 1 (around June of 2009) you might have some problems running the uninstall script that came with it.  Our installer guru came up with a “workaround” script which is now available for download on the Sun Download Center.  You can find a description of the problems and a link to the script on the Sun Studio web site’s Troubleshooting Page.  You may also find it useful to check the Sun Studio 12 update 1 installation guide.  Some of the failure modes may show you errors like this:

The local registry (/root/.nbi/registry.xml) could not be loaded, or was loaded partially.
The installer can continue to work normally, but doing so may result in a corrupted global registry.

As Sun moves towards using the IPS packaging system, we’ll be able to rely more on the packaging tools built in to Solaris, and we won’t have as many issues like these.  I’m looking forward to it.

http://quenelle.org/unix/wp-content/plugins/sociofluid/images/digg_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/reddit_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/dzone_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/delicious_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/furl_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/technorati_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/facebook_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/twitter_24.png

OpenSolaris build 129 has problems with filemerge fonts

I’ve been staying more up-to-date with Solaris dev builds since they started publishing builds nigh-biweekly. That means I get to experience all the joyful brokenness of a system in development.  Build 128 introduced a problem with VNC which can be worked around by disabling the “tight” encoding (bugid 6906660). And Build 129 introduced a problem with filemerge fonts (bugid 6909040).  Both have pretty easy workarounds described in the bug descriptions.  The release notes for opensolaris are not widely redistributed, so if you’re using the dev repository from outside Sun, make sure you’re on the osol-announce@opensolaris.org mail alias.

http://quenelle.org/unix/wp-content/plugins/sociofluid/images/digg_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/reddit_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/dzone_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/delicious_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/furl_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/technorati_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/facebook_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/twitter_24.png

Downgrade OpenSolaris

This is a fairly frequently asked question inside Sun, and now that the biweekly builds are available outside Sun, there are probably more people who are interested.  If you want to create a Boot Environment with a specific build (not the latest one) in OpenSolaris, here are the steps to use:

beadm create snv122
beadm mount snv122 /mnt
pkg -R /mnt install pkg:/entire@0.5.11-0.122
bootadm update-archive -R /mnt
beadm umount snv122
beadm activate snv122

Caveat Emptor and all that stuff.  This recipe comes with no warranty, but I’d be glad to make it more accurate or up-to-date if you let me know of improvements.

http://quenelle.org/unix/wp-content/plugins/sociofluid/images/digg_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/reddit_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/dzone_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/delicious_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/furl_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/technorati_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/facebook_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/twitter_24.png