【漏洞类型】segfaut的Wiki百科解释

Wiki百科原文

In computing, a segmentation fault (often shortened to segfault) or access violation is a fault, or failure condition, raised by hardware with memory protection, notifying an operating system (OS) the software has attempted to access a restricted area of memory (a memory access violation). On standard x86 computers, this is a form of general protection fault. The operating system kernel will, in response, usually perform some corrective action, generally passing the fault on to the offending process by sending the process a signal. Processes can in some cases install a custom signal handler, allowing them to recover on their own,[1] but otherwise the OS default signal handler is used, generally causing abnormal termination of the process (a program crash), and sometimes a core dump.

Segmentation faults are a common class of error in programs written in languages like C that provide low-level memory access and few to no safety checks. They arise primarily due to errors in use of pointers for virtual memory addressing, particularly illegal access. Another type of memory access error is a bus error, which also has various causes, but is today much rarer; these occur primarily due to incorrect physical memory addressing, or due to misaligned memory access – these are memory references that the hardware cannot address, rather than references that a process is not allowed to address.

Many programming languages may employ mechanisms designed to avoid segmentation faults and improve memory safety. For example, Rust employs an ownership-based[2] model to ensure memory safety.[3] Other languages, such as Lisp and Java, employ garbage collection,[4] which avoids certain classes of memory errors that could lead to segmentation faults.[5]

译文

在计算机中,段错误(Segmentation fault,常简称为segfault)或访问冲突(Access Violation)是一种故障或失败状态,由具有内存保护功能的硬件引发,通知操作系统软件试图访问受限内存区域(内存访问冲突)。在标准的x86计算机上,这是一种常见的一般保护错误。操作系统内核通常会采取一些纠正措施,通常通过发送信号将故障传递给有问题的进程。在某些情况下,进程可以安装自定义信号处理程序,使它们自己恢复,否则将使用操作系统默认信号处理程序,通常导致进程异常终止(程序崩溃),有时会产生核心转储文件。

段错误是在使用提供低级内存访问和少量或没有安全检查的语言(如C)编写的程序中常见的错误类。它们主要由于指针在虚拟内存寻址中的错误使用导致,特别是非法访问。另一种内存访问错误是总线错误(Bus error),也有各种原因,但今天很少见;主要由于物理内存寻址错误或由于不对齐的内存访问而发生-这些是硬件无法寻址的内存引用,而不是进程不允许访问的引用。

许多编程语言可能会采用旨在避免段错误并提高内存安全性的机制。例如,Rust采用基于所有权的模型来确保内存安全。其他语言,如Lisp和Java,采用垃圾回收机制,避免了可能导致段错误的某些内存错误。

其它链接

https://www.cnblogs.com/wpgraceii/p/10622582.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值