Why does apache hold offsets in memory where php-cli contains virtual memory addresses?

I am debugging php. When I look at a place in memory where I know a pointer to an address, I see a pointer - for example, 22810408 (0x08048122) - this is when the CLI version for PHP is used.

HOWEVER, when I use apache2 and try to do the same, I do not see a pointer to the real address. Instead, I see an offset from the ELF header, which when added to the address of the ELF header gives me a "real" address. For example, if the "real" address was 0x08048122, and the ELF header was at 0x08048000, then I would see 22010000 (0x122) in the same position.

The problem arises when I try to figure out the "real" address of what is on the stack. The "real" address should be 0xbfccxxxx, but when adding the number that I find in the ELF header, it just doesn't add up! I get all the wrong addresses.

I've tried playing for a long time, but I'm really not sure how to say it or what to look for.

So, what I'm mostly looking for is more information about WHY. Apache has an offset instead of a real memory address, and how it all relates to addresses on the stack. Can someone give me any guidance on material that might clarify?

+5
source share
1 answer

Apache mod_php, (.so). . mod_php?. PHP-CLI API zend ( php).

mod_php " " zend API PHP apache. . , apache PHP .

PHP , , ; PHP datatypes 1:1 C (- PHP), C.

PHP PHP-.

+2

All Articles