Moazam Rajas Sun hosted weblog garbage collection II

Thursday Jun 10, 2004

Richard Lee over at VA Software brought this up to me today. He said that the Solaris 'which' command does not return the correct error code upon failure. Because of this he has to end up parsing stdout when he should be able to simply rely on the exit code.
Example:

# uname -a
SunOS sol10 5.10 s10_55 sun4u sparc SUNW,Sun-Blade-1500

# which ls
/usr/bin/ls
# echo $?
0

# which oogabooga
no oogabooga in /usr/sbin /usr/bin
# echo $?
0


As Richard would say, "Dirty".
There are three things I do after installing Fedora Core 1 on any system.

1.) Get apt-get.

# rpm -Uvh http://atrpms.net/dist/fc1/atrpms-kickstart/atrpms-kickstart-22-1.rhfc1.at.i386.rpm

2.) Update the whole system via apt-get.

# apt-get update && apt-get dist-upgrade

3.) Install TrueType fonts from the instructions provided here.


*Steps 1 and 2 are gleaned from Jarod Wilsons MythTV Installation Guide
I glossed over the differences between the default Solaris 8 threads MxN behavior and the Solaris 9 1:1 behavior in my Debugging thread related hangs in the JVM writeup. Solaris 10 brings new changes in that threading has moved away from libthread and directly into libc. Phil Harman wrote a very good peice called Multithreading in the Solaris Operating Environment[PDF] which explains in great detail the switch from MxN to 1:1 threading. Phil also posted a very frank comment about the libthread changes in Solaris 10. This is great stuff not only for technical purposes, but also for Unix history buffs.

"Having been an advocate of MxN for many years (largely, because that was one of our differentiators), I was treading a very fine line. I think the paper makes it clear that I don't think 1:1 is superior as a _model_, but that our MxN _implementation_ was past its sell-by date. The switch was entirely pragmatic. I personally had to drag quite a few folk kicking and screaming to the right decision. We have never looked back.

Since then we've added other cool stuff like: compiler support for TLS, posix_spawn() and POSIX spin locks. But our crowning achievement is to get rid of libthread altogether by folding it into libc. None of this would have been possible in the same short time if we had persevered along the MxN route.

You can play with all* of this cool new stuff today via the Solaris Express program (which provides early access to Solaris 10 as we develop it). See www.sun.com for more details. Sorry, I didn't mean this to turn into a marketing opportunity :)

* currently, only the Forte SPARC compiler supports TLS, but we hope to fix that soon! Actually, with the right patches, TLS is available right back to /usr/lib/lwp in Solaris 8."
[Phil Harman]
Rob Reyer from www.evilrob.org commented on my weblog entry about thread dump formatting and analysis. Rob mentions that he spent 6 days trying to get a thread dump right as an application was core dumping. He is not the first person I've heard this from...hell, I have the same problem.

From my outside weblog:

I can't believe that I didn't know about this before! ODB allows you to do 'Omniscient Debugging' on Java applications, with or without the original source code.

The ODB debugger allows "..developers to step backwards through the execution of a program to determine where and how programming errors occurred. By recording each state change in the target application, it allows the developer to navigate "backwards in time" to see what the values of variables and objects WERE, enormously simplifying the task of debugging programs."

One page description of the ODB
Article , Debugging Backwards in Time
AADEBUG paper on Omniscient Debugging (pdf)
ODB User Manual