[Ilugc] LJ Tech Tip

  • From: sbharathi@xxxxxxxxxxxxx (Bharathi Subramanian)
  • Date: Wed Sep 19 15:15:40 2007

(1) TECH TIP: Debugging a core dump

If a program crashes with a core dump then, it is easy to debug and find
the last internal state of the program.  When we run multiple programs or
threads, then it is difficult to find which core was generated by which
process. To resolve this, there are a few settings  available in  /proc,
which will help us to add more detail in the core file name.

Support available from Kernel v2.4. Setting '1' to this file, will
generate a core file with PID. For example: core.1234
/proc/sys/kernel/core_uses_pid

Support available from Kernel v2.5.  This file provides more control
to form the core file name. /proc/sys/kernel/core_patten

This is very similar to setting the core_uses_pid option.
echo "core.%p" > /proc/sys/kernel/core_pattern

By setting this value, core file will be generated with the following
details: executable filename, PID of the dumped process and number of
the signal causing the dump. 
echo "core.%e.%p.%s" > /proc/sys/kernel/core_pattern

More useful options are explained in the proc man page.

(2) TECH TIP: Keyword Search in Firefox

Firefox is a great browser, but you already knew that, right?
Firefox's keywords facility can be used for a neat search trick. It is
best used for a directed search engine that digs specific data-for
example, a Bugzilla search, IMDb search, LXR search or Marcel/wine
search http://www.wine-searcher.com, and so on. Here are the steps:

   1. Using Firefox, go to a site that offers a simple search 
      facility (for example, IMDb, LXR or 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 and lxr for LXR).

That's it.  To try out your new keyword search shortcut, open a new
tab (Ctrl-T), place the cursor at the location bar (Ctrl-L), type your
keyword followed by the search term(s)-for example, assuming you added
keyword bz for the search at http://bugzilla.mozilla.org, then typing
"bz 95849" in the location bar will show you this:  
https://bugzilla.mozilla.org/show_bug.cgi?id=95849.

This is an ideal way to use a search engine that digs through some
specific data.

HTH :)
--
Bharathi S

Other related posts: