From: Carlo Florendo <subscribermail@gmail.com>
To: "Ravinandan Arakali (rarakali)" <rarakali@cisco.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Question about core file generation
Date: Thu, 26 Jul 2007 10:38:48 +0800 [thread overview]
Message-ID: <46A80937.1040608@gmail.com> (raw)
In-Reply-To: <FA6FB5FA4DA6BF4386D129273B2E3EC3024B80E8@xmb-sjc-214.amer.cisco.com>
Ravinandan Arakali (rarakali) wrote:
> Hi,
> When a process dumps core, the do_coredump() initiates the core
> file generation. Is this operation synchronous(does the kernel
> wait for core to be completely written to disk) ?
The operations whereby
(1) a process is in the process of exiting while;
(2) the kernel is doing a coredump
is asynchronous with respect to each other, since the process could have
received an abort signal while the the kernel initiated the core dump.
> Basically, if I have the parent process waiting for exit of
> child which dumped core, can the parent access the core immediately
> on receipt of "child exit" message ? Is it possible that the
> core is still in the process of being written ? If so, what's
> the event the parent needs to wait for to be assured of a complete
> core.
When a child exits, check if the core dump file is still opened by a handle
(HINT: lsof).
AFAICS from the kernel code, the core dump data or file routine is mutexed
to ensure that there is only one process handling the core dump file.
You could check if there are still open file handles on the dump. If there
are none, it means that the dump had been completed.
HTH.
Best Regards,
Carlo
--
Carlo Florendo
Softare Engineer/Network Co-Administrator
Astra Philippines Inc.
UP-Ayala Technopark, Diliman 1101, Quezon City
Philippines
http://www.astra.ph
--
The Astra Group of Companies
5-3-11 Sekido, Tama City
Tokyo 206-0011, Japan
http://www.astra.co.jp
prev parent reply other threads:[~2007-07-26 2:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-24 15:39 Question about core file generation Ravinandan Arakali (rarakali)
2007-07-26 2:38 ` Carlo Florendo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46A80937.1040608@gmail.com \
--to=subscribermail@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rarakali@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox