• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CFMessagePort problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFMessagePort problems


  • Subject: Re: CFMessagePort problems
  • From: Chris Parker <email@hidden>
  • Date: Mon, 4 Dec 2006 10:54:29 -0800


On Dec 4, 2006, at 10:09 AM, John Stiles wrote:

I don't think AppKit is designed to run multiple copies of an app at once. If you try the same thing with TextEdit, you get similar looking messages:

~ jstiles$ cd /Applications/
/Applications jstiles$ ./TextEdit.app/Contents/MacOS/TextEdit &
[1] 343
/Applications jstiles$ ./TextEdit.app/Contents/MacOS/TextEdit &
[2] 344
2006-12-04 10:07:13.046 TextEdit[344] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0x3103, name = 'com.apple.TextEdit.ServiceProvider'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2006-12-04 10:07:13.046 TextEdit[344] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (com.apple.TextEdit.ServiceProvider)


It's entirely possible that, while your app doesn't create a run- loop or NSApplication object, some APEs/Input Managers are doing this on your behalf. This could be something to investigate.

These particular messages are warning for a condition that has always existed - if you have two copies of an application running, only the first copy of the application will be the copy providing services through the "Services" menu. We only started logging something in Tiger.


On Dec 3, 2006, at 1:39 PM, Paul Kim wrote:

Hi,

I have a commandline/background program. It's written in Objective- C and uses Foundation. It is started by launchd and when it runs, it does it thing and then exits. It does not explicitly create an NSApplication or run loop.

In the past week or so, I've suddenly received bug reports from users of the following form:

2006-12-03 19:53:03.552 hazelfolderwatch[566] CFLog (0): CFMessagePort: bootstrap_register(): failed 1100 (0x44c), port = 0x2103, name = 'NSApplication-MainThread-236-8471333827395#'
2006-12-03 19:53:03.553 hazelfolderwatch[566] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (NSApplication- MainThread-236-8471333827395#)
2006-12-03 19:53:03.553 hazelfolderwatch[566] *** Assertion failure in -[NSApplication _createWakeupPort], AppKit.subproj/ NSApplication.m:3578
2006-12-03 19:53:03.554 hazelfolderwatch[566] CFMessagePortCreateLocal returned NULL port


The way it's described by users, it starts happening all of a sudden. It is common to have multiple copies of this process running and I have not had issues with running multiple copies of the program for the 2+ months the product has been out (plus the months of alpha/beta). It's not an application per se and does not use mach ports directly.

At least in one case, uninstalling some Application Enhancers did remedy the problem but I don't feel confident that APE's or Input Managers are responsible for all the cases I am seeing.

If anyone has any insight into what is going on here and why I'm getting multiple reports coming in out of nowhere. Also, any tips on how to diagnose, fix and/or work around this would be greatly appreciated.

Paul, Are you launching another copy of your command line program by using fork() without a corresponding exec()? That might or might not work depending on what's going on in the process at any given time.


Cocoa requires an exec in order get all the various state into shape for a new process - if you're not calling exec() you're going to get strange behavior.

APEs and/or input managers certainly could exacerbate the situation.

.chris

--
Chris Parker
Cocoa Frameworks
Apple Computer, Inc.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: CFMessagePort problems
      • From: Paul Kim <email@hidden>
References: 
 >CFMessagePort problems (From: Paul Kim <email@hidden>)
 >Re: CFMessagePort problems (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Creating an NSTypeSetter Subclass
  • Next by Date: Re: Synchronizing Thread Execution
  • Previous by thread: Re: CFMessagePort problems
  • Next by thread: Re: CFMessagePort problems
  • Index(es):
    • Date
    • Thread