App crashes with 4.2 iPhone simulator 'set start-with-shell off'
Asked Answered
A

7

12

I'm writing application which perfectly works on 4.0/4.1 iPhone simulator, but not 4.2.

I'm getting such warning:

Detected an attempt to call a symbol in system libraries that is not present on the iPhone: fcntl$UNIX2003 called from function get_socket_nonblocking in image TestApp. If you are encountering this problem running a simulator binary within gdb, make sure you 'set start-with-shell off' first.

How to set 'set start-with-shell off' on Xcode? I'm tried to add this line to .gdbinit but without luck.

With 4.0/4.1 SDK iPhone Simulator prints warnings about attempt to call symbol that is not present on the iPhone in debug window, but app don't crashes. Using using 4.2 app crashes. How to prevent 4.2 crashes ?

Thanks

Adenoidectomy answered 24/11, 2010 at 20:56 Comment(2)
Have you tried building, and running on an actual device?Hendrik
I am experiencing the same error message. Did you file a bug report? If so, what is the reference number?Gerrygerrymander
P
2

before this cleanAll build then

In xcode go to Project > set active executable > appname - Iphone 4.0 simulator

then open simulator then go to Hardware > version > 4.0.2

then double click urapptarget and in build tab change "ios deployment target = 4.0"

now run in simulator it will work

Postcard answered 8/6, 2011 at 8:40 Comment(0)
F
1

File a bug via http://bugreporter.apple.com/

The debugger within Xcode will read ~/.gdbinit just like gdb at the command line. Try adding that line to ~/.gdbinit.

Frederigo answered 24/11, 2010 at 23:32 Comment(0)
P
1

I had a similar problem with a version of libCURL that was built for an earlier OS. The solution was to rebuild the library under iOS 4.2 to eliminate the $UNIX2003 symbol decorations. (I wrote up the full details at http://www.creativealgorithms.com/blog/content/building-libcurl-ios-42.)

Puce answered 9/12, 2010 at 20:21 Comment(0)
S
1

I was also unsuccessful adding the line to ~/.gdbinit. At the risk of stating the obvious: if you set the simulator version to 4.1 within XCode, you'll avoid the issue. This is what I do now - which is fine as long as I don't need to test an API available only on 4.2 - which we do not (we still target iOS 3.0).

Subduct answered 13/1, 2011 at 22:7 Comment(0)
H
0

I encountered a similar error:

Detected an attempt to call a symbol in system libraries that is not present on the iPhone: pthread_rwlock_init$UNIX2003 called from function ...

I was able to fix by unchecking the 'Strip linked Product' Deployment Build Setting of the Project, ie STRIP_INSTALLED_PRODUCT = NO

Don't forget to do a full clean before rebuilding.

Set Strip linked Product Off

You probably only want to do this for the simulator. Filling a bug report is still a good idea.

Hypocorism answered 20/2, 2011 at 3:35 Comment(1)
Okay. Someone else reported this too... does it work if you check it?Hypocorism
E
0

If you are using native libraries, you should recompile them using iOS4 (only the i386 versions, as it works on the device).

Effector answered 11/3, 2011 at 13:40 Comment(0)
V
0

The $2003 suffix is generated by the compiler under some circumstances which you can find fully documented in the manual entry for compat

man compat

I wrestled with this for some time before finally fixing it by setting

-mmacosx-version-min=10.3

Any version prior to 10.4 will do the job.

Hope this helps.

Vandalize answered 7/11, 2011 at 11:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.