В 14:17 -0600 на 17.08.2010 (вт), dann frazier написа:
> (sid)da...@paer:~$ ./obj/test
> Test 

Good.  Please run another test program...  If it works, which I hope and
expect so, then the culprit is really NSProcessInfo.  In the backtraces
you sent initially, frame #14 is an impossible code path, so something
went utterly wrong before that.  I hope stepping will show what.

So build the first test.m
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=592751#78) with `make
debug=yes' and (possibly there's a better way for automatic stepping?):

(gdb) set pagination off
(gdb) set logging on
(gdb) set logging redirect on
(gdb) directory <gnustep-base source>
(gdb) run
Obtain a backtrace when you get the SIGABRT.
(gdb) break +[NSProcessInfo initialize]
(gdb) run
When you reach the breakpoint:
(gdb) while 1
>step
>end

When it crashes again, just quit and send the compressed file.  Thanks!
#import <Foundation/Foundation.h>

@interface NCTest : NSObject
{
  NSUInteger counter;
}
@end

@implementation NCTest

- (void) notified: (NSNotification *) notif
{
  NSLog (@"%@", notif);
  counter++;
}

- (NSUInteger) getCounter
{
  return counter;
}
@end

int
main (void)
{
  CREATE_AUTORELEASE_POOL (pool);
  NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
  NCTest *object = AUTORELEASE ([NCTest new]);
  NSObject *obj = AUTORELEASE ([NSObject new]);

  [nc addObserver: object
  	 selector: @selector (notified:)
  	     name: @"Notification"
  	   object: nil];

  [nc postNotificationName: @"Notification" object: obj];
  [nc postNotificationName: @"Notification" object: nil];
  [nc postNotificationName: @"Foo" object: nil];
  [nc removeObserver: object];
  [nc postNotificationName: @"Notification" object: obj];

  GSPrintf (stdout, @"Posting a simple notification appears to work.\n"
	    @"Total notifications: %d\n", [object getCounter]);

  RELEASE (pool);
  exit (EXIT_SUCCESS);
}

Reply via email to