Re: core dump file size exceeds limit with ulimit -f unlimited.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 28, 2009 at 8:03 PM, Anuz Pratap Singh
Tomar<chambilkethakur@xxxxxxxxx> wrote:
> Hi,
> here is some more info, i have discovered:
>
> In fs/binfmt_elf, function elf_core_dump() takes care of core dump file
> generation
> The variable  unsigned long limit =
> current->signal->rlim[RLIMIT_CORE].rlim_cur;
> has limit either for filesize and/or corefile size(I am not sure of this,
> however).
> This particular code writes to dump file:
>
> if ((size += PAGE_SIZE) > limit || !dump_write(file, kaddr, PAGE_SIZE)) {
>                                                 kunmap(page);
>                                                 page_cache_release(page);
>                                                 goto end_coredump;
>                                         }
>
> The above loops from vma->vm_start to vma->vm_end
> where vm = current->mm->mmap
>
> What i am here confused is what value does rlim_current have, is it the one
> with "-c" (core file size)option of one with "-f"(file size) option?
>
> As I understand, it must be one with "-f" option, in that case, what does
> "-c" sets for current process?

I think -c here refers to rlim[RLIMIT_CORE].rlim_cur.

Anyway, I see codes like:
#ifdef ELF_CORE_EXTRA_PHDRS
        segs += ELF_CORE_EXTRA_PHDRS;
#endif

Perhaps, this kind of codes that increase the size of core dump file.

IMO, what we refer as core dump is actually "dump of proces's memory
content, either entirely or some part of them". But, when it comes to
the form of file, it must be formed into ELF... thus we add headers.

Again, I haven't checked the code very thoroughly, hopefully it could
give you another clues.


-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux