lukejduncan
lukejduncan

Reputation: 121

google-toolbox-for-mac iphone unit test: 1073 Abort trap mkdir "$CFFIXED_USER_HOME" Command /bin/sh failed with exit code 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

Upvotes: 3

Views: 710

Answers (2)

Binks
Binks

Reputation: 1806

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 the export DYLD_ROOT_PATH part (and also the export 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.

Upvotes: 2

Cory Pratt
Cory Pratt

Reputation: 81

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).

Upvotes: 0

Related Questions