在Mac OS X上的Ruby中调试malloc错误 [英] Debugging malloc errors in Ruby on Mac OS X
问题描述
我正在尝试调试一些在运行某些Ruby脚本时遇到的错误:
I'm trying to debug errors like the following that I get while running some Ruby scripts:
ruby(47333,0x7fff72aee960) malloc: *** error for object 0x7f98b6a6e3f0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
有什么主意,我如何才能真正设置这样的断点并进行调试?我想看看这是由Ruby本身还是某种扩展引起的.
Any idea how I can actually set such a breakpoint and debug? I want to see whether this is caused by Ruby itself or some extensio..
我正在使用Mac OS X 10.7.3 (Lion)
和ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]
.
推荐答案
当我看到OP的消息时,这就是解决我的问题的方法:
Here's what solved my problem when I saw the OP's message:
我收到消息是因为我弄乱了路径,试图获取rvm
或gem
来安装某些东西,并且我设法真正地弄乱了我的权限.然后我得到了OP正在报告的同一条消息.对我来说,唯一要做的就是转到Mac OS X的Disk Utility
,在左窗格(Macintosh HD)中选择我的卷,然后单击Repair Disk Permissions
.
I got the message because I had messed with paths, trying to get rvm
or gem
to install something, and I managed to really muck up my permissions. Then I got this same message the OP is reporting. For me, the only thing that did it was to go to Mac OS X's Disk Utility
, select my volume in the left pane (Macintosh HD), and then click Repair Disk Permissions
.
完成后,我能够成功打开并启动一个新的终端窗口.
After it finished, I was able to successfully open and start up a new terminal window.
这篇关于在Mac OS X上的Ruby中调试malloc错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!