Saturday, April 11, 2009

The Free Software Foundation and Open Source Initiative

Histories have come and gone by, we never stay to remember them, 'cause there's lot more to do, than to remember the chronology of our descend. But what we do remember is our drawbacks, own mistakes... whether it be 10minutes back or 10 decades old! I don't wish to impose any school of thought through this post, what I do intend, is to put up a comprehensive view of what the software movement has been in the for out IT industry what it is was and what promises it holds. Who all are the think tanks and what do they offer. I wish you to keep an open mind through this detour.....

It was back 4-5 decades down the line, when a MIT researcher was fed up with the proprietary licences that he had to manage in order to develop a new concept. The problem he had to face is that, most of his time he was concerned of the budget overruns rather than coding standards ;).

His name, as many of you would have guessed, was Richard Stallman, the father of Free Software and family head of Free Software Foundation! He had the novel idea of sharing....

"You are not humane if you cheat with your neighbours.....",

were his common words.

He started the much needed Free Software Foundation, which was NOT an organization or license but a movement, simply a mass movement.





FREE SOFTWARE FOUNDATION

Thought the flow of events are too long to discuss I wish to tell you how Operating Systems evolved and eloped:

1. I dont remember the first seeds of operating systems but, System V, developed by Kerningham and Ritchie was one the first and full fledged OS developed. They developed it on a very meek m/c.

2. Following System V, BSD( Berkeley Software Distribution ) also started knitting their own Operating System. Finally there was UNIX which was a development version of System V.

3. The UNIX operating system was becoming pretty famous, but the problem being, the source was not open to people.

This is what led to Stallman's thinking of equality, freedom to code and the Free Software Foundation. Influenced by the efficiency of UNIX he sat down to write the whole Operating System( he left the Kernel for the end ) on his own. This can be considered the very root of Open Source Community. Not surprisingly people joined him on his detour towards a new world where there was no owner but contributors galore.

Stallman remarks that he was amazed to see the pace at which patches were included into the system and he was delighted that this methodology worked. He named this Operating System as GNU - GNU Not Unix. But why such a name?? As GNU was much more like UNIX but it had a different philosophy all together, he wanted people to know that there's something different from UNIX, and "that" something is the sole reason GNU is being developed. Hence the Recursive Acronym.

When Stallman had finished the GNU set of utilities, he sat down to write the kernel that would make the system complete( right now GNU utils were made on UNIX ). Interesting development took place at this step, a Finland Phd student was writing a kernel on the very same lines and amazingly he had completed it before Stallman could do it! He was none other than Linus Torvalds.

Linus himself thought on the lines of freedom to source and mild licensing. The GNU took Linus's kernel and attached their patch of utilities. By the while, Linus maned his kernel Linux as it meant Linus+Unix=Linux. The duo of Gnu and Linux is till date famous as GNU/LINUX. Here's a pic of the same.



The Linux Tux flying under the Gnu Bull, Gnu/Linux duo :D

The Open Source Initiative



OSI Trademark Logo

The open source initiative to me was more of a "Commercial Move" aimed at popularising the "Openness of softwares". The benifit? Well, by the name of Free Software Foundation it seemed like they were talking of the "Free Beer" more than "Free Speech"! There were not much of industry involvement or support to the FSF, simply because they didnt see any profitable marketing strategy and the FSF philosophy was more of a NGO... heh.

Open Source Foundation took the task of commercialising the very basics of FSF, though obviously, with some changes. I would not jump to the theoretical aspects, rather would take an example to illustrate the same.

UBUNTU

Known as the household face of "Linux". Here are some facts that'll spill the can of beans, right in front of you.... hmmm. So the first question is, what is Ubuntu, Open Source or Free Software, well it's an Open Source product. Free Software would not have allowed to have any proprietary software support, but Ubuntu has repositories which openly support binary only softwares. Take for example the RealPlayer for Linux, Flashplayer Plugins and lots more! If Stallman was to endorse Ubuntu, he simply would have stripped all those binary only softs.


But dear frnzz, if Open Source would not have been there... Ubuntu wouldnt have been whats it's today... the commercial benifits it claims as having openess to all... whether Proprietary of Free software, is what fills up it's cashbanks. But on the same hand, whatever activity or project it takes up are per Free Software standards.

