1

my app Cocoa app for OS X was rejected by Apple. This is what they said:

2.23 The app spawns a process that continues running after the user quits the app, without first obtaining user consent.
The spawned process is /Applications/MyApp.app/Contents/MacOS/MyApp -psn_0_10148269.

(I changed the app name)

I have no idea how to find out what this strange process is. What's the best approach to find that out? Maybe using Instruments ? Is there a way to figure out what psn_0_10148269 means?

Some parts of my app use (many) NSTask objects. Could that process be a not terminated NSTask object?

Daniel
  • 1,473
  • 3
  • 33
  • 63

1 Answers1

2

That is a pretty weird message. The process is just your app itself. OS X passes in the -psn argument when it launches your app -- it's an implementation detail, that normally you never see.

It could definitely be something relating to an NSTask. Possibly you are running a task but never reaping its exit status; then your app becomes a zombie process. Double-check your NSTask usage, and make sure you aren't leaking any of them.

Also, it never hurts to ask the Apple reviewer for a clarification.

Kurt Revis
  • 27,695
  • 5
  • 68
  • 74
  • Thank you for that answer. I'll have a look at all my NSTask instances. Is there a way for me to ensure that this isn't happening anymore?? That would be very helpful. – Daniel Mar 19 '12 at 21:15
  • Impossible to say whether it's fixed, until you find out the real cause of the problem! I'd run your app and watch it, and its tasks, in Activity Monitor, or `ps` or `top` in the Terminal. I know `ps` can show zombie tasks ("Z" in the "STAT" column), don't know about the others. – Kurt Revis Mar 19 '12 at 21:19
  • Update: It was all my fault. I forgot that I wrote code some time ago that under special circumstances prevented the app from quitting if it still waits for a answer of a server. But if that answer never comes.... That was only for testing and I forgot to remove it. Nevertheless, thank you for your help! – Daniel Mar 20 '12 at 23:24