由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - [转载] waitpid 一问
相关主题
关于一个C++library的连接[转载] 为什么会在调用malloc时Segmentation fault?
简单问题,可我不会。:( 急用啊!大侠帮忙看一下!
how to fork a subroutine in unix?core dump
各位大哥帮忙,EXECVE()的使用how to track page faults when allocation
fork() and execve() in UnixSIGSEGV,Segmentation fault in Cygwin
"fork" program question..cshrc?.login?.profile?
菜鸟一问help need for a make question (simple one)
Re: how to record the process end time in a child process and obtain ihelp: how to know the pid of prog started by rsh
相关话题的讨论汇总
话题: waitpid话题: pid话题: parent话题: prog话题: generates
进入Unix版参与讨论
1 (共1页)
z*y
发帖数: 1311
1
【 以下文字转载自 Programming 讨论区 】
【 原文由 zyy 所发表 】
For programming experts, please check the following code.
pid = fork() ;
if (pid == 0) {
exec("error_prog") ;
}
else {
waitpid(pid, ....) ;
}
The child process executes "error_prog" which later generates SIGSEGV. The
signal can be caught by the parent. However, is it possible for the parent to
know the address of the instruction of the child program that generates the
fault? If so, how?
Thanks.
p****k
发帖数: 130
2
If the child aborted after SIGSEGV, how about let the parent
launch gdb on the core (assume it is there) and do a little
analysis?:)
Seriously, is there any particular reason u want to get
the instruction address while the parent is running?

【在 z*y 的大作中提到】
: 【 以下文字转载自 Programming 讨论区 】
: 【 原文由 zyy 所发表 】
: For programming experts, please check the following code.
: pid = fork() ;
: if (pid == 0) {
: exec("error_prog") ;
: }
: else {
: waitpid(pid, ....) ;
: }

1 (共1页)
进入Unix版参与讨论
相关主题
help: how to know the pid of prog started by rshfork() and execve() in Unix
奇怪问题一个"fork" program question.
autoconf problems菜鸟一问
问题找到了,但是不知道怎么解决, 请帮忙[转载] Cygwin问题请教Re: how to record the process end time in a child process and obtain i
关于一个C++library的连接[转载] 为什么会在调用malloc时Segmentation fault?
简单问题,可我不会。:( 急用啊!大侠帮忙看一下!
how to fork a subroutine in unix?core dump
各位大哥帮忙,EXECVE()的使用how to track page faults when allocation
相关话题的讨论汇总
话题: waitpid话题: pid话题: parent话题: prog话题: generates