Undoubtedly.... Open Source has had a practical approach to survive in the market! Some people have called Free Software Foundation as being communal( Communal -- Forcing Some Act ), I personally feel.... having a rigid and unbending view has been their problem.... that is why they never became a reality, remained a mere movement! Open Source has taken the steps in the right direction... and you might find Stallman screaming around.... telling peopple that they are DIFFERENT from OSI. For the facts GNU Operating System is perhaps one of the few "Free Software Project" under the Operating Sys catagory, you might google others, I dont really care.

Open Source or FSF... why should I do it ??

Many of my friends and a new budding programmer asked me recently. Whats the initiative to work in Open Source after all.

I dont want to convince anybody, I work in open source because I love to code, and Open Source projects is where I have no restrictions to learn, read, code and contribute. I love to help my neighbours and if that needs some initiative, you better start preparing for a English Vocab paper as Microsoft have changed strategies for new employees :)

Conclusion

The talk is highly shortened, partly because I've my exams up sleeves and because the History is never easy to interpret. But my feeling about the whole OSI and FSF thingy lies on the commoness of ideas and NOT on the differences. Where FSF is an ideology, Open Source is it's realization and in real time dynamics you need to have optimization( i sound an Engineer here ;) ).

Whats important for me is, if the source is made open... i can use it for modifying... I can code because I love it... I have access to the most intricately written media players, chat clients and his highness.... Kernel! I dont care a damn of what people make out of differences b/w FSF and OSI. I am with the concurrunt views.

May the Source be With you!

Thursday, April 9, 2009

ORKUT HACKED.... JOTIKA LINKS, PORTUGUESE LINKS...

Well it has been a fascinating overnite having tryst with the UGLY security of Orkut and the way it manages Cookies. If you are having your About me changed to Junk/Vulgar links of Jotika Sex Chat or Portugese Sex Chats... then this the place you are looking for to secure. I'll tell you how they are hacking the account so that you may understand the solution with affirmation....

HACK

Cookies are basically stored on your computer when you log onto Orkut. But why? Suppose you are navigating from one page to another, orkut has no way to tell if that navigation is secure until and unless you give it the password. But giving a password everytime will be cumbersome. So to avoid that Orkut saves a certificate on your computer, in the form of a cookie telling that if a request has the cookie information attached( as it is a local information only the owner has it right now ) then the navigation is secure.

Are cookies permanent? NO

Cookies have a lifetime which is defaulted to Session, i.e. as soon as you logout your cookie is destroyed. Orkut specifically has Session Lifetime.

So when you log in again a new cookie is assigned... have a screenshot of the cookie information...



How are they hacking it... if you click a malicious link and you have the cookie stored at that time... you are done!

The cookies is sent over the net to the hacker, he edits his own cookie with your information... as long as you dont logout the cookie holds goooood and you will be raped all angles :P.The links they are keeping on hacked profiles are malicious so if u click them u'll compromise badly.

SAFE BROWSING

Those who didnt get hacked, dont click any malicious link or hacked profile links! A higher precaution can be to logout after each use and not keep the account idle for exploits...

Those who got hacked.... do the following

1. Change the pic, aboutme, your sex, orientation and wat not :P
2. Remove the malicious communities from the account... see for malicious friends!
3. Logout immidiately..... actually as u'll goto the commmunity to remove it... they'll get your cookie! It takes time to process it... 5-10 min atleast.... make your changes and logout... the cookie will be destroyed.
4. Obviously the "Non hacked users" rules apply :P

Happy Orkutting, Chirkutting ;)

Saturday, April 4, 2009

Pen Drive Security System

Recently I with my team-mates made a solution to a problem statement released for an Intra Collegiate Event. The problem( in brief ) goes as follows:

1. You have to design a Pen Drive security system that resides on a Pen Drive, does no installation of software on a Operating Client and provides on the go run facility, as in plug and shoot.

2. The security should be two leveled where the Files are encrypted with a Key and a suitable algorithm( the key will generally be random ). The key has to be stored in a way so that it is secured via the main password that the user shall hold or the private key.

3. The software should preferably have a nice looking GUI, extra points for Native look.

Our Approach:

1. As the system has to be supported fully on a Operating System we definitely cannot assume packages like Java to be installed which can easily be the best choice for a platform-independent choice. Packing a whole JVM was a waste of effort as it'll take huge amount of space.

2. We used GTK+-2.0 for the same reason. Being a small and a protable library and having a cross platform support in Windows/Linux we'll have enough to say in terms of portability. Also the look and feel of GTK is far-far-far better than say Java-MOTIF or else!

3. The software installed will have two layers of security

(a) The master password which will be held by the master user.( there will be user accounts just
as in unix etc )

(b) A random key will be used to encrypt a file sored under the device. The random key will be encrypted via the master password and stored as the first bytes of the file. The Encryption algorithm used shall be of highest quality, namely, AES!

Have a look at the snapshots and u'll have a good feel of the software :)














Tuesday, March 31, 2009

Pidgin Crashreporter

The following pic shall show you how the crashreporter springs up when the application crashes. The plugin i wrote had a simple *a=NULL; *a=bla; which made it crash.

The plugin will be correctly reported in the reporter window. It's shows that even w/o debugging symbols we might find what the source of problem is, specially for third party plugins

Monday, March 30, 2009

Breakpad Functioning

This is an Illustration of how Breakpad works.... just to illustrate how the Library behaves etc....

The code I am using is pretty trivial hence the trace etc shall be pretty small newayz....

Here's a simple program that crashes relentlessly :P



include

#include

#include

#include

#include

#include

#include "client/linux/handler/exception_handler.h"

#include "client/linux/handler/linux_thread.h"

using namespace google_breakpad;

static ExceptionHandler* handler_process=NULL;

// Callback when minidump written.

static bool MinidumpCallback(const char *dump_path,

const char *minidump_id,

void *context,

bool succeeded) {

printf("%s is dumped\n", minidump_id);

return true;

}

static void *thread_crash(void *) {

ExceptionHandler handler_process(".", NULL, MinidumpCallback,

NULL, true);

while(true) sleep(1);

}



static void CreateCrashThread() {

pthread_t h;

pthread_create(&h, NULL, thread_crash, NULL);

pthread_detach(h);

}



int main(int argc, char *argv[]) {

int handler_index = 0;

CreateCrashThread();

int *a=NULL;

*a=0; //crash

while (true)

sleep(10);

return 0;

}



What i'll do is compile this code via linking it through the Breakpad Library! I had to compile the code bit by bit.... most of the tools etc were not built by default and were left for( i dunno ) exercise? Newayz......

sanket@sanket-desktop:~/.subversion/google-breakpad-read-only/src/client/linux/handler$ gcc -c -gstabs -I ../../../ myCrash.cc

sanket@sanket-desktop:~/.subversion/google-breakpad-read-only/src/client/linux/handler$ g++ -gstabs -lpthread myCrash.o exception_handler.o linux_thread.o minidump_generator.o ../../minidump_file_writer.o ../../../common/convert_UTF.o ../../../common/string_conversion.o ../../../common/linux/file_id.o ../../../common/linux/guid_creator.o md5.o -o output

sanket@sanket-desktop:~/.subversion/google-breakpad-read-only/src/client/linux/handler$ ./output

5012fabe-5cd6-0ede-35eb05fb-77e2564c is dumped

sanket@sanket-desktop:~/.subversion/google-breakpad-read-only/src/client/linux/handler$ ls -lh 5012fabe-5cd6-0ede-35eb05fb-77e2564c.dmp

-rw------- 1 sanket sanket 18K 2009-03-30 16:55 5012fabe-5cd6-0ede-35eb05fb-77e2564c.dmp


Hence we have a dump which will invariably be of size of 10-20 Kb. There can be optimization here based on local processing so as to reduce server load... but i'll defer from treating that topic here :)

The important thing is the generation of meaningful data from this dump. As I have used the normal libs( libstdc++ etc ) which dont have symbol information the output might not be that well percieved;

