Sponsored Content
Full Discussion: pstack file analysis
Operating Systems Solaris pstack file analysis Post 302556035 by DGPickett on Friday 16th of September 2011 11:23:15 AM
Old 09-16-2011
This is a basic one. Adding gdb or dbx to it requires taking the find output and the $PATH expected or extracted from the core to find the executable. One nice trick with a core file is to run it through 'strings' or 'cat -v' and look for the environment, usually near the end and in ASCII: PATH=.... Using gdb for where (stack trace) solved licensing issues (dbx only ran on dev boxes).
Code:
$ cat bin/coremail
#!/usr/bin/ksh
if [ $# = 0 ]
then
 echo "Usage: ${0##*/} <email_addr_list>" >&2
 exit 1
fi
(
 touch ~/.core_mail.mark.new
 if [ -f ~/.core_mail.mark ]
 then
  find / -name core -type f -newer ~/.core_mail.mark
 else
  echo "No ~/.core_mail.mark, all core files included." >&2
  find / -name core -type f
 fi 2>/dev/null | while read l
 do
  date "+%Y-%m-%d %H:%M:%S ($$) Processing: $l"
  (
   echo "Core file found: $l"
   echo
   ls -l "$l"
   echo
   if [ -r "$l" -a -s "$l" ]
   then
    file "$l" | tee /dev/stderr |read zexe
    echo
    zexe="${zexe#*'}"
    zexe="${zexe%'*}"
    if [ "$zexe" != "" ]
    then
      echo ========== strings with $zexe in $l =========
      strings "$l" | fgrep "$zexe"
      echo
    fi
    export zsn=/tmp/core_found_$(date "+%Y-%m-%d_%H:%M:%S").gz
    echo "Saving gzip'd copy to: $zsn"
    echo
    (
     while [ "$(/usr/sbin/fuser "$l" 2>/dev/null)" != "" ]
     do
      sleep 1
     done
     umask 077
     gzip -7 <"$l" >$zsn
     )&
   fi
   ) 2>&1 |tee /dev/stderr|mailx -s core_mail.`date "+%Y-%m-%d_%H:%M:%S"` $@ &
  sleep 2
  date "+%Y-%m-%d %H:%M:%S ($$) Finished $l"
  echo
 done
 mv -f ~/.core_mail.mark.new ~/.core_mail.mark
 )>>/tmp/core_mail_$(date '+%Y%m%d').log 2>&1

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

core file analysis

Hi folks, I'm hoping someone would be charitable enough to give me a quick explanation of adb usage for analyzing core files...or point me in the right direction. A search here revealed scant results and web searches are providing me with ambiguous information. Running Solaris. Thanks,... (1 Reply)
Discussion started by: kristy
1 Replies

2. UNIX for Advanced & Expert Users

Core Dump Analysis Using PStack and PMAP

Hello, I'm new to the group and this is my first post. I'm hoping someone can help me out. I have a core dump that I need to analyze from a Unix box and I've never done this sort of thing before. I was told to run a pmap and pstack on the core file which provided two different output files. ... (3 Replies)
Discussion started by: kimblebee
3 Replies

3. Solaris

pstack usage on Solaris 9

Hello everyone, I have a 12-thread application running on Solaris 9. When I use the pstack command after a typical core dump, it prints the stack output of all 12 threads/lwps. This is the standard procedure as it is described in the Solaris MAN pages. Is there a way to filter out the... (1 Reply)
Discussion started by: gregb32
1 Replies

4. Shell Programming and Scripting

text file analysis

Hello, I have a text file containin 4 lines which are repeated along the file, ie the file looks like this: 16:20:12.060769 blablabla 40 16:20:12.093199 blablabla 640 16:20:12.209003 blablabla 640 16:20:12.273179 blablabla 216 16:20:27.217444 blablabla 40 16:20:27.235410 blablabla 640... (2 Replies)
Discussion started by: Celine19
2 Replies

5. Red Hat

pfiles and pstack and ptree

Can someone tell me the Linux equivalent for pstack and pfiles and ptree which are Solaris commands. (1 Reply)
Discussion started by: bdsffl
1 Replies

6. Solaris

Core file analysis

How can we analyze a core file and determine why it was generated on a solaris system? I know file core filename will tell us what program generated the file. But, what to do next to get more details? Thanks, (5 Replies)
Discussion started by: Pouchie1
5 Replies

7. Shell Programming and Scripting

Log File Analysis

Hi All, Given a list of date and time, how can i split them in intervals of 1 hour. The input file is listed as below f.e.: 16-OCT-2009 09:11:47 10.65.4.24. . . (1 Reply)
Discussion started by: x-plicit78
1 Replies

8. UNIX for Advanced & Expert Users

analyse core file using pmap and pstack

Dear All, I am new to this forum. This is my first. I am facing customer issue. Customer has got core file while running the server. He had sent core file and details from pstack, pmap and pldd commands. I have to debug this application, please help me to fix this issue. I am using sparc... (1 Reply)
Discussion started by: KiranBangalore
1 Replies

9. Solaris

analyse core file using pmap and pstack

Dear All, I am new to this forum. This is my first. I am facing customer issue. Customer has got core file while running the server. He had sent core file and details from pstack, pmap and pldd commands. I have to debug this application, please help me to fix this issue. I am using sparc 10... (4 Replies)
Discussion started by: KiranBangalore
4 Replies

10. Ubuntu

pstack missing from Ubuntu 10.10

Hi All I would like to use the tool "pstack" to get a sample of the stack trace for a process. As far as I understood It seems widely available in all Linux systems, but it is not in Ubuntu 10.10. I tried using apt-get as per some posts in few forum, but it cannot be found in the APT... (9 Replies)
Discussion started by: manustone
9 Replies
echo(3XCURSES)						  X/Open Curses Library Functions					    echo(3XCURSES)

NAME
echo, noecho - enable/disable terminal echo SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int echo(void); int noecho(void); DESCRIPTION
The echo() function enables Echo mode for the current screen. The noecho() function disables Echo mode for the current screen. Initially, curses software echo mode is enabled and hardware echo mode of the tty driver is disabled. The echo() and noecho() functions control soft- ware echo only. Hardware echo must remain disabled for the duration of the application, else the behavior is undefined. RETURN VALUES
Upon successful completion, these functions return OK. Otherwise, they return ERR. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
getch(3XCURSES), getstr(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), scanw(3XCURSES), attributes(5), standards(5) SunOS 5.11 5 Jun 2002 echo(3XCURSES)
All times are GMT -4. The time now is 07:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy