RegisterProcess failed (error = -50) on NSAttributedString
RegisterProcess failed (error = -50) on NSAttributedString
- Subject: RegisterProcess failed (error = -50) on NSAttributedString
- From: Phill Kelley <email@hidden>
- Date: Tue, 26 Feb 2008 16:44:02 +1100
I wrote a command-line program in the early part of last year. Basically,
it reads a plist which contains URLs of web pages to monitor, and appends
to an RSS feed whenever one of the pages changes. It is linked against
Foundation and AppKit. The core of this program includes the following:
NSData* rawData =
[NSURLConnection
sendSynchronousRequest:request
returningResponse:&response
error:&error
];
...
NSAttributedString* pageContent =
[[NSAttributedString alloc]
initWithData:rawData
options:
[NSDictionary dictionaryWithObjectsAndKeys:
NSHTMLTextDocumentType,
NSDocumentTypeDocumentOption,
url,
NSBaseURLDocumentOption,
nil
]
documentAttributes:&attributes
error:&error
];
...
The NSAttributedString is the only reason why this app needs to link
against AppKit.
I used this program heavily during the second half of 2007. It was run
about 6 times per hour, 24x7, via cron (three different sets of pages being
monitored into three separate feeds). The thing never missed a beat. I
stopped using it close to the end of November when the need for it went
away.
Today, I tried to use it again and it promptly barfed with:
RegisterProcess failed (error = -50)
I tracked the problem to the above instantiation of the NSAttributedString.
The machine this normally runs on (via cron) is an old 500MHz DP G4 running
10.4.11. As I think back and check my logs, I installed 10.4.11 after I
stopped using the app, so I *suspect* that the 10.4.11 upgrade (combo
updater) is the critical change but I'm not in any position to test that
theory.
Now, here's the weird thing. I normally keep home-grown apps in
~/Applications/bin and that prefix is at the end of my PATH statement. To
install, I typically "cp" the binary from Xcode's build directory into
~/Applications/bin. So, assuming that I have just compiled the app and cp'd
the binary, I have three ways of invoking the app (which is called
"pagewatch"):
~/Developer/Cocoa/PageWatch/build/Release/pagewatch ...
~/Applications/bin/pagewatch ...
pagewatch ...
It is only the *last* invocation that fails. In other words, if I rely on
the PATH statement, I get the RegisterProcess error but if I give a full
pathname, it works.
Obviously, I have an easy workaround - don't rely on PATH.
However, I would really like to know what on earth is going on. My research
suggests that "RegisterProcess failed (error = -50)" is not well
understood. Most of what I've found talks about forking processes and I'm
not doing anything like that. Neither am I fiddling about with
LSMinimumVersion (my app doesn't have a bundle) or using NSWorkspace's. I
can't think of any obvious reason why something should fail (a) on an
AppKit call and (b) only when the app is invoked where PATH is involved,
but succeed if a pathname is used.
I have tried this on two 10.4.11 machines and the behaviour is the same.
Any suggestions?
(I have also tried this on Leopard under 10.5.2 and the problem goes away,
so it seems to be 10.4.11-specific).
Regards & thanks, Phill
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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