Wednesday, October 31, 2012

Genrating a stack from core dumps in unix and linux




Follow the instructions below in order:
1.      Check if you have a core file, we may find in cdump or bdump/trace or bdump or cluster log locations.
2.      Log into the user (the user need to be the owner of the core file) Then issue
               file <CORE_FILENAME>
The above output gives more info like from which executable (program) the core generated and other.
3.      Log into the user (owner of the program). Go to ORACLE_HOME/bin or GRID_HOME/bin, then issue
                file <Program>
Note: if possible give read permission to the program  (optional)
                chmod a+r <program>

4.      Then log in as the user who encountered the error and use commands to show a symbolic stack trace.
  Common Debuggers and commands to show a symbolic stack trace:

Example commands:


For example program would be sqlplus
                DBX:       
                            $ script /tmp/mystack                    --- file name where the stack info writes
                            $ dbx $ORACLE_HOME/bin/sqlplus core
                            (dbx) where
                            ...                 << Stack should appear here
                            (dbx) quit
                            $ exit

                XDB:       
                            $ script /tmp/mystack                    --- file name where the stack info writes
                            $ xdb $ORACLE_HOME/bin/sqlplus core
                            (xdb) t    
                            ...                 << Stack should appear here
                            (xdb) quit
                            $ exit

                SDB:       
                            $ script /tmp/mystack                    --- file name where the stack info writes
                            $ sdb $ORACLE_HOME/bin/ sqlplus core
                            (sdb) t     
                            ...                 << Stack should appear here
                            (sdb) q
                            $ exit

                                (NOTE: In the 'adb' commands below literally type the $c & $q)
                ADB:       
                            $ script /tmp/mystack                    --- file name where the stack info writes
                            $ adb $ORACLE_HOME/bin/ sqlplus core
                            $c      << NB: adb has no prompt so just enter $c
                            ...                 
                             $q
                            $ exit

                DEBUG:     
                            $ script /tmp/mystack                    --- file name where the stack info writes
                            $ debug -c core $ORACLE_HOME/bin/sqlplus
                            debug> stack
                            ...                 << Stack should appear here
                            debug> quit
                            $ exit

                GDB:       
                            $ script /tmp/mystack                    --- file name where the stack info writes
                            $ gdb $ORACLE_HOME/bin/sqlplus core
                            (gdb) bt
                            ...                 << Stack should appear here
                            (gdb) thread apply all where
                            ...                 << Stacks for all threads here
                            (gdb) quit
                            $ exit

                DDE:      
                            $ script /tmp/mystack                    --- file name where the stack info writes
                            $ dde -ui line core $ORACLE_HOME/bin/sqlplus
                            dde> bt
                            ...
                            dde> q
                            $exit

                PSTACK:    
                            $ script /tmp/mystack                    --- file name where the stack info writes
                            $ pstack core
                            $ exit

Upload the mystack file to Oracle Support.
Ref: Getting a Stack Trace from a CORE file on UNIX [ID 1812.1]

2 comments: