Monthly Archives: December 2006

Peeking into the linux loader

This post is as much as a tip as a demonstration on how beautifully simple it is to “look-neath-the-hood” when working with linux. This is the reason why linux programmers are happy programmers. Anyways, on with the details.
If you have ever seen errors like …

error while loading shared libraries: foo.so: cannot load shared object file: No such file or directory

when you know that foo.so exists, or have see something like ….

java.lang.UnsatisfiedLinkError: no foobar in shared library path
or
java.lang.UnsatisfiedLinkError: /some/module/soandso.so: libstdc++.so.6: cannot handle TLS data

you may use the LD_DEBUG feature to zoom-in on the problem.

The linux loader (/lib/ld-<version>.so) looks at the environment variable “LD_DEBUG” to print out interesting debug information as it loads libraries and resolves symbols. What exactly is printed out depends on the value that the variable is set to. You may get the list of valid values by setting LD_DEBUG=help. For example:


$ LD_DEBUG=help ls
Valid options for the LD_DEBUG environment variable are:

libs display library search paths
reloc display relocation processing
files display progress for input file
symbols display symbol table processing
bindings display information about symbol binding
versions display version dependencies
all all previous options combined
statistics display relocation statistics
unused determined unused DSOs
help display this help message and exit

To direct the debugging output into a file instead of standard output
a filename can be specified using the LD_DEBUG_OUTPUT environment variable.

What you make of this info. and how much it helps depends on the specific problems you are facing but all in all this is a useful thing to know when you are facing ^library issues^. More detailed information about working/writing libraries on linux is available at the Program Library HOWTO

keyword search in firefox

Firefox is a great browser (you already knew that, right ?). Firefox’s nice keywords facility can be used for a neat search trick. IMHO, It is best used for a directed search engine that digs specific data (For example, a bugzilla search, imdb search, lxr search ..etc). To make use of this …

  1. Go to a site which offers a simple search facility (eg: imdb, lxr, your local bugzilla)
  2. Place the cursor within the search box
  3. Right click and select “Add a Keyword for this Search…”
  4. Give your new search shortcut a name
  5. Give your new search shortcut a short keyword (for example, I use bz for my bugzilla search, lxr for lxr)

You are done !!

To try out your new keyword search shortcut, open a new tab (Ctrl+T), place the cursor at the location bar (Ctrl+L), type out your keyword followed by the search term(s) (For example, assuming you added keyword “bz” for the search at bugzilla.mozilla.org, then, typing “bz 95849” in the location bar will show you this).

So here I go …

…just created yet another blog that I may soon abandon !

Well, the motivation for creating this one tho’ is pretty strong though. I frequently stumble upon cool tech stuff or discover new hacks or learn new tricks to increase my productivity and each time I do, I feel like telling everybody about it …so there – that’s what this blog’s for.

Furthermore, I also know this, while some people may be interested in some of the stuff I write here, nobody is interested in reading about my life (marvin has a better life than mine) or about my travels (zaphod’s are more exciting) or my deep, interesting views on life, the universe and everything. If that last statement left you feeling confused and lost you might as well move along …there’s nothing to see here.