Saturday 15 June 2013

c - Segmentation fault in 64-bit AMD64 mode -



c - Segmentation fault in 64-bit AMD64 mode -

i'm trying understand next paradox:

i'm running programme in 64-bit linux. programme runs in 64-bit mode (submode of amd64's long mode), right? mode has no segmentation, has paging. why code below generates segmentation fault?

int main() { int* ptr = (int*)0xabcdabcdabcd; *ptr = 10; homecoming 0; }

it's called segmentation fault irrespective of underlying paging technology. means (usually) you've tried access memory outside bounds of waht you're permitted (your segment), have been called block, chunk, section, memlim, xyzzy, plugh, or any term really.

it's much same when null pointer exception in java despite fact there no "pointers" in language :-)

the signal indicating in unix (sigsegv) around long before intel gave segmented architecture of original x86 chips.

c segmentation-fault 64bit

No comments:

Post a Comment