我正在尝试从 google-toolbox-for-mac 设置 iPhone 单元测试框架。我创建了一个简单的单元测试,并尝试构建它并收到以下错误。我的一个同事可以使用相同的项目并在他的机器上成功构建。对于我的一生,我无法弄清楚我可能会错过什么。下面是我看到的错误消息。有人有任何见解吗?
未找到属于您的匹配进程
mkdir(1073) malloc:保护边缘
mkdir(1073) malloc:使用标准记录器将 malloc 堆栈记录到磁盘
mkdir(1073) malloc:启用乱写以检测 mods 以释放块
mkdir(1073) malloc:进程 1059 不再存在,堆栈日志已从 /tmp/stack-logs.1059.mkdir.QDKY28.index mkdir(1073) malloc 中删除
堆栈日志正在写入 /tmp/stack-logs.1073.mkdir.KrpE2L.index
:检测到 尝试调用系统库中 iPhone 上不存在的符号:
getopt$UNIX2003 从函数调用 ???在图像 mkdir 中。
如果您在 gdb 中运行模拟器二进制文件时遇到此问题,请确保首先“设置 start-with-shell off”。
/Developer/google-toolbox-for-mac/UnitTesting/RunIPhoneUnitTest.sh:第 150 行:1073 中止陷阱 mkdir“$CFFIXED_USER_HOME”
命令 /bin/sh 失败,退出代码 134
I'm trying to setup the iPhone Unit Testing framework from google-toolbox-for-mac. I've got a simple unit test created and try and build it and receive the following error. A coworker of mine can use the same project and build successfully on his machine. For the life of me I can't figure out what I might be missing. Below is the error message I see. Does anyone have any insights?
No matching processes belonging to you were found
mkdir(1073) malloc: protecting edges
mkdir(1073) malloc: recording malloc stacks to disk using standard recorder
mkdir(1073) malloc: enabling scribbling to detect mods to free blocks
mkdir(1073) malloc: process 1059 no longer exists, stack logs deleted from /tmp/stack-logs.1059.mkdir.QDKY28.index
mkdir(1073) malloc: stack logs being written into /tmp/stack-logs.1073.mkdir.KrpE2L.index
Detected an attempt to call a symbol in system libraries that is not present on the iPhone:
getopt$UNIX2003 called from function ??? in image mkdir.
If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first.
/Developer/google-toolbox-for-mac/UnitTesting/RunIPhoneUnitTest.sh: line 150: 1073 Abort trap mkdir "$CFFIXED_USER_HOME"
Command /bin/sh failed with exit code 134
发布评论
评论(2)
这似乎是 google-toolbox/UnitTesting/RunIPhoneUnitTest.sh 脚本中的错误。该行之后的所有内容:
导出 DYLD_ROOT_PATH="$SDKROOT"
在“iPhone 模式”下运行。在我们较旧的 32 位 iMac 上,/bin/mkdir 似乎使用 getopt$UNIX2003 系统调用,该调用在 iPhone 上不可用。所以下面的行失败了:
mkdir“$CFFIXED_USER_HOME”
。在较新的 64 位 Mac 上,/bin/mkdir 与 iPhone 模式兼容。解决方法是简单地移动以
if [ $GTM_DISABLE_USERDIR_SETUP -eq 0 ]; 开头的代码部分;然后
到export DYLD_ROOT_PATH
部分之前(以及export CFFIXED_USER_HOME
行)。顺便说一句,SDK 似乎有系统库 libc、libSystem 等的包装版本,它们检查所使用的系统调用在 iPhone 上是否可用。这就是上面所说的“iPhone模式”的意思。
It seems to be a bug in the google-toolbox/UnitTesting/RunIPhoneUnitTest.sh script. Everything after the line:
export DYLD_ROOT_PATH="$SDKROOT"
runs in "iPhone mode". On our older 32-bit iMac /bin/mkdir seems to use the getopt$UNIX2003 system call which is not available on the iPhone. So the following line fails:
mkdir "$CFFIXED_USER_HOME"
. On newer 64-bit Macs /bin/mkdir is compatible with iPhone mode.A fix is to simply move the section of code starting with
if [ $GTM_DISABLE_USERDIR_SETUP -eq 0 ]; then
to before theexport DYLD_ROOT_PATH
part (and also theexport CFFIXED_USER_HOME
line).BTW the SDK seems to have wrapper versions of the system libraries libc, libSystem, etc. which check whether the used system calls are available on the iPhone. That's what's meant by "iPhone mode" above.
听起来您的同事可能正在使用旧版本的 iOS SDK,该 SDK 接受 $UNIX2003 符号修饰。当我尝试使用为早期操作系统编译的 libCURL 版本时,我遇到了类似的问题。最后,我不得不使用最新的 SDK 工具重建 libCURL(详细信息如下:http://www.creativealgorithms.com/blog/content/building-libcurl-ios-42),但您也许可以通过使用与您同事相同的 SDK 来解决这个问题(如果它仍然可用) )。
It sounds like your coworker may be using an older version of the iOS SDK that accepts the $UNIX2003 symbol decorations. I had a similar problem when I tried to use a version of libCURL compiled for an earlier OS. In the end, I had to rebuild libCURL with the latest SDK tools (details here: http://www.creativealgorithms.com/blog/content/building-libcurl-ios-42) but you may be able to work around it by using the same SDK as your coworker (if it is still available).