segmentation fault vs page fault

后端 未结 2 1153
伪装坚强ぢ
伪装坚强ぢ 2020-12-23 12:20
  1. I was wondering what differences and relations are between segmentation fault and page fault?

  2. Does segmentation fault only belong to segmented memor

2条回答
  •  生来不讨喜
    2020-12-23 12:30

    Segmentation faults occur when the memory is not allowed to be accessed (does not exist, or is forbidden). Most frequently they occur when you dereference a null variable or run off the end of an array. Page faults occur when memory that is mapped but not loaded is accessed. They are not errors, and signal to the operating system that it should load the appropriate page into memory.

提交回复
热议问题