sanket@sanket-desktop:~/.subversion/google-breakpad-read-only/src/tools/linux/dump_syms$ ./dump_syms ../../../client/linux/handler/myCrash.o > myCrashSyms.sym

There's a python code which i searched and it's pretty good when creating Symbols from files in a very systematic File Hierarchy i shall use that code as a Part of a larger project that might need more tweaking... here's the link..


http://crashopensource.files.wordpress.com/2007/12/symbolstore12_07_2007.txt

Continuing i shall show you the result after running minidump_stackwalk on the minidump file along with the symbols file we just created:

Here's the o/p when run with minidump_stackwalk bin.



------------------------------------------------------------------------------------------------------------------------

Operating system: Linux

0.0.0 Linux 2.6.27-11-generic #1 SMP Thu Jan 29 19:24:39 UTC 2009 i686 GNU/Linux

CPU: x86

GenuineIntel family 6 model 6 stepping 5

2 CPUs

Crash reason: SIGSEGV

Crash address: 0x80497d1

Thread 0 (crashed)

0 output + 0x17d1

eip = 0x080497d1 esp = 0xbfe87360 ebp = 0xbfe87378 ebx = 0xb7e14ff4

esi = 0x08053650 edi = 0x080496c0 eax = 0x00000000 ecx = 0x00005045

edx = 0xb7cb9b90 efl = 0x00010246

1 libc-2.8.90.so + 0x16684

eip = 0xb7cd1685 esp = 0xbfe87380 ebp = 0xbfe873e8

Thread 1

0 0xb7f87430

eip = 0xb7f87430 esp = 0xb7cb6d50 ebp = 0xb7cb6f28 ebx = 0xb7cb6f14

esi = 0xb7cb6f14 edi = 0xb7cb6f14 eax = 0xfffffdfc ecx = 0xb7cb6f14

edx = 0xb7e14ff4 efl = 0x00000246

1 output + 0x1929

eip = 0x0804992a esp = 0xb7cb6f30 ebp = 0xb7cb93b8

2 libpthread-2.8.90.so + 0x650e

eip = 0xb7f4350f esp = 0xb7cb93c0 ebp = 0xb7cb94b8

Loaded modules:

0x08048000 - 0x08056fff output ??? (main)

0x08057000 - 0x08057fff output ???

0x08058000 - 0x08058fff output ???

0xb7cbb000 - 0xb7e12fff libc-2.8.90.so ???

0xb7e13000 - 0xb7e14fff libc-2.8.90.so ???

0xb7e15000 - 0xb7e15fff libc-2.8.90.so ???

0xb7e19000 - 0xb7e25fff libgcc_s.so.1 ???

0xb7e26000 - 0xb7e26fff libgcc_s.so.1 ???

0xb7e27000 - 0xb7e27fff libgcc_s.so.1 ???

0xb7e28000 - 0xb7e4bfff libm-2.8.90.so ???

0xb7e4c000 - 0xb7e4cfff libm-2.8.90.so ???

0xb7e4d000 - 0xb7e4dfff libm-2.8.90.so ???

0xb7e4f000 - 0xb7f31fff libstdc++.so.6.0.10 ???

0xb7f32000 - 0xb7f35fff libstdc++.so.6.0.10 ???

0xb7f36000 - 0xb7f36fff libstdc++.so.6.0.10 ???

0xb7f3d000 - 0xb7f51fff libpthread-2.8.90.so ???

0xb7f52000 - 0xb7f52fff libpthread-2.8.90.so ???

0xb7f53000 - 0xb7f53fff libpthread-2.8.90.so ???

0xb7f6d000 - 0xb7f86fff ld-2.8.90.so ???

0xb7f88000 - 0xb7f88fff ld-2.8.90.so ???

0xb7f89000 - 0xb7f89fff ld-2.8.90.so ???


------------------------------------------------------------------------------------------------------------------------


It sums it all.... we can now start creating symbol compiled library and compile them with -gstabs etc to produce the appropriate symbols etc.

Chao :-)





Sunday, March 29, 2009

AbiwSnap


Here's the .png file

Monday, March 9, 2009

Crash'em all

NOTE:- This is a high end technical post.... if you are really not into it, I really don't care of the total hits :)

