P*t
2 楼
产生segmentation fault的具体过程是怎样的?
比如是在OS发现要访问virutal memory address为0就报seg fault,
还是会进行到访问页表获取到physical memory address并访问才会报?
比如是在OS发现要访问virutal memory address为0就报seg fault,
还是会进行到访问页表获取到physical memory address并访问才会报?
p*g
4 楼
Linux的gdt表的第一项就是给这个准备的
从书里抄了这么一段
The first entry of the GDT is always set to 0. This ensures the logic
address with a null Segment Selector will be considered invalid, thus
causing a processor exception.
呵呵,要不怎么叫segmentation fault呢
从书里抄了这么一段
The first entry of the GDT is always set to 0. This ensures the logic
address with a null Segment Selector will be considered invalid, thus
causing a processor exception.
呵呵,要不怎么叫segmentation fault呢
p*g
6 楼
至于说linux怎么handle这个exception,就是另外一个topic了
t*t
8 楼
目前几乎所有的32位OS在应用级都是flat memory model, 不怎么用段寄存器的. 所有
的段都是base 0, size=4G.
所以0指针是DS:0, 不是0:0, 跟GDT第一项没关系.
【在 p**********g 的大作中提到】
: Linux的gdt表的第一项就是给这个准备的
: 从书里抄了这么一段
: The first entry of the GDT is always set to 0. This ensures the logic
: address with a null Segment Selector will be considered invalid, thus
: causing a processor exception.
: 呵呵,要不怎么叫segmentation fault呢
的段都是base 0, size=4G.
所以0指针是DS:0, 不是0:0, 跟GDT第一项没关系.
【在 p**********g 的大作中提到】
: Linux的gdt表的第一项就是给这个准备的
: 从书里抄了这么一段
: The first entry of the GDT is always set to 0. This ensures the logic
: address with a null Segment Selector will be considered invalid, thus
: causing a processor exception.
: 呵呵,要不怎么叫segmentation fault呢
p*g
10 楼
"segmentation fault"是说段错误,说和段映射没有关系似乎说不过去?不过段映射一
般是intel上的。
应用根本看不到内存管理的映射(segment or paging),不过确实有很多不用段映射的
,比如arm,不过没有具体看过linux在arm上的实现以及这个"segmentation fault"
我找找看
般是intel上的。
应用根本看不到内存管理的映射(segment or paging),不过确实有很多不用段映射的
,比如arm,不过没有具体看过linux在arm上的实现以及这个"segmentation fault"
我找找看
D*a
12 楼
this is about null segment selector, not null pointer.
segmentation fault is generally caused by accessing non-existant memory or
denied access.
【在 p**********g 的大作中提到】
: Linux的gdt表的第一项就是给这个准备的
: 从书里抄了这么一段
: The first entry of the GDT is always set to 0. This ensures the logic
: address with a null Segment Selector will be considered invalid, thus
: causing a processor exception.
: 呵呵,要不怎么叫segmentation fault呢
segmentation fault is generally caused by accessing non-existant memory or
denied access.
【在 p**********g 的大作中提到】
: Linux的gdt表的第一项就是给这个准备的
: 从书里抄了这么一段
: The first entry of the GDT is always set to 0. This ensures the logic
: address with a null Segment Selector will be considered invalid, thus
: causing a processor exception.
: 呵呵,要不怎么叫segmentation fault呢
m*e
14 楼
If you really want to know how Linux virtual memory management works, dive
into copy-on-write.
Last time I looked into it, I found a bug. :-)
【在 p**********g 的大作中提到】
: "segmentation fault"是说段错误,说和段映射没有关系似乎说不过去?不过段映射一
: 般是intel上的。
: 应用根本看不到内存管理的映射(segment or paging),不过确实有很多不用段映射的
: ,比如arm,不过没有具体看过linux在arm上的实现以及这个"segmentation fault"
: 我找找看
into copy-on-write.
Last time I looked into it, I found a bug. :-)
【在 p**********g 的大作中提到】
: "segmentation fault"是说段错误,说和段映射没有关系似乎说不过去?不过段映射一
: 般是intel上的。
: 应用根本看不到内存管理的映射(segment or paging),不过确实有很多不用段映射的
: ,比如arm,不过没有具体看过linux在arm上的实现以及这个"segmentation fault"
: 我找找看
相关阅读
搞AI的都是一窝蜂, 都不知道其本质的东西百度因误导推广屡屡道歉 “挤牙膏式”整改何时休数据库里的B+树为啥要用个指针把最底层的相邻叶节点连起来?估计我也要回国了人民日报欢迎Google回归, 百度: 我们有信心再赢一次!who is Chris Lu?EVGA Nvidia 1080 GTX = 429该怎么推导下面算法时间复杂度O(N!*N)的*N?顺风车司机暗中直播女乘客:言语骚扰 弹幕下流java的AspectOrientedPrograming 就是屎为啥我的浏览器看不了论坛里的图片!!!请教一下各位马工怎么多数据库的备份 (转载)牛人恒牛请问一个C++调用Python的问题一个印度人小公司样本网易云音乐的这个测试这两天刷爆了我的朋友圈魏老师你的瓷砖算法有人写了pytorch啥时候出1.0?库存管理是用数据库还是缓存类的其它记录方式比较好?现在机器学习的都用什么语言了