bug-gnustep
[Top][All Lists]
Advanced

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

[bug #45032] [base] Bundle not correctly returned for Class in Framework


From: Gregory John Casamento
Subject: [bug #45032] [base] Bundle not correctly returned for Class in Framework
Date: Mon, 08 Jun 2015 13:17:42 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36

Follow-up Comment #7, bug #45032 (project gnustep):

Hey guys... after doing some research on this on Riccardo's SPARC box I've
seen this:

Breakpoint 13, +[NSBundle(Private) _addFrameworkFromClass:] (self=0xfea34304
<_OBJC_Class_NSBundle>, _cmd=0xfea34590 <_OBJC_SELECTOR_TABLE+488>, 
    frameworkClass=0xff30eb28 <_OBJC_Class_NSFramework_FSNode>) at
NSBundle.m:889
889           fmClasses = [frameworkClass frameworkClasses];
(gdb) step
objc_msg_lookup (receiver=0xff30eb28 <_OBJC_Class_NSFramework_FSNode>,
op=0xfea34568 <_OBJC_SELECTOR_TABLE+448>)
    at
/home/dam/mgar/pkg/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/gcc-4.9.2/libobjc/sendmsg.c:445
445    
/home/dam/mgar/pkg/gcc4/trunk/work/solaris10-sparc/build-isa-sparcv8plus/gcc-4.9.2/libobjc/sendmsg.c:
No such file or directory.
(gdb) b NSFramework_FSNode.m:13
Breakpoint 14 at 0xff2a145c: file derived_src/NSFramework_FSNode.m, line 13.
(gdb) c
Continuing.

Breakpoint 14, +[NSFramework(FSNode) _frameworkClasses] (self=0xff30eb28
<_OBJC_Class_NSFramework_FSNode>, _cmd=0xfea34568 <_OBJC_SELECTOR_TABLE+448>)
    at derived_src/NSFramework_FSNode.m:13
13      + (NSString *const*)frameworkClasses { return allClasses; }
(gdb) p allClasses
$5 = {0x0}
(gdb) 

This is a method GNUstep-make is auto generating for the framework.  Here's
the class in it's entirety....

#include <Foundation/NSString.h>
@interface NSFramework_FSNode : NSObject
+ (NSString *)frameworkEnv;
+ (NSString *)frameworkPath;
+ (NSString *)frameworkVersion;
+ (NSString *const*)frameworkClasses;
@end
@implementation NSFramework_FSNode
+ (NSString *)frameworkEnv { return nil; }
+ (NSString *)frameworkPath { return @"/usr/GNUstep/Local/Library/Frameworks";
}
+ (NSString *)frameworkVersion { return @"0"; }
static NSString *allClasses[] = {@"FSNode", @"FSNodeRep", @"FSNTextCell",
@"FSNBrowserCell", @"FSNCellNameEditor", @"FSNBrowserScroll",
@"FSNBrowserMatrix", @"FSNBrowserColumn", @"FSNBrowser", @"FSNIcon",
@"FSNIconNameEditor", @"FSNIconsView", @"FSNListView",
@"FSNListViewDataSource", @"FSNListViewNameEditor", @"FSNListViewNodeRep",
@"FSNPathComponentView", @"FSNPathComponentsViewer", NULL};
+ (NSString *const*)frameworkClasses { return allClasses; }
@end

Now... as is apparent from the trace above "allClasses" at the time
frameworkClasses is called from NSBundle.m:889 (current SVN revision as of
this date) is returning NULL:

887           /* A NULL terminated list of class names - the classes
contained
888              in the framework.  */
889           fmClasses = [frameworkClass frameworkClasses];
890     
891           while (*fmClasses != NULL)
892             {
893               NSValue *value;
894               Class    class = NSClassFromString(*fmClasses);
895     
(gdb) p fmClasses
$6 = (struct NSString **) 0xff31a6c4 <allClasses>
(gdb) p *fmClasses
$7 = (struct NSString *) 0x0
(gdb) 

I'm a bit confused as, I thought that the static variable in the global scope
should be initialized before everything else, but, apparently, this is not
something which can be relied on to happen on SOLARIS.

I'm wondering if this is a more generalized issue.  Could this happen on other
OSs.  Currently I have only seen this on SOLARIS, but that doesn't rule out
the possibility that it could happen elsewhere.



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45032>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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