Segmentation Fault (core dumped) Error

Sun OS 5.8
When below Code excuted,Topic error(Segmentation Faul) occured.The below code function is transfer local file to Sever.

pc -c /export/home/vpoint/R-BOX/TEST/wmap1001.dat /INTE1/tester/qcdata/receive/$tcp_name/$S_file_name >>  $HOME/R-BOX/TEST/lotEnd.log

So,How Can I check this problem

@Guchunhui , welcome.

Is this something you have written ?, if yes can you share the program code ?

Well, the usual reason for seg fault is memory access issue.

Has it worked before ?

Does it produce a core file ? , if not set ulimit -c unlimited to do so,
you can then debug that. you may need to compile with debug

do you have any Sun development tools (Sun Studio etc ...)

SunOS 5.8 - how old is that ?

what does the logfile $HOME/R-BOX/TEST/lotEnd.log for this attempt show ?

PS: Learn to use the markdown menu options when posting, differentiate code from prose/text by using the menu options at the top of the dialog box you type into. I'll edit your post this time but going forwards you do the needful when posting.

Thank your confirm very much.
Is this something you have written ?, if yes can you share the program code ?
→No,It's written by ADVANTEST maker,Sun OS 5.8 is very old system and outof service. This code in software is for Factory Line.This code function is transfer Produce data to Server for store.
Well, the usual reason for seg fault is memory access issue.

Has it worked before ?
→In my memory, It had worked for serverl years,And The entire sysytem is imported in 2000 year.And temporary solution is to Reboot PC.

If worked before, what has changed?
Is the system time correct?
You can trace the system calls:
truss -f pc -c ...

Sorry,The former question was answerd below.

Question 1:
Does it produce a core file ? , if not set ulimit -c unlimited to do so,you can then debug that. you may need to compile with debug

Answer 1:
I'm the beginner in UNIX.I do not know the meaning of 【Does it produce a core file】。But I input command [ulimit -a],and the result is [core dump=Ulimted] <コアダンプ(ブロック) 制限なし>
SunOS 5.8 - how old is that ?
→The below is the result of command [showrev]

Hostname: RSCM15
Hostid: 73785C45
Release: 5.8
Kernel architecture: sun4u
Application architecture: sparc
Hardware provider: Sun_Microsystems
Domain: none
Kernel version: SunOS 5.8 Generic 117350-27 Aug 2005

Question2:
what does the logfile $HOME/R-BOX/TEST/lotEnd.log for this attempt show ?

Answer 2:
The below code function is upload produce data file[wmap1001.dat] to Server.Will network problem
cause this error to occur?
<code_start>
pc -c /export/home/vpoint/R-BOX/TEST/wmap1001.dat /INTE1/tester/qcdata/receive/$tcp_name/$S_file_name >> $HOME/R-BOX/TEST/lotEnd.log
if ($status != 0) then
\echo "Error: [Integrator QC data send6 ]"
##goto ERR110
endif
<code_end>

[Integrator QC data send6 ] and [ [Segmentation Fault] error happend at the same time .
Below is error info
<info_start>
Segmentation Fault (core dumped) Error: [Integrator QC data send6 ]
<info_end>

Question 3:
If worked before, what has changed?
Is the system time correct?
You can trace the system calls:

Answer 3:
Sorry,I have no impression about it,Could you teach me how to use truss -f commnd. [pc] is a script file.

A core dump is a file named core
It can be loaded in a debugger, often it is sent to the developer.

If pc is a script then examine it with the file command.

which pc
file /path/to/pc

Say the script interpreter is bash,
then you can run it as

bash pc ...

and through truss

truss -f bash pc ...

@Guchunhui , can you show the contents of the pc command file?

as teammate @MadeInGermany says, show results of

  • file /path/to/pc
    or if you have issues with that try
  • file $(which pc)

the outcome will determine if the file is 'human readable' or not , typically if readably by humans it will mention 'ASCII' somewhere in the output, just copy/paste the output of either of those commands and post, we can suggest next steps.

@MadeInGermany Also thank you.

Question 1:
can you show the contents of the pc command file?

Answer 1:
Because I am a new ueser,Can't use Upload function,The below is entire code, and the file permission is rwxrwxrwx
By the way,I should describe the error phenomenon.
Just sometimes occur,not always. The temporay solution is reboot PC

Question 2:
truss -f bash pc ...

Answer 2:
When error occur,I input truss -f bash pc ...? or Before error occur,I input truss -f command.Also I look up the truss command,It's trace of the system calls.
Besides,It return 'command not found' when I input 'bash' command

#! /bin/sh
#**************************************************************************
#**  This file Permission:[-rwsrwsrwx]
#**            Owner:tester
#**            Group:120
#**************************************************************************
#**    STEP     Local     Programmer       DATE        Comment
#**           Revision
#**     1.0       1.0     H.Ishii (AKS)    1995/09/??  master up
#**     2.0       2.0     H.Ishii (AKS)    1996/02/19  ????????????
#**     2.2       2.2     H.Ishii (AKS)    1996/05/30  out adstat.asc
#**   DCS-FA40    2.3                      2001/02/10  add display version or information
#**   T6557-STEP2 L002    M.nakamura(SIC)  2005/11/22  T6575 STEP2 RENESAS KUMAMOTO STEP2
#**
#*************************************************************************/
#########################################################
##     display version or information
#########################################################
if    test $# -lt 1;  # ー惞ャ、ハ、、セ・遉ホス靉
then
        echo "$0 Version L002 ( System : T6575 STEP2 )"              
        echo "Useag :% $0  <tester QC data file> <integrator QC data file>"
        exit 0
fi
if [ "$1" = "-h" ]; then
        echo "$0 Version L002 ( System : T6575 STEP2 )"                  
        echo "Useag :% $0  <tester QC data file> <integrator QC data file>"
	exit 0
fi
if [ "$1" = "-v" ]; then
        echo "$0 Version L002 ( System : T6575 STEP2 )"                   
	exit 0
fi
#########################################################
##     Function
#########################################################

OFILE=adstat.asc

#########################################################
##   Debug option / Copy the QC DATA file to INTGRATOR
##
##if [ "$event_flg" = "ON" ]; then
  if [ `pcr -n QCDATA_TRANS` = "ON" ]; then
   if [ "$1" = "-c" ]; then
      	   cp $2 $3
	   if [ $? = 0 ];
	   then
	     echo "PC:SUCCESS" > $OFILE
	     exit 0 
	   else
	     echo "PC:UNSUCCESS" > $OFILE
	     exit 1
	   fi
   fi
else 
   echo "pc       :TSETUP QCDATA_TRANS is OFF = Stand Alone setting."
   exit 0
fi

#########################################################
##   Transfer the QC DATA file to INTGRATOR
##
   mv $1 $2
   if [ $? = 0 ];
   then
     echo "PC:SUCCESS" > $OFILE
     exit 0 
   else
     echo "PC:UNSUCCESS" > $OFILE
     exit 1
   fi