Re: Program to convert core file to executable.

From: vamsi krishna
Date: Wed May 24 2006 - 16:05:23 EST


Hello Daniel,

Look at the program headers. Many of them probably have a file size of

I checked the PHDRS (readelf --segments) the following are the PHDRS
of the core.exe

===============<BEGIN>==================
Elf file type is EXEC (Executable file)
Entry point 0x8048364
There are 11 program headers, starting at offset 52

Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
NOTE 0x000194 0x00000000 0x00000000 0x00a48 0x00000 0
**LOAD 0x001000 0x08048000 0x00000000 0x00000 0x01000 R E 0x1000

LOAD 0x001000 0x08049000 0x00000000 0x01000 0x01000 RWE 0x1000
LOAD 0x002000 0xf649b000 0x00000000 0x01000 0x01000 RWE 0x1000
**LOAD 0x003000 0xf649c000 0x00000000 0x00000 0x132000 R E 0x1000
LOAD 0x003000 0xf65ce000 0x00000000 0x03000 0x03000 RWE 0x1000
LOAD 0x006000 0xf65d1000 0x00000000 0x03000 0x03000 RWE 0x1000
LOAD 0x009000 0xf65e8000 0x00000000 0x01000 0x01000 RWE 0x1000
**LOAD 0x00a000 0xf65e9000 0x00000000 0x00000 0x15000 R E 0x1000
LOAD 0x00a000 0xf65fe000 0x00000000 0x01000 0x01000 RWE 0x1000
LOAD 0x00b000 0xfeffe000 0x00000000 0x02000 0x02000 RWE 0x1000
======================<END>=============

o As you said I see some of the PHDRS are having FileSiz as zero, the
first (1st **ed ) PHDR which is having virtual address 0x08048000
(this is obviously) the start of the text of the program, and its not
having any memory in the core file.

o Does the other PHDRS for which FileSiz is zero correspond to the
dynamic shared objects (.so) text ?? example in the above we see (2
**ed ) PHDR with VirtAddr as 0xf649c000 , so this means the text of
some shared .so has been mapped here right?

o I have question about the memory mapping with permissions r--s or
r--p (gconv used by glibc gets mapped like this some time) , so does
the core file contains this information of the memory mappings?

o Is there a way I can findout the standard which the OS follows to
write the core file?

o Rather than depending on the OS core file, hows your opinion on
writing out all the mappings form /proc/<pid>/maps as PT_LOAD into a
elf formatted file of type ET_EXEC, do you think this works? rather
than converting core file to exe?


Of course, the kernel shouldn't crash! It sounds like a bug.


Yes I can reproduce this , is there a bugzilla for kernel? (or should
we report this at the buzilla of the distribution?)

Thank you,
Vamsi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/