It's been a long time since I've been working on a new library. I wont be opening the flood gates by letting all information flow... but still show you some glimpses of how technology has changed in this all so complex Open Source business.

What generally happens when your program crashes... well most of you think it in terms of "Hanging of the binary" and it's consequential termination by the Kernel.
The kernel does so when it sees that the binary is either trying to occupy some domain not in it's program stack space or when it tries to access pointer to some restricted space.

Now it's an interesting fact that most of you might not know.... whenever a program is executing, the processor takes one instruction at a time( for the time being the instruction can be thought of as a line in the program ). It's interesting to note that, what all happens is that the program counters, it's activations records and other state variables move from one state to other. Changing the configuration continuously. And yes... you can capture each configuration seperately. Have a look at this C file:

#include
#include

void bug();

int main(int argc, char *argv[])
{
int a=0,b=1,c=2;
printf("till here everthing is fine %d %d %d",a,b,c);
bug(); //wooo... crash
printf("dont hope to reach here :P");
return 0;
}

void bug(){

int i,a[10];

for(i=0;i<1000;i++) style="color: rgb(51, 51, 255);">sanket@sanket-laptop:~$ gdb ./a.out

GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) b main
Breakpoint 1 at 0x8048385: file bug_c.c, line 8.
(gdb) r
Starting program: /home/sanket/a.out

Breakpoint 1, main () at bug_c.c:8
8 int a=0,b=1,c=2;
(gdb) s
9 printf("till here everthing is fine %d %d %d",a,b,c);
(gdb) s
10 bug(); //wooo... crash
(gdb) s
bug () at bug_c.c:17
17 int *a=NULL;
(gdb) s
20 a=10; //my classic was to trigger bug.. unless kernel is too generous :D
(gdb) s
21 printf("%d",*a);
(gdb) s

Program received signal SIGSEGV, Segmentation fault.
0x080483f1 in bug () at bug_c.c:21
21 printf("%d",*a);
(gdb) bt full
#0 0x080483f1 in bug () at bug_c.c:21
a = (int *) 0xa
#1 0x080483c0 in main () at bug_c.c:10
a = 0
b = 1
c = 2

The interesting thing here is the command bt full, which displays the position of the function while it crashed. Clearly, we had a crash in bug() followed by that in main() and the backtrace has two function calls as it is evident.

This information is extremely essential when debuggers/programmers set out to solve a bug. This trace has a lot more to it then it'll look at first... just for instance look at this trace( it's a crash of a proprietry software ;) )

(gdb) core-file core
(no debugging symbols found)
Core was generated by `/media/disk/iViz/project/avgscan avg_poc.exe'.
Program terminated with signal 11, Segmentation fault.
[New process 31608]
#0 0xb7d1b4e7 in ?? ()
(gdb) bt full
#0 0xb7d1b4e7 in ?? ()
No symbol table info available.
#1 0x080809c4 in ?? ()
No symbol table info available.
#2 0x080826f2 in ?? ()
No symbol table info available.
#3 0x08052651 in ?? ()
No symbol table info available.
#4 0x08053753 in ?? ()
No symbol table info available.
#5 0x08053a82 in ?? ()
No symbol table info available.
#6 0x0806bf7f in ?? ()
No symbol table info available.
#7 0x081685b2 in ?? ()
No symbol table info available.
#8 0x08168b19 in ?? ()
No symbol table info available.
#9 0x0816976b in ?? ()
No symbol table info available.
#10 0x0818898e in ?? ()
No symbol table info available.
#11 0x081894f9 in ?? ()
---Type to continue, or q to quit---
No symbol table info available.
#12 0x0818b331 in ?? ()
No symbol table info available.
#13 0x0817c20f in ?? ()
No symbol table info available.
#14 0x0817d51f in ?? ()
No symbol table info available.
#15 0x08192df5 in ?? ()
No symbol table info available.
#16 0x08193348 in ?? ()
No symbol table info available.
#17 0x0818c1a7 in ?? ()
No symbol table info available.
#18 0x0818d18f in ?? ()
No symbol table info available.
#19 0x08158429 in ?? ()
No symbol table info available.
#20 0x08151006 in ?? ()
No symbol table info available.
#21 0x08151d40 in ?? ()
No symbol table info available.
#22 0x0815301d in ?? ()
No symbol table info available.
---Type to continue, or q to quit---
#23 0xb7cbe450 in ?? ()
No symbol table info available.
#24 0x0804e4f1 in ?? ()
No symbol table info available.
(gdb)

some more information that can be useful:

(gdb) info all-registers
eax 0x0 0
ecx 0x35427516 893547798
edx 0x0 0
ebx 0xd50bd000 -720646144
esp 0xbfffdee8 0xbfffdee8
ebp 0xbfffdf28 0xbfffdf28
esi 0xd50bd000 -720646144
edi 0x834b000 137670656
eip 0xb7d1b4e7 0xb7d1b4e7
eflags 0x10246 [ PF ZF IF RF ]
cs 0x73 115
ss 0x7b 123
ds 0x7b 123
es 0x7b 123
fs 0x0 0
gs 0x33 51
st0 0 (raw 0x00000000000000000000)
st1 0 (raw 0x00000000000000000000)
st2 0 (raw 0x00000000000000000000)
st3 0 (raw 0x00000000000000000000)
st4 0 (raw 0x00000000000000000000)
st5 0 (raw 0x00000000000000000000)
st6 39855 (raw 0x400e9baf000000000000)
---Type to continue, or q to quit---
st7 39855.5 (raw 0x400e9baf800000000000)
fctrl 0x37f 895
fstat 0x4020 16416
ftag 0xffff 65535
fiseg 0x73 115
fioff 0x81fe18a 136307082
foseg 0x7b 123
fooff 0xbfffe960 -1073747616
fop 0x59d 1437
xmm0 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm1 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm2 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm3 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
---Type to continue, or q to quit---
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm4 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm5 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm6 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
xmm7 {v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0},
v16_int8 = {0x0 }, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0},
uint128 = 0x00000000000000000000000000000000}
mxcsr 0x1f80 [ IM DM ZM OM UM PM ]
mm0 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm1 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
---Type to continue, or q to quit---
mm2 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm3 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm4 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm5 {uint64 = 0x0, v2_int32 = {0x0, 0x0}, v4_int16 = {0x0, 0x0,
0x0, 0x0}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}}
mm6 {uint64 = 0x9baf000000000000, v2_int32 = {0x0, 0x9baf0000},
v4_int16 = {0x0, 0x0, 0x0, 0x9baf}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0xaf, 0x9b}}
mm7 {uint64 = 0x9baf800000000000, v2_int32 = {0x0, 0x9baf8000},
v4_int16 = {0x0, 0x0, 0x8000, 0x9baf}, v8_int8 = {0x0, 0x0, 0x0, 0x0, 0x0,
0x80, 0xaf, 0x9b}}
(gdb)

Newayz the registers are really important though you may not even get a sniff from the above depiction. Another interesting output I want you to see... just refer to the first program:

sanket@sanket-laptop:~$ gdb ./a.out
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) breakpoint main
Breakpoint 1 at 0x8048385: file bug_c.c, line 8.
(gdb) run
Starting program: /home/sanket/a.out

Breakpoint 1, main () at bug_c.c:8
8 int a=0,b=1,c=2;
(gdb) s
9 printf("till here everthing is fine %d %d %d",a,b,c);
(gdb) bt full
#0 main () at bug_c.c:9
a = 0
b = 1
c = 2
(gdb) info sharedlibrary
From To Syms Read Shared Object Library
0xb7fe47f0 0xb7ff979f Yes /lib/ld-linux.so.2
0xb7e90230 0xb7f90d84 Yes /lib/tls/i686/cmov/libc.so.6
(gdb) info locals
a = 0
b = 1
c = 2
(gdb)

What I've done is... stopped the program flow at a certain point( by use of breakpoints ) stepped through a few lines and shown you the state of the program... wow!! You can get what the program is doing at any damn stage of execution :P. You might want to play with it.... and debug and do whatever you want to :D:D


All that I've shown you is the importance of a Backtrace... what exactly it implies and what it has in store of interested parties!!