<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4424078003942316099</id><updated>2012-02-16T22:32:23.469+05:30</updated><category term='Apache Segmentation fault'/><title type='text'>Devendra's Thoughts</title><subtitle type='html'>This Blog will be Closed and transferred to http://www.dee-ess.com.

See you there !</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.techds.in/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default'/><link rel='alternate' type='text/html' href='http://www.techds.in/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>DevendraS</name><uri>http://www.blogger.com/profile/16368182158867977111</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_jL1N-ruOAOI/Spem99hihSI/AAAAAAAAABM/74aLU3uY790/S220/DS.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4424078003942316099.post-1164241825837688866</id><published>2012-01-01T19:01:00.001+05:30</published><updated>2012-01-01T19:03:42.121+05:30</updated><title type='text'>Closing Down !!!</title><content type='html'>Friends,&lt;br /&gt;&lt;br /&gt;I will shut down this Blog-site soon.&lt;br /&gt;&lt;br /&gt;All posts have been transferred to &lt;a href="http://www.dee-ess.com"&gt;http://www.dee-ess.com&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;DS&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4424078003942316099-1164241825837688866?l=www.techds.in' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.techds.in/feeds/1164241825837688866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.techds.in/2012/01/closing-down.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/1164241825837688866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/1164241825837688866'/><link rel='alternate' type='text/html' href='http://www.techds.in/2012/01/closing-down.html' title='Closing Down !!!'/><author><name>DevendraS</name><uri>http://www.blogger.com/profile/16368182158867977111</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_jL1N-ruOAOI/Spem99hihSI/AAAAAAAAABM/74aLU3uY790/S220/DS.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4424078003942316099.post-3607441598345765856</id><published>2009-05-22T10:22:00.004+05:30</published><updated>2009-05-22T10:58:01.846+05:30</updated><title type='text'>E2fsck hanging at 70% on Large Partition</title><content type='html'>&lt;div&gt;&lt;span style=";font-family:Courier New;font-size:100%;"  &gt;&lt;span class="229060311-16032009"&gt;We had a disk of 1 TB sized partition, which started giving problems.&lt;br /&gt;&lt;br /&gt;We ran fsck, but it got stuck at 70% after about 4-5 hours.&lt;br /&gt;&lt;br /&gt;The version on our system was &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;e2fsprogs-1.35-7.1.&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:100%;"  &gt;&lt;span class="229060311-16032009"&gt;&lt;br /&gt;The issue we  faced on Friday, 13-Feb-2009 [&lt;strong&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Friday the 13th  :)&lt;/span&gt;&lt;/strong&gt;]&lt;br /&gt;&lt;br /&gt;On researching further it seemed to be due to a bug in the e2fsprogs.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;&lt;span style=";font-family:Courier New;font-size:100%;"  &gt;&lt;span class="229060311-16032009"&gt;Finally we concluded the bug to be a floating point precision error which could cause e2fsck to loop forever  on really big filesystems with a large inode count.&lt;br /&gt;&lt;br /&gt;On searching through our friend Google, we found a &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://www.redhat.com/archives/ext3-users/2007-March/msg00012.html"&gt;Bug Report&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:100%;"  &gt;&lt;span class="229060311-16032009"&gt;Read more about  it at:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:100%;"  &gt;&lt;span class="229060311-16032009"&gt;&lt;a title="blocked::http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411838" href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411838"&gt;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=411838&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a title="blocked::http://www.linuxquestions.org/questions/linux-software-2/e2fsck-is-running-for-3-days-checking-800-gb-ext3-lvm-volume-411715/" href="http://www.linuxquestions.org/questions/linux-software-2/e2fsck-is-running-for-3-days-checking-800-gb-ext3-lvm-volume-411715/"&gt;http://www.linuxquestions.org/questions/linux-software-2/e2fsck-is-running-for-3-days-checking-800-gb-ext3-lvm-volume-411715/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We prepared a Patch to address the issue. Here is the patch:&lt;br /&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:100%;"&gt;--- e2fsprogs-1.35/lib/ext2fs/icount.c  2003-12-07 22:41:38.000000000 +0530&lt;br /&gt;+++ e2fsprogs-1.35/lib/ext2fs/icount.c.new      2009-03-16 17:39:11.000000000 +0530&lt;br /&gt;@@ -251,6 +251,10 @@&lt;br /&gt;                             range = ((float) (ino - lowval)) /&lt;br /&gt;                                     (highval - lowval);&lt;br /&gt;                     mid = low + ((int) (range * (high-low)));&lt;br /&gt;+                       if (mid &gt; high)&lt;br /&gt;+                               mid = high;&lt;br /&gt;+                       if (mid &lt; mid =" low;" ino ="="&gt;list[mid].ino) {&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:100%;"&gt;We applied the patch against the source RPM and rebuilt the RPM to get a patched e2fsck.&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:Courier New;font-size:100%;"  &gt;&lt;span class="229060311-16032009"&gt;&lt;br /&gt;Then we ran the fsck again on the partition and waited for about 4-6 hours. Wow, it completed successfully. Here is the output:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;rpm -ivh e2fsprogs-1.35-7.1.src.rpm&lt;br /&gt;&lt;br /&gt;copied our patch "e2fsprogs-1.35-icount-floating-point-precision.patch" to /usr/src/redhat/SOURCES&lt;br /&gt;&lt;br /&gt;vi /usr/src/redhat/SPECS/e2fsprogs.spec&lt;br /&gt;&lt;br /&gt;Line15: Patch8: e2fsprogs-1.35-icount-floating-point-precision.patch&lt;br /&gt;Line54: %patch8 -p1 -b .icount-float&lt;br /&gt;&lt;br /&gt;cd /usr/src/redhat/SPECS/&lt;br /&gt;rpmbuild -ba e2fsprogs.spec&lt;br /&gt;&lt;br /&gt;...&lt;br /&gt;...&lt;br /&gt;...&lt;br /&gt;Wrote: /usr/src/redhat/SRPMS/e2fsprogs-1.35-7.1.src.rpm&lt;br /&gt;Wrote: /usr/src/redhat/RPMS/x86_64/e2fsprogs-1.35-7.1.x86_64.rpm&lt;br /&gt;Wrote: /usr/src/redhat/RPMS/x86_64/e2fsprogs-devel-1.35-7.1.x86_64.rpm&lt;br /&gt;Wrote: /usr/src/redhat/RPMS/x86_64/e2fsprogs-debuginfo-1.35-7.1.x86_64.rpm&lt;br /&gt;&lt;br /&gt;Now, e2fsprogs-1.35-7.1.x86_64.rpm was installed with rpm -Uvh&lt;br /&gt;&lt;br /&gt;[root@server root]# e2fsck -C 0 /dev/cciss/c1d0p1&lt;br /&gt;e2fsck 1.35 (28-Feb-2004)&lt;br /&gt;/dev/cciss/c1d0p1 was not cleanly unmounted, check forced.&lt;br /&gt;Pass 1: Checking inodes, blocks, and sizes&lt;br /&gt;Pass 2: Checking directory structure                                       &lt;br /&gt;Pass 3: Checking directory connectivity                                    &lt;br /&gt;Pass 4: Checking reference counts                                          &lt;br /&gt;Unattached inode 101949715                                                 &lt;br /&gt;Connect to /lost+found&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Inode 101949715 ref count is 65535, should be 1.  Fix&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Unattached zero-length inode 101949716.  Clear&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Unattached inode 101949717&lt;br /&gt;Connect to /lost+found&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Inode 101949717 ref count is 65535, should be 1.  Fix&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Unattached inode 101949718&lt;br /&gt;Connect to /lost+found&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Inode 101949718 ref count is 65535, should be 1.  Fix&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Unattached inode 101949719&lt;br /&gt;Connect to /lost+found&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Inode 101949719 ref count is 65535, should be 1.  Fix&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Unattached inode 101949720&lt;br /&gt;Connect to /lost+found&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Inode 101949720 ref count is 65535, should be 1.  Fix&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Unattached inode 101949721&lt;br /&gt;Connect to /lost+found&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Inode 101949721 ref count is 65535, should be 1.  Fix&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Pass 5: Checking group summary information                                 &lt;br /&gt;Block bitmap differences:  -(204107626--204107632) -(204107680--204107685) -204107757&lt;br /&gt;Fix&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Free blocks count wrong for group #6228 (5, counted=19).                   &lt;br /&gt;Fix&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Free blocks count wrong (54192711, counted=54192725).&lt;br /&gt;Fix&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Inode bitmap differences:  -(101949713--101949714)                         &lt;br /&gt;Fix&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Free inodes count wrong for group #6222 (7057, counted=7059).              &lt;br /&gt;Fix&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;Free inodes count wrong (78687902, counted=78687904).&lt;br /&gt;Fix&lt;y&gt;? yes&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/dev/cciss/c1d0p1: ***** FILE SYSTEM WAS MODIFIED *****&lt;br /&gt;/dev/cciss/c1d0p1: 46764384/125452288 files (0.-1% non-contiguous), 196710437/250903162 blocks&lt;br /&gt;[root@server root]#&lt;br /&gt;&lt;br /&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/y&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;"&gt;Maybe it helps someone else too.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4424078003942316099-3607441598345765856?l=www.techds.in' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.techds.in/feeds/3607441598345765856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.techds.in/2009/05/e2fsck-hanging-at-70-on-large-partition.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/3607441598345765856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/3607441598345765856'/><link rel='alternate' type='text/html' href='http://www.techds.in/2009/05/e2fsck-hanging-at-70-on-large-partition.html' title='E2fsck hanging at 70% on Large Partition'/><author><name>DevendraS</name><uri>http://www.blogger.com/profile/16368182158867977111</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_jL1N-ruOAOI/Spem99hihSI/AAAAAAAAABM/74aLU3uY790/S220/DS.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4424078003942316099.post-6163798151242068953</id><published>2009-02-24T14:05:00.010+05:30</published><updated>2009-02-24T15:33:25.335+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apache Segmentation fault'/><title type='text'>Debugging the notorious "Segmentation fault" in Apache Error Log?</title><content type='html'>Have you ever noticed errors as below in the Apache Error Log and scratched your head as from which URL has caused this.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;child pid xxxxx exit signal Segmentation fault (11)&lt;/span&gt; --&gt; xxxxx is a pid number.&lt;br /&gt;&lt;br /&gt;Problem is that whenever an Apache Thread / Process crashes, the error log reports this line and nothing more than that.&lt;br /&gt;&lt;br /&gt;That is we get no idea what type of request led to the segfault.&lt;br /&gt;&lt;br /&gt;To find out the reasons, one can start Apache in Single Process mode and try accessing the web-site and view the error log. Chances are that you may catch it.&lt;br /&gt;&lt;br /&gt;But, generally on a large Site that's really difficult. Moreover, if its a production site, possibility of taking this route is more difficult.&lt;br /&gt;&lt;br /&gt;You can also go through a suggested solution at &lt;a href="http://httpd.apache.org/dev/debugging.html#crashes"&gt;Debugging intermittent crashes.&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Solution&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is a module &lt;span style="font-style: italic;"&gt;mod_whatkilledus&lt;/span&gt; by an Apache Developer Jeff Trawick, which helped me a lot. I hope that this may help others too.&lt;br /&gt;&lt;br /&gt;mod_whatkilledus keeps a little bit of state on each active connection, which allows it to know what a thread was handling in case the thread segfaults. If that happens, it writes a report to the error log.&lt;br /&gt;&lt;br /&gt;Here is short note from within the mod_whatkilledus code itself:&lt;br /&gt;&lt;br /&gt;mod_whatkilledus is an experimental module for Apache httpd 2.x which tracks the current request and logs a report of the active request when a child process crashes. You should verify that it works reasonably on your system before putting it in production.&lt;br /&gt;&lt;br /&gt;mod_whatkilledus is called during request processing to save information about the current request. It also implements a fatal exception hook that will be called when a child process crashes.&lt;br /&gt;Apache httpd requirements for mod_whatkilledus:&lt;br /&gt;&lt;br /&gt; Apache httpd &gt;= 2.0.49 must be built with the --enable-exception-hook&lt;br /&gt; configure option and mod_so enabled.&lt;br /&gt;&lt;br /&gt;Compiling mod_whatkilledus:&lt;br /&gt;&lt;br /&gt; apxs -ci -I/path/to/httpd-2.0/server mod_whatkilledus.c&lt;br /&gt;&lt;br /&gt;Activating mod_whatkilledus:&lt;br /&gt;&lt;br /&gt;1. Load it like any other DSO.&lt;br /&gt;&lt;br /&gt;   LoadModule whatkilledus_module modules/mod_whatkilledus.so&lt;br /&gt;&lt;br /&gt;2. Enable exception hooks for modules like mod_whatkilledus:&lt;br /&gt;   EnableExceptionHook On&lt;br /&gt;&lt;br /&gt;3. Choose where the report on current activity should be written. If you want it reported to some place other than the error log, use the WhatKilledUsLog directive to specify a fully-qualified filename for the log. Note that the web server user id (e.g., "nobody") must be able to create or append to this log file, as the log file is not opened until a crash occurs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How I did:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I just recompiled my Apache with extra &lt;span style="font-style: italic;"&gt;--enable-exception-hook&lt;/span&gt; option in configure as:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;cd /usr/local/src/httpd-2.0.58  --&gt; then I was using 2.0.58&lt;br /&gt;./configure \&lt;br /&gt;--prefix=/usr/local/apache \&lt;br /&gt;--with-mpm=prefork \&lt;br /&gt;--enable-so \&lt;br /&gt;--enable-cgi \&lt;br /&gt;--enable-info \&lt;br /&gt;--enable-mod_status \&lt;br /&gt;--enable-usertrack \&lt;br /&gt;--enable-mime-magic \&lt;br /&gt;--enable-rewrite=shared \&lt;br /&gt;--enable-speling=shared \&lt;br /&gt;--enable-nonportable-atomics=yes \&lt;br /&gt;--enable-deflate \&lt;br /&gt;--enable-expires \&lt;br /&gt;--enable-headers \&lt;br /&gt;--enable-setenvif \&lt;br /&gt;--enable-env \&lt;br /&gt;--enable-unique-id \&lt;br /&gt;--enable-logio \&lt;br /&gt;&lt;span style="font-style: italic;"&gt;--enable-exception-hook&lt;/span&gt;&lt;br /&gt;make&lt;br /&gt;make install&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Now, the Apache was ready for Exception-Hook based modules.&lt;br /&gt;&lt;br /&gt;Lets, compile the mod_whatkilledus itself:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;cd /usr/local/src&lt;br /&gt;mkdir mod_whatkilledus&lt;br /&gt;cd mod_whatkilledus&lt;br /&gt;wget http://people.apache.org/~trawick/mod_whatkilledus.c&lt;br /&gt;wget http://people.apache.org/~trawick/test_char.h&lt;br /&gt;&lt;br /&gt;/usr/local/apache/bin/apxs -ci mod_whatkilledus.c&lt;br /&gt;&lt;/blockquote&gt;For me it produced the following output:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;[root@maria mod_whatkilledus]# /usr/local/apache_back/bin/apxs -ci mod_whatkilledus.c&lt;br /&gt;/usr/local/apache_back/build/libtool --silent --mode=compile gcc -prefer-pic  -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache_back/include  -I/usr/local/apache_back/include   -I/usr/local/apache_back/include   -c -o mod_whatkilledus.lo mod_whatkilledus.c &amp;amp;&amp;amp; touch mod_whatkilledus.slo&lt;br /&gt;/usr/local/apache_back/build/libtool --silent --mode=link gcc -o mod_whatkilledus.la  -rpath /usr/local/apache_back/modules -module -avoid-version    mod_whatkilledus.lo&lt;br /&gt;/usr/local/apache_back/build/instdso.sh SH_LIBTOOL='/usr/local/apache_back/build/libtool' mod_whatkilledus.la /usr/local/apache_back/modules&lt;br /&gt;/usr/local/apache_back/build/libtool --mode=install cp mod_whatkilledus.la /usr/local/apache_back/modules/&lt;br /&gt;cp .libs/mod_whatkilledus.so /usr/local/apache_back/modules/mod_whatkilledus.so&lt;br /&gt;cp .libs/mod_whatkilledus.lai /usr/local/apache_back/modules/mod_whatkilledus.la&lt;br /&gt;cp .libs/mod_whatkilledus.a /usr/local/apache_back/modules/mod_whatkilledus.a&lt;br /&gt;ranlib /usr/local/apache_back/modules/mod_whatkilledus.a&lt;br /&gt;chmod 644 /usr/local/apache_back/modules/mod_whatkilledus.a&lt;br /&gt;PATH="$PATH:/sbin" ldconfig -n /usr/local/apache_back/modules&lt;br /&gt;----------------------------------------------------------------------&lt;br /&gt;Libraries have been installed in:&lt;br /&gt; /usr/local/apache_back/modules&lt;br /&gt;&lt;br /&gt;If you ever happen to want to link against installed libraries&lt;br /&gt;in a given directory, LIBDIR, you must either use libtool, and&lt;br /&gt;specify the full pathname of the library, or use the `-LLIBDIR'&lt;br /&gt;flag during linking and do at least one of the following:&lt;br /&gt; - add LIBDIR to the `LD_LIBRARY_PATH' environment variable&lt;br /&gt;   during execution&lt;br /&gt; - add LIBDIR to the `LD_RUN_PATH' environment variable&lt;br /&gt;   during linking&lt;br /&gt; - use the `-Wl,--rpath -Wl,LIBDIR' linker flag&lt;br /&gt; - have your system administrator add LIBDIR to `/etc/ld.so.conf'&lt;br /&gt;&lt;br /&gt;See any operating system documentation about shared libraries for&lt;br /&gt;more information, such as the ld(1) and ld.so(8) manual pages.&lt;br /&gt;----------------------------------------------------------------------&lt;br /&gt;chmod 755 /usr/local/apache_back/modules/mod_whatkilledus.so&lt;br /&gt;[root@maria mod_whatkilledus]#&lt;br /&gt;&lt;/blockquote&gt;In my httpd.conf, I put the following:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;LoadModule whatkilledus_module modules/mod_whatkilledus.so&lt;br /&gt;&lt;br /&gt;EnableExceptionHook On&lt;br /&gt;&lt;br /&gt;WhatKilledUsLog /var/log/whatkilledus.log&lt;br /&gt;&lt;/blockquote&gt;Restarted the Apache (/etc/init.d/httpd restart).&lt;br /&gt;&lt;br /&gt;Started watching Apache Error Log:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;tail -f /var/log/apache_error_log&lt;/blockquote&gt;I just noticed a SegFault line:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;[Mon Feb 23 16:24:56 2009] [notice] child pid 29412 exit signal Segmentation fault (11)&lt;/blockquote&gt;&lt;br /&gt;Went on to check the /var/log/whatkilledus.log and I found something similar to the following:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;[Mon Feb 23 16:24:56 2009] pid 29412 mod_whatkilledus sig 11 crash&lt;br /&gt;[Mon Feb 23 16:24:56 2009] pid 29412 mod_whatkilledus active connection: 9.65.120.97:2035-&gt;9.27.177.26:8080 (conn_rec 434b90)&lt;br /&gt;[Mon Feb 23 16:24:56 2009] pid 29412 mod_whatkilledus active request (request_rec 438b48): GET /silly?fn=sigsegv HTTP/1.1|Host:aplinux.raleigh.ibm.com%3a8080|User-Agent:Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv%3a1.5)Gecko/20031007|Accept:text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1|Accept-Language:en-us,en;q=0.5|Accept-Encoding:gzip,deflate|Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.7|Keep-Alive:300|Connection:keep-alive|Cache-Control:max-age=0&lt;br /&gt;[Mon Feb 23 16:24:56 2009] pid 29412 mod_whatkilledus end of report&lt;br /&gt;&lt;br /&gt;&lt;/blockquote&gt;The above logs are not the actual once (I am unable to show due to obvious reasons). Thus, I was able to track the cause and intimated the Development Team and had it resolved.&lt;br /&gt;&lt;br /&gt;You can read more about it from Jeff Trawick's pages &lt;a href="http://people.apache.org/%7Etrawick/exception_hook.html"&gt;here&lt;/a&gt; and &lt;a href="http://people.apache.org/%7Etrawick/mod_whatkilledus.c"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4424078003942316099-6163798151242068953?l=www.techds.in' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.techds.in/feeds/6163798151242068953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.techds.in/2009/02/debugging-notorious-segmentation-fault.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/6163798151242068953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/6163798151242068953'/><link rel='alternate' type='text/html' href='http://www.techds.in/2009/02/debugging-notorious-segmentation-fault.html' title='Debugging the notorious &quot;Segmentation fault&quot; in Apache Error Log?'/><author><name>DevendraS</name><uri>http://www.blogger.com/profile/16368182158867977111</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_jL1N-ruOAOI/Spem99hihSI/AAAAAAAAABM/74aLU3uY790/S220/DS.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4424078003942316099.post-1292266967912636887</id><published>2009-02-13T09:30:00.002+05:30</published><updated>2009-02-13T10:39:15.563+05:30</updated><title type='text'>Remote Logging and simplest LogServer</title><content type='html'>I am not going to talk about Central Syslog Server or Syslog-ng.&lt;br /&gt;&lt;br /&gt;There are situations where one would like make some logs remotely viewable (say, to some developer who is not allowed to the Remote Server).&lt;br /&gt;&lt;br /&gt;You could use netcat. Something like this would work.&lt;br /&gt;&lt;br /&gt;On the remote machine:&lt;br /&gt;&lt;br /&gt;tail -f /some/log/file.log | nc Local-IP Port&lt;br /&gt;&lt;br /&gt;On the Local machine:&lt;br /&gt;&lt;br /&gt;nc -l -p Port&lt;br /&gt;&lt;br /&gt;Netcat is a little 25K Swiss Army Knife that can be really useful.&lt;br /&gt;&lt;br /&gt;But, once I had a different situation.&lt;br /&gt;&lt;br /&gt;There were around 6 different application Servers (in a cluster - request could come to anyone) generating access Logs on each one. We wished to gather the access logs on a Central place (Machine) in real-time to process / analyze.&lt;br /&gt;&lt;br /&gt;All of a sudden I remembered DJB's tcpserver and multilog.&lt;br /&gt;&lt;br /&gt;I prepared a Central Log collection Server with a daemon tools run script something similar to as below:&lt;br /&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;export PATH="/usr/local/bin:$PATH"&lt;br /&gt;setuidgid remoteloguser tcpserver Ip-Addr-of-LogServer Listen-Port-on-Server multilog ./access_log&lt;br /&gt;&lt;br /&gt;And on each of the individual log generating Servers I implemented something similar to:&lt;br /&gt;&lt;br /&gt;multitail /var/log/local_access_log | tcpclient Ip-Addr-of-LogServer Listen-Port-on-Server sh -c "cat &gt;&amp;amp;7"&lt;br /&gt;&lt;br /&gt;of course you have to run this one in background. I had also used the multitail from &lt;a href="http://untroubled.org/qlogtools/"&gt;qlogtools&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;A more interesting solution could be &lt;a href="http://smarden.org/socklog/network.html"&gt;socklog&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4424078003942316099-1292266967912636887?l=www.techds.in' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.techds.in/feeds/1292266967912636887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.techds.in/2009/02/remote-logging-and-simplest-logserver.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/1292266967912636887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/1292266967912636887'/><link rel='alternate' type='text/html' href='http://www.techds.in/2009/02/remote-logging-and-simplest-logserver.html' title='Remote Logging and simplest LogServer'/><author><name>DevendraS</name><uri>http://www.blogger.com/profile/16368182158867977111</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_jL1N-ruOAOI/Spem99hihSI/AAAAAAAAABM/74aLU3uY790/S220/DS.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4424078003942316099.post-4428980577103524731</id><published>2009-02-12T14:30:00.003+05:30</published><updated>2009-02-12T14:42:36.523+05:30</updated><title type='text'>qmail-rspawn qmail-lspawn memory leak</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Having trouble with qmail-rspawn (or qmail-lspawn) leaking memory?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One problem is with glibc2.3 (redhat-4) and possibly glibc2.4's implementation of vfork where there is an execvp memory leak in a vfork context described &lt;a href="https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=221187"&gt;here&lt;/a&gt; (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=221187) and &lt;a href="http://sources.redhat.com/ml/libc-hacker/2007-01/msg00000.html"&gt;here&lt;/a&gt; (http://sources.redhat.com/ml/libc-hacker/2007-01/msg00000.html).&lt;br /&gt;&lt;br /&gt;A workaround if you can't get the patch for your system: qmail is stable compiling statically on&lt;br /&gt;a patched system (glibc-2.5.90-15 rawhide or older glibc2.2 system) just add -static to conf-ld and run it on the target system.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Reproduced from &lt;a href="http://www.thesmbexchange.com/eng/qmail-rspawn-spawn_memleak.html"&gt;http://www.thesmbexchange.com/eng/qmail-rspawn-spawn_memleak.html&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;See Also a similar report in Qmail Mailing List:&lt;br /&gt;&lt;a href="http://www.gossamer-threads.com/lists/qmail/users/131456"&gt;http://www.gossamer-threads.com/lists/qmail/users/131456&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I had experienced it and had concluded the same. While searching for this issue reported or experienced by others, I had encountered this post.&lt;br /&gt;&lt;br /&gt;Hope that others would also find this useful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4424078003942316099-4428980577103524731?l=www.techds.in' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.techds.in/feeds/4428980577103524731/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.techds.in/2009/02/qmail-rspawn-qmail-lspawn-memory-leak.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/4428980577103524731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/4428980577103524731'/><link rel='alternate' type='text/html' href='http://www.techds.in/2009/02/qmail-rspawn-qmail-lspawn-memory-leak.html' title='qmail-rspawn qmail-lspawn memory leak'/><author><name>DevendraS</name><uri>http://www.blogger.com/profile/16368182158867977111</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_jL1N-ruOAOI/Spem99hihSI/AAAAAAAAABM/74aLU3uY790/S220/DS.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4424078003942316099.post-8885893704636284097</id><published>2009-02-12T14:05:00.004+05:30</published><updated>2009-02-12T14:26:36.251+05:30</updated><title type='text'>Excel Formula to convert Epoch time to localtime (IST)</title><content type='html'>UNIX time is the number of seconds that has elapsed since 1/1/1970 [DATE(1970,1,1) = 25569].&lt;br /&gt;&lt;br /&gt;Excel calculates dates by using the number of days that has elapsed since 1/1/1900.&lt;br /&gt;&lt;br /&gt;Therefore you should be able to convert from one to the other by converting from seconds to days, and then adding on the 70 odd years difference, Plus 5:30 hours for IST (330 mins = 19800 secs).&lt;br /&gt;&lt;br /&gt;Thus The formula : =((A1+19800)/86400)+25569 where A1 contains the UNIX time should convert to Excel date/time.&lt;br /&gt;&lt;br /&gt;Make sure you format the cell as the required date/time format.&lt;br /&gt;&lt;br /&gt;BTW, if you wish to convert a unix time using a perl one liner:&lt;br /&gt;&lt;br /&gt;perl -e 'print scalar localtime(x),"\n"'&lt;br /&gt;&lt;br /&gt;where x is the unix time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4424078003942316099-8885893704636284097?l=www.techds.in' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.techds.in/feeds/8885893704636284097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.techds.in/2009/02/excel-formula-to-convert-epoch-time-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/8885893704636284097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/8885893704636284097'/><link rel='alternate' type='text/html' href='http://www.techds.in/2009/02/excel-formula-to-convert-epoch-time-to.html' title='Excel Formula to convert Epoch time to localtime (IST)'/><author><name>DevendraS</name><uri>http://www.blogger.com/profile/16368182158867977111</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_jL1N-ruOAOI/Spem99hihSI/AAAAAAAAABM/74aLU3uY790/S220/DS.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4424078003942316099.post-3301013968075025245</id><published>2009-02-12T13:36:00.002+05:30</published><updated>2009-02-12T13:38:50.639+05:30</updated><title type='text'>Locate your CPAN.pm's systemwide configuration file</title><content type='html'>Do you want to locate the CPAN.pm's systemwide configuration file on your Linux Machine, try this one liner:&lt;br /&gt;&lt;br /&gt;perl -le 'for (@INC) { $_ .= $ARGV[0]; print if -f }' /CPAN/Config.pm /System/Library/Perl/CPAN/Config.pm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4424078003942316099-3301013968075025245?l=www.techds.in' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.techds.in/feeds/3301013968075025245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.techds.in/2009/02/locate-your-cpanpms-systemwide.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/3301013968075025245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4424078003942316099/posts/default/3301013968075025245'/><link rel='alternate' type='text/html' href='http://www.techds.in/2009/02/locate-your-cpanpms-systemwide.html' title='Locate your CPAN.pm&apos;s systemwide configuration file'/><author><name>DevendraS</name><uri>http://www.blogger.com/profile/16368182158867977111</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_jL1N-ruOAOI/Spem99hihSI/AAAAAAAAABM/74aLU3uY790/S220/DS.jpg'/></author><thr:total>0</thr:total></entry></feed>
