Steps to get the backtrace from the core file with the corrupted stack.

1. Run the gdb with the core file

2. execute 'x /512xg $sp'

3. Capture all the output into 1.txt file.

4. Copy the  into folder which has 1.txt file.

5. Run the script. It would generate the 2.txt file

6. Open the 2.txt.

7. Copy the 20 lines from the file and execute those in the gdb console.

8. Repeat the step 7 for all the lines in 2.txt.

It will give the backtrace from the core. --->

cat 1.txt | awk '/:/ {print $2 "\n" $3}' | sort | grep -v "0x00000000000*" | grep -v "0xff*" |awk '/0x/ {print "info line * " $0}' > 2.txt