什么是例外,code中的含义; EXC_I386_GPFLT"? [英] What's the meaning of exception code "EXC_I386_GPFLT"?

查看:155
本文介绍了什么是例外,code中的含义; EXC_I386_GPFLT"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是例外,code的含义 EXC_I386_GPFLT

What's the meaning of exception code EXC_I386_GPFLT?

请问其含义根据不同的情况呢?

Does its meaning vary according to the situation?

在这种情况下,我指的是异常类型 EXC_BAD_ACCESS 与例外code EXC_I386_GPFLT

In that case, I'm referring to exception type EXC_BAD_ACCESS with exception code EXC_I386_GPFLT

该计划是指X code 5.0.1开发,处理 cblas_zgemm()的BLAS库。(嗯,我想这并不重要...)

The program is developed in Xcode 5.0.1, dealing with cblas_zgemm() of the BLAS library.(Well, I guess it doesn't matter...)

非常感谢你!

推荐答案

EXC_I386_GPFLT被肯定指的是一般保护故障,这是x86的方式告诉你说:你做的东西,你不能做。它通常并不意味着你访问了内存边界,但它可能是你的code会出界,造成不良code /数据的方式,使一个保护冲突中使用的某种形式。

EXC_I386_GPFLT is surely referring to "General Protection fault", which is the x86's way to tell you that "you did something that you are not allowed to do". It typically DOESN'T mean that you access out of memory bounds, but it could be that your code is going out of bounds and causing bad code/data to be used in a way that makes for an protection violation of some sort.

不幸的是它可以是很难搞清楚的问题是,到底是什么没有更多的情况下,有从2005年我的AMD64程序员手册,第2卷中列出的27种不同的原因 - 所有帐户,它很可能有8年后,将有增加了一些。

Unfortunately it can be hard to figure out exactly what the problem is without more context, there are 27 different causes listed in my AMD64 Programmer's Manual, Vol 2 from 2005 - by all accounts, it is likely that 8 years later would have added a few more.

如果这是一个64位的系统中,可能的情形是,你的code为用一个非规范的指针 - 这意味着一个64位的地址以这样的方式形成的高16位地址不是低48位的顶部的所有副本(换言之,地址的高16位应全部为0或全部为1的基础上,位略低于16位)。这条规则是保证该架构可以安全地扩大有效位的地址范围内的号码。这表明了code要么覆盖与其他一些东西指针数据,或读一些指针的值时,将出界。

If it is a 64-bit system, a plausible scenario is that your code is using a "non-canonical pointer" - meaning that a 64-bit address is formed in such a way that the upper 16 bits of the address aren't all copies of the top of the lower 48 bits (in other words, the top 16 bits of an address should all be 0 or all 1, based on the bit just below 16 bits). This rule is in place to guarantee that the architecture can "safely expand the number of valid bits in the address range". This would indicate that the code is either overwriting some pointer data with other stuff, or going out of bounds when reading some pointer value.

另一个可能的原因是与SSE寄存器对齐访问 - 换句话说,读一个16字节的SSE从不是16字节对齐的地址寄存器。

Another likely causes is unaligned access with an SSE register - in other word, reading a 16-byte SSE register from an address that isn't 16-byte aligned.

有,正如我所说,许多其他可能的原因,但其中大部分都涉及东西,正常的code将不会在32位或64位操作系统做(如用装载段寄存器无效的选择索引或书面MSR的(型号专用寄存器))。

There are, as I said, many other possible reasons, but most of those involve things that "normal" code wouldn't be doing in a 32- or 64-bit OS (such as loading segment registers with invalid selector index or writing to MSR's (model specific registers)).

这篇关于什么是例外,code中的含义; EXC_I386_GPFLT"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