discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Summary: Latest GNUstep/Etoile on Solaris non-root user problem


From: Fred Kiefer
Subject: Re: Summary: Latest GNUstep/Etoile on Solaris non-root user problem
Date: Fri, 03 Aug 2007 10:36:52 +0200
User-agent: Thunderbird 1.5.0.12 (X11/20060911)

Andreas Höschler wrote:
> 
> NSApplication.m:
> 
> - (void) _init
> {
> ...
> initialize_gnustep_backend();
> 
> /* Load user-defined bundles */
> gsapp_user_bundles();
> 
> /* Connect to our window server. */
> srv = [GSDisplayServer serverWithAttributes: nil];
> RETAIN(srv);
> [GSDisplayServer setCurrentServer: srv];
> ...
> }
> 
> [GSDisplayServer setCurrentServer: srv] was never called since
> gsapp_user_bundles() raised an exception.
> 
> gsapp_user_bundles(void)
> {
> NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
> NSArray *array = [defs arrayForKey:@"GSAppKitUserBundles"];
> int i, c = [array count];
> if (array == nil || c == 0) return;
> NSLog(@"Loading %d user defined AppKit bundles", c);
> for (i = 0; i < c; i++)
> {
> NSString *path = [array objectAtIndex:i];
> NSLog(@"Trying %@ ...", path);
> NS_DURING
> NSBundle *bundle = [NSBundle bundleWithPath:path];
> if (bundle)
> {
> NSLog(@"Loading...");
> [[[bundle principalClass] alloc] init]; // <----- Camaelon raised an
> exception when accessing resources (unreadable by normal user)
> NSLog(@"Loaded '%@'\n", path);
> NSLog(@" ");
> }
> else NSLog(@"* Unable to load '%@'", path);
> NS_HANDLER
> NSLog(@"Warning (gsapp): %@", [localException reason]);
> NS_ENDHANDLER
> }
> }
> 
> Some method in the process of loading the bundles
> 
> ("/opt/GNUstep/System/Library/Bundles/Camaelon.themeEngine","/opt/GNUstep/System/Library/Bundles/EtoileMenus.bundle","/opt/GNUstep/System/Library/Bundles/EtoileBehavior.bundle")
> 
> 
> called [NSScreen screens] which raised another exception since
> GSCurrentServer() could not be set.
> 
> NSScreen.m
> + (NSArray *)screens
> {
> ...
> srv = GSCurrentServer();
> screens = [srv screenList];
> count = [screens count];
> if (count == 0)
> {
> // something is wrong. This shouldn't happen.
> [NSException raise: NSWindowServerCommunicationException format:
> @"Unable to retrieve list of screens from window server."];
> return nil;
> }
> ...
> }
> 
> and Etoile fun was over.

A call to any gui method before the initialisation of the display server
is rather daring. We never can be sure about the results. Perhaps these
bundles could be changed to skip this call during loading?
I understand that bundles want to get started as early as possible to be
able to change even the most basic behaviour of their environment. But
then the have to stick to certain rules.

What surprises me still is that you did not get any message from the
failed bundle loading. Some debug output here, could have speeded up the
whole analysis process. Looking at your code shows that you have added
some exception handling there, which is not in the original GNUstep
code. Still there should have been some output.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]