热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

分割错误:11在OSX。-Segmentationfault:11inOSX

IamgettinganissueinPython3.3.2onOSX10.9whereifIopenPythoninaterminalwindow,itex

I am getting an issue in Python 3.3.2 on OSX 10.9 where if I open Python in a terminal window, it exits with "Segmentation error: 11" after the second line I enter, regardless of what the two commands are. For example, if I enter:

我在osx10.9的Python 3.3.2中遇到了一个问题,如果我在一个终端窗口中打开Python,它会以“分割错误:11”退出,不管这两个命令是什么。例如,如果我输入:

>>> for x in range(1000): print(x)

that works fine, but if I enter:

这很好,但如果我进入:

>>> for x in range(1000):
...     print(x)

then I get the error when I press enter on the second line. I can also run a script with more than 2 lines without any problems.

然后在第二行按enter键时,我就会得到错误。我还可以运行一个包含超过2行的脚本,没有任何问题。

I updated to OSX 10.9 this afternoon, so I suspect that may be it.

我今天下午更新到OSX 10.9,所以我怀疑可能是这样。

However, I just recently installed IPython (along with several other packages) and have been using that the past couple of days, so it could be something else I installed recently. I had a couple unsuccessful attempts at installing PyQt where I ran configure.py but then the "make" command failed, which I was also suspicious of.

然而,我最近安装了IPython(连同其他几个包),并在过去的几天中使用它,所以它可能是我最近安装的其他东西。我在安装PyQt时遇到了一些失败的尝试。py但是“make”命令失败了,这也是我怀疑的。

I tried reinstalling Python, but it didn't resolve the issue. Both IPython and IDLE work with no problems. I'm just concerned about what could be the underlying issue.

我尝试重新安装Python,但它没有解决这个问题。IPython和IDLE工作都没有问题。我只是担心潜在的问题。

Any help is appreciated, thanks in advance.

如有任何帮助,请提前感谢。

4 个解决方案

#1


48  

This is a bug in the readline compatibility in python, related to changes introduced in OSX10.9. This weekend, release candidates for Python2.7.6 and Python3.3.3 were released which fix this bug. The download links are below.

这是python中readline兼容性的一个缺陷,与OSX10.9中引入的更改有关。这个周末,发布了Python2.7.6和Python3.3.3版本的候选版本,修复了这个bug。下载链接在下面。

http://python.org/download/releases/2.7.6/

http://python.org/download/releases/2.7.6/

http://python.org/download/releases/3.3.3/

http://python.org/download/releases/3.3.3/

Here's the issue, quoting from Ned Deily, writing on the python-dev email list.

这里有一个问题,引用Ned Deily的话,写在python-dev的电子邮件列表上。

On Tuesday, Apple released OS X 10.9 (a.k.a. Mavericks). There has already been a lot of interest in it, in part because Apple has made it available for free and has made it easy for users with 10.8, 10.7, and (most) 10.6 systems to upgrade directly to 10.9. Unfortunately, there are issues with our current maintenance releases (3.3.2 and 2.7.5) on OS X 10.9 that call for new maintenance releases as soon as possible.

周二,苹果发布了OS X 10.9(又称Mavericks)。已经有很多人对此感兴趣,部分原因是苹果已经免费提供了它,并使10.8、10.7和(大部分)10.6系统的用户可以轻松地升级到10.9。不幸的是,我们当前的维护版本(3.3.2和2.7.5)在OS X 10.9上有一些问题,要求尽快发布新的维护版本。

One is critical in that it causes the interpreter to crash when running in interactive mode (http://bugs.python.org/issue18458). The problem was due to a long-standing compatibility issue in libedit's readline compatibility layer that upstream has finally fixed and Apple has now shipped in 10.9. Because the python.org installers dynamically link to libedit, the original workaround in readline.c for the original design flaw in history indexing now causes a segfault on 10.9 when the user types in the second command interactively. Not good. Ronald devised a fix that allows readline.so at runtime to detect and work with either version of libedit so that we continue to have binary compatibility across multiple OS X releases. That fix is already out in the 3.4.0 alphas and backported to the 3.3 and 2.7 branches, awaiting release there. Just in the last 12 hours, there have been at least four duplicates of the issue reported by users. I've updated the original issue to explicitly mention 10.9, now that it is no longer under NDA, and to provide a downloadable script for inexperienced users to workaround the problem by "removing" readline.so. Presumably, as word gets out, there will be fewer duplicate issues opened but the impact will remain.

其中一个关键因素是,它会导致解释器在以交互模式运行时崩溃(http://bugs.python.org/e18458)。问题是由于在libedit的readline兼容层中存在一个长期存在的兼容性问题,上游终于修复了,而苹果现在已经在10.9中发布了。因为python.org的安装程序会动态链接到libedit,这是readline中最初的工作。c由于历史索引的原始设计缺陷,在第2个命令的用户类型交互时,导致了10.9的segfault。不好的。罗纳德设计了一个允许readline的修复程序。因此,在运行时,要检测和处理任意版本的libedit,这样我们就可以在多个OS X版本中继续拥有二进制兼容性。这个补丁已经在3.4.0的alphas中,并向后移植到3.3和2.7分支,等待发布。仅在过去的12个小时内,用户报告的问题至少有4个重复。我已经更新了最初的问题,明确地提到了10.9,现在它已经不再属于NDA,并且为没有经验的用户提供了一个可下载的脚本,通过“删除”readline来解决这个问题。据推测,随着消息的传出,将会有更少的重复问题被打开,但影响将会继续存在。

#2


34  

I had this problem after upgrading to OS X 10.9 and used the patch provided on the Python website: http://bugs.python.org/issue18458#msg201087

在升级到OS X 10.9之后,我遇到了这个问题,并使用了Python网站上提供的补丁:http://bugs.python.org/e18458 #msg201087。

To use it, open a terminal session in Terminal.app (or other shell), then enter:

使用它,在终端打开终端会话。app(或其他shell),然后输入:

curl -O http://bugs.python.org/file32324/patch_readline_issue_18458.sh
openssl sha1 patch_readline_issue_18458.sh
# the digest should be 7cb0ff57820a027dd4ca242eb2418930f8f46b4c

then
sh ./patch_readline_issue_18458.sh

然后sh。/ patch_readline_issue_18458.sh

Enter your password, if prompted

输入您的密码,如果提示。

#3


2  

I had this problem. Changing the chunksize in my csv parser to 100 eliminated the error.

我有这个问题。将我的csv解析器中的chunksize改为100消除了错误。

#4


1  

I was encountering similar 'segmentation fault 11' errors but for me it was using mercurial(hg)

我遇到了类似的“分割错误11”错误,但对我来说,它使用的是mercurial(hg)

This was trying to use Python 2.7.8 installed via the .mpkg installer and pip install mercurial On OS X 10.9.5

这是尝试使用Python 2.7.8通过.mpkg安装程序和pip安装mercurial在OS X 10.9.5上安装的。

I thought updating to 2.7.8 would have resolved this but it seemed that mercurial was still looking for the System/Library/Frameworks/Python.framework/Versions/2.7

我认为更新到2.7.8会解决这个问题,但是mercurial似乎仍然在寻找系统/库/框架/ python。

Even after trying to follow this slightly unwise advice Things still weren't working. I would run

即使是在尝试了这个有点不明智的建议之后,事情仍然没有进展。我会跑

hg init
hg add *
hg commit -m ...
hg status

would get 'segmentation fault 11'

会得到"分割错误11 "

The first couple of lines of the stack trace point to this:

堆栈跟踪点的前几行是这样的:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   ???                             000000000000000000 0 + 0
1   osutil.so                       0x00000001095ef768 listdir + 313
2   org.python.python               0x0000000109261b35 PyEval_EvalFrameEx + 14712
3   org.python.python               0x000000010925e093 PyEval_EvalCodeEx + 1641

In the end my solution seems to have come from (re)installing python with homebrew using that to get the 2.7.8 release (as of Dec 2014)

最后,我的解决方案似乎来自于使用homebrew安装python,以获得2.7.8版本(截至2014年12月)

I then reinstalled mercurial with brew install mercurial which seems to have resolved whatever dependencies where causing this. I wish I understood better what was happening with the Seg fault but couldn't get to the bottom of it.

然后我重新安装了mercurial,并安装了mercurial,它似乎解决了导致这个问题的任何依赖关系。我希望我能更好地理解Seg的错误,但却无法弄清它的本质。

The best guess I still have is that mercurial was still referencing the system python despite 2.7.8 being installed properly and usr/local/bin being first in the path

最好的猜测是,mercurial仍然在引用系统python,尽管已经安装了2.7.8,而且usr/local/bin是第一个。

/usr/local/bin:usr/local/git/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:~/Develop:/usr/local/git/bin: No such file or directory

usr/local/git/bin:/Library/框架/Python.framework/版本/2.7/bin:/ usr/bin:/ usr/bin:/ usr/sbin:/ usr/sbin:/ usr/sbin:/ usr/sbin:/ usr/sbin:/ usr/sbin:/ usr/sbin:/ usr/sbin:/ usr/sbin:/ usr/sbin:/ usr/sbin:/ usr/sbin:/ usr/sbin:/ usr/本地/git/bin:没有这样的文件或目录。

So, what I'm suggesting is updating the python install with brew and then reinstalling whatever other packages you depend on.

因此,我建议您使用brew更新python安装,然后重新安装您所依赖的其他包。


推荐阅读
  • Linux下安装免费杀毒软件ClamAV及使用方法
    本文介绍了在Linux系统下安装免费杀毒软件ClamAV的方法,并提供了使用该软件更新病毒库和进行病毒扫描的指令参数。同时还提供了官方安装文档和下载地址。 ... [详细]
  • web.py开发web 第八章 Formalchemy 服务端验证方法
    本文介绍了在web.py开发中使用Formalchemy进行服务端表单数据验证的方法。以User表单为例,详细说明了对各字段的验证要求,包括必填、长度限制、唯一性等。同时介绍了如何自定义验证方法来实现验证唯一性和两个密码是否相等的功能。该文提供了相关代码示例。 ... [详细]
  • 本文介绍了在rhel5.5操作系统下搭建网关+LAMP+postfix+dhcp的步骤和配置方法。通过配置dhcp自动分配ip、实现外网访问公司网站、内网收发邮件、内网上网以及SNAT转换等功能。详细介绍了安装dhcp和配置相关文件的步骤,并提供了相关的命令和配置示例。 ... [详细]
  • Android系统移植与调试之如何修改Android设备状态条上音量加减键在横竖屏切换的时候的显示于隐藏
    本文介绍了如何修改Android设备状态条上音量加减键在横竖屏切换时的显示与隐藏。通过修改系统文件system_bar.xml实现了该功能,并分享了解决思路和经验。 ... [详细]
  • imx6ull开发板驱动MT7601U无线网卡的方法和步骤详解
    本文详细介绍了在imx6ull开发板上驱动MT7601U无线网卡的方法和步骤。首先介绍了开发环境和硬件平台,然后说明了MT7601U驱动已经集成在linux内核的linux-4.x.x/drivers/net/wireless/mediatek/mt7601u文件中。接着介绍了移植mt7601u驱动的过程,包括编译内核和配置设备驱动。最后,列举了关键词和相关信息供读者参考。 ... [详细]
  • 本文介绍了包的基础知识,包是一种模块,本质上是一个文件夹,与普通文件夹的区别在于包含一个init文件。包的作用是从文件夹级别组织代码,提高代码的维护性。当代码抽取到模块中后,如果模块较多,结构仍然混乱,可以使用包来组织代码。创建包的方法是右键新建Python包,使用方式与模块一样,使用import来导入包。init文件的使用是将文件夹变成一个模块的方法,通过执行init文件来导入包。一个包中通常包含多个模块。 ... [详细]
  • 本文讨论了在openwrt-17.01版本中,mt7628设备上初始化启动时eth0的mac地址总是随机生成的问题。每次随机生成的eth0的mac地址都会写到/sys/class/net/eth0/address目录下,而openwrt-17.01原版的SDK会根据随机生成的eth0的mac地址再生成eth0.1、eth0.2等,生成后的mac地址会保存在/etc/config/network下。 ... [详细]
  • r2dbc配置多数据源
    R2dbc配置多数据源问题根据官网配置r2dbc连接mysql多数据源所遇到的问题pom配置可以参考官网,不过我这样配置会报错我并没有这样配置将以下内容添加到pom.xml文件d ... [详细]
  • Spring学习(4):Spring管理对象之间的关联关系
    本文是关于Spring学习的第四篇文章,讲述了Spring框架中管理对象之间的关联关系。文章介绍了MessageService类和MessagePrinter类的实现,并解释了它们之间的关联关系。通过学习本文,读者可以了解Spring框架中对象之间的关联关系的概念和实现方式。 ... [详细]
  • (三)多表代码生成的实现方法
    本文介绍了一种实现多表代码生成的方法,使用了java代码和org.jeecg框架中的相关类和接口。通过设置主表配置,可以生成父子表的数据模型。 ... [详细]
  • 十大经典排序算法动图演示+Python实现
    本文介绍了十大经典排序算法的原理、演示和Python实现。排序算法分为内部排序和外部排序,常见的内部排序算法有插入排序、希尔排序、选择排序、冒泡排序、归并排序、快速排序、堆排序、基数排序等。文章还解释了时间复杂度和稳定性的概念,并提供了相关的名词解释。 ... [详细]
  • 2016 linux发行版排行_灵越7590 安装 linux (manjarognome)
    RT之前做了一次灵越7590黑苹果炒作业的文章,希望能够分享给更多不想折腾的人。kawauso:教你如何给灵越7590黑苹果抄作业​zhuanlan.z ... [详细]
  • Android日历提醒软件开源项目分享及使用教程
    本文介绍了一款名为Android日历提醒软件的开源项目,作者分享了该项目的代码和使用教程,并提供了GitHub项目地址。文章详细介绍了该软件的主界面风格、日程信息的分类查看功能,以及添加日程提醒和查看详情的界面。同时,作者还提醒了读者在使用过程中可能遇到的Android6.0权限问题,并提供了解决方法。 ... [详细]
  • Jquery 跨域问题
    为什么80%的码农都做不了架构师?JQuery1.2后getJSON方法支持跨域读取json数据,原理是利用一个叫做jsonp的概念。当然 ... [详细]
  • 如何使用Python selenium实现淘宝抢单机器人
    这篇文章将为大家详细讲解有关如何使用Pythonselenium实现淘宝抢单机器人,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章 ... [详细]
author-avatar
晓云71_783
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有