valgrind 和 iOS SDK 4.2?
使用 valgrind 运行 iOS 4.2 应用程序时遇到问题。
我从 Macports 安装了 valgrind 3.6.0-SVN。 Xcode 3.2.5。
当我修改 main() 来运行 valgrind 时,我得到以下输出:
Detected an attempt to call a symbol in system libraries that is not present on the iPhone: open$UNIX2003 called from function _vgrZU_libSystemZdZaZddylib_arc4random in image vgpreload_core-x86-darwin.so. If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first. ==99640== ==99640== Process terminating with default action of signal 6 (SIGABRT) ==99640== at 0x8B5DEF6: __kill (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8BF062C: raise (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8C066E3: abort (in /usr/lib/libSystem.B.dylib) ==99640== by 0x33F2547: __springboard_unimplemented (in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/libSystem.dylib) ==99640== by 0x33FC208: open$UNIX2003 (in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/libSystem.dylib) ==99640== by 0x1AAD6F3: arc4random (vg_preloaded.c:163) ==99640== by 0x8AFFB7E: create_scalable_zone (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8AFF7EA: _malloc_initialize (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8B23449: malloc_create_zone (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8B233F8: _dispatch_ccache_init (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8B21E0D: dispatch_once_f (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8B233D3: _dispatch_continuation_alloc_from_heap (in /usr/lib/libSystem.B.dylib)
错误似乎非常清楚。我该如何解决这个问题?我听说过在 SDK 3.x 上运行 valgrind 的成功尝试。发生了什么变化?
还有其他建议吗?
Having problems running iOS 4.2 apps with valgrind.
I installed valgrind 3.6.0-SVN from Macports. XCode 3.2.5.
When I modify my main() to run valgrind I get the following output:
Detected an attempt to call a symbol in system libraries that is not present on the iPhone: open$UNIX2003 called from function _vgrZU_libSystemZdZaZddylib_arc4random in image vgpreload_core-x86-darwin.so. If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first. ==99640== ==99640== Process terminating with default action of signal 6 (SIGABRT) ==99640== at 0x8B5DEF6: __kill (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8BF062C: raise (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8C066E3: abort (in /usr/lib/libSystem.B.dylib) ==99640== by 0x33F2547: __springboard_unimplemented (in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/libSystem.dylib) ==99640== by 0x33FC208: open$UNIX2003 (in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/lib/libSystem.dylib) ==99640== by 0x1AAD6F3: arc4random (vg_preloaded.c:163) ==99640== by 0x8AFFB7E: create_scalable_zone (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8AFF7EA: _malloc_initialize (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8B23449: malloc_create_zone (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8B233F8: _dispatch_ccache_init (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8B21E0D: dispatch_once_f (in /usr/lib/libSystem.B.dylib) ==99640== by 0x8B233D3: _dispatch_continuation_alloc_from_heap (in /usr/lib/libSystem.B.dylib)
The error seems to be pretty clear. How can I fix this? I've heard of successful attempts running valgrind on SDK 3.x. What has changed?
Any other advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个可怕的黑客行为,我不知道这意味着什么......但它确实解决了问题:
在你的 valgrind 源代码中,打开 vg_preloaded.c 并找到第 163 行(在你的堆栈跟踪中引用)。将那里的代码更改为:
这似乎是阻止 valgrind 工作的唯一因素...您的情况可能会有所不同。
This is a hideous hack, and I have no idea what the implications are... but it did solve the problem:
In your valgrind source, open up vg_preloaded.c and find line 163 (referenced in your stack trace there). Change the code that is there to:
This appears to be the only thing that keeps valgrind from working... Your mileage may vary.
将以下内容添加到 Objective-C 文件之一的顶部:
Add the following to the top of one of your Objective-C files: