Wednesday, October 7, 2009

Threads in GDB

I was recently facing some issue with a multi threaded program. The program was getting terminated because one thread was dying and it was causing a broken pipe in other threads. Now, there were multiple threads that are opening a pipe. The program had quite a few number of threads. Hence I could not find out which thread was misbehaving and causing the entire application to fail. However, this made me to look into threads support in GDB.

I found the following interesting articles on the net on debugging threads using gdb.

http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gdb/threads.html

Here is a summary of commands

1. info threads
Shows information on threads

2. thread
Allows you to switch to that thread. Then you can do a bt or something similar

3. break file.c:lineno thread if condition
Allows to set a break point conditionally for a specific thread

4. set print thread-events on
Turns on printing entry and exit of a thread

5. thread apply args
Applies a command to a thread/all threads

I still don't know how to tackle my issue of dying thread. However, I expect a combo of 3,4 might shed some light. I will post the details tomorrow after trying.

Sunday, October 4, 2009

Picasa name tags

Well, I noticed this only recently. Today while adding a few photos to Picasa, I experienced the power of this feature myself. It could,

1. Detect almost all faces present in the images
2. Relate a number of detected photos and recognize they are photos of same person
3. Suggest close matches for most of the photos from already tagged photos.

The below image is a screenshot of google detecting almost all occurrences of my face from an album and suggesting that it is me! It has made a single mistake but that is the picture of one of my paternal uncle.



There was one more amazing factor. For every picture it was making some suggestions. The suggestions were mainly either a correct match or a person who is of close blood relation!

Well, I am not an expert in this field. But, I can see Google coming up with real image search in near future. Well done Google.

Saturday, September 26, 2009

Back home

http://www.olpcnews.com/laptops/xo15/video_xo-15_laptop_dual_boot.html
http://www.olpcnews.com/laptops/xo15/olpc_news_exclusive_xo-15_laptop.html

OLPC guys are back to basics. Though many claim that this is a undoing the all the research and innovation done in the initial stages of OLPC, I look at it as a journey towards real feasible commercial solution. VIA C7 was in market for many years now. So? It was after the death of many great personalities that we recognised their contribution to mankind. 5-6 years is nothing. Lets not get into it. However, my personal opinion is, if ARM is to be chosen, the sole basis should be the benefits of ARM over x86. It should not be for creating a lock-in for Linux.

Anyway, this is good news. Hope to see Linux on XO-2.0 too.

Saturday, September 19, 2009

clearcase find

Today I had to merge main branch files to a private branch. The reason was that people was updating the main branch and private branch was having many issues. However, when it came to updating files in private branch, I could not find which are the files that were branched out. This forced me to refresh some old commands of clearcase. I used a simple find to get a list of all files which were on a private branch.

cleartool find ./ -element "brtype(Private_branch)" -print

Let me also post some sites from where you can get some good information on clearcase commands.

1. http://www.yolinux.com/TUTORIALS/ClearcaseCommands.html (Has some simple examples)

2. http://publib.boulder.ibm.com/infocenter/cchelp/v7r0m0/index.jsp?topic=/com.ibm.rational.clearcase.hlp.doc/cc_main/c_hood_cleartool_cli.htm

3. Last but not least, use cleartool man to get offline help. (I goes without saying that you should have cc installation if you have to use it)

Sunday, August 23, 2009

mysql-embedded

Well, I was looking at sqlite last week. But while doing a yum update I found this rpm package. "mysql-embedded". On doing a rpm -qi, it told me that this is a C interface to mysql that can directly be embedded in your application. I haven't tried it yet. But I am sure its going to be interesting. The package has only one shared library. However the size is ~7.5M. If I happen to use it, will post again here.