Thread problem on i386: gslock nsconnection thread diningPhilosophers e.g: # gdb ./obj/gslock GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-unknown-openbsd4.4"... (gdb) r -WOUseWatchDog NO Starting program: /usr/ports/x11/gnustep/base/w-gnustep-base-1.18.0p0/gnustep-base-1.18.0/Testing/obj/gslock -WOUseWatchDog NO 2009-01-04 21:44:30.960 gslock[6414] End (/empty/(nil)):0.001585 2009-01-04 21:44:31.159 gslock[6414] End (/single GS/):0.001950 2009-01-04 21:44:31.351 gslock[6414] End (/single (r) GS/):0.001910 2009-01-04 21:44:31.612 gslock[6414] End (/single NS/):0.002603 2009-01-04 21:44:31.852 gslock[6414] End (/single (r) NS/):0.002387 /usr/ports/x11/gnustep/base/w-gnustep-base-1.18.0p0/gnustep-base-1.18.0/Testing/obj/gslock: Uncaught exception NSInternalInconsistencyException, reason: Unable to detach thread (last error Undefined error: 0) Program received signal SIGABRT, Aborted. [Switching to process 6414, thread 0x85316000] 0x05f42aed in kill () from /usr/lib/libc.so.48.0 (gdb) bt #0 0x05f42aed in kill () from /usr/lib/libc.so.48.0 #1 0x05f7ada3 in abort () at /usr/src/lib/libc/stdlib/abort.c:68 #2 0x0aed4435 in _terminate () at NSException.m:697 #3 0x0aed4ac3 in -[NSException raise] (self=0x8831c328, _cmd=0x2aefce60) at NSException.m:867 #4 0x0aed4750 in +[NSException raise:format:arguments:] (self=0x2aefcc40, _cmd=0x2aefce48, name=0x2aefcf64, format=0x2af15d60, argList=0xcfbc0580 "(�1\210([�*") at NSException.m:781 #5 0x0aed46c3 in +[NSException raise:format:] (self=0x2aefcc40, _cmd=0x2af15a80, name=0x2aefcf64, format=0x2af15d60) at NSException.m:767 #6 0x0af6c62d in -[NSThread start] (self=0x2af15b60, _cmd=0x2af15b20) at NSThread.m:848 #7 0x0af6b91a in +[NSThread detachNewThreadSelector:toTarget:withObject:] (self=0x2af15a40, _cmd=0x3c001738, aSelector=0x3c001730, aTarget=0x7d6ab208, anArgument=0x0) at NSThread.m:472 #8 0x1c000dd1 in -[Tester runTest:] (self=0x7d6ab208, _cmd=0x3c001778, ident=0x3c0018bc) at gslock.m:92 #9 0x1c0012dc in test_lazyLocks () at gslock.m:151 #10 0x1c001f9e in gnustep_base_user_main () at gslock.m:222 #11 0x0af36e9c in main (argc=3, argv=0xcfbc078c, env=0xcfbc079c) at NSProcessInfo.m:921 #12 0x1c000a90 in ___start () #13 0x1c0009ff in _start () #14 0x00000000 in ?? () (gdb) list NSThread.m:848 843 errno = 0; 844 if (objc_thread_detach(@selector(main), self, nil) == NULL) 845 { 846 _active = NO; 847 RELEASE(self); 848 [NSException raise: NSInternalInconsistencyException 849 format: @"Unable to detach thread (last error %@)", 850 [NSError _last]]; 851 } 852 } (gdb) Thread on sparc65: =================== ./obj/thread ... 2009-01-04 20:56:26.156 thread[6416] Waiting for all 5 retainRelease threads to complete (0) 2009-01-04 20:56:27.166 thread[6416] Waiting for all 5 retainRelease threads to complete (0) 2009-01-04 20:56:28.176 thread[6416] Waiting for all 5 retainRelease threads to complete (0) 2009-01-04 20:56:29.186 thread[6416] Waiting for all 5 retainRelease threads to complete (0) ... seems to be forever waiting, also the diningPhilosophers seem to run forever, or is that intended? on both: nsfilehandle, but only when nsfilehandle.m is not in the working directory, otherwise it works well: # gdb ./nsfilehandle GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "sparc64-unknown-openbsd4.4"... (gdb) r Starting program: /usr/ports/x11/gnustep/base/w-gnustep-base-1.18.0p0/gnustep-base-1.18.0/Testing/obj/nsfilehandle assertion "src != nil" failed: file "nsfilehandle.m", line 41, function "gnustep_base_user_main" Program received signal SIGABRT, Aborted. abort () at /usr/src/lib/libc/stdlib/abort.c:74 74 /usr/src/lib/libc/stdlib/abort.c: No such file or directory. in /usr/src/lib/libc/stdlib/abort.c (gdb) bt #0 abort () at /usr/src/lib/libc/stdlib/abort.c:74 #1 0x000000004c3b7d28 in __assert2 (file=0x201ad8 "nsfilehandle.m", line=41, func=0x201a80 "gnustep_base_user_main", failedexpr=0x201af8 "src != nil") at /usr/src/lib/libc/gen/assert.c:52 #2 0x00000000001012b8 in gnustep_base_user_main () at nsfilehandle.m:41 #3 0x0000000000100bf8 in _start () #4 0x0000000000100bf8 in _start () Previous frame identical to this frame (corrupt stack?) (gdb) list nsfilehandle.m:41 36 NSLog(@"%@", [src readDataToEndOfFile]); 37 } 38 assert(dst != nil); 39 40 src = [[NSFileHandle fileHandleForReadingAtPath:@"nsfilehandle.m"] retain]; 41 assert(src != nil); 42 43 assert(src != nil); 44 d0 = [[src readDataToEndOfFile] retain]; 45 [(NSFileHandle*)dst writeData: d0]; (gdb) list /usr/src/lib/libc/gen/assert.c:52 47 /usr/src/lib/libc/gen/assert.c: No such file or directory. in /usr/src/lib/libc/gen/assert.c (gdb) quit The program is running. Exit anyway? (y or n) y # pwd /usr/ports/x11/gnustep/base/w-gnustep-base-1.18.0p0/gnustep-base-1.18.0/Testing/obj # cd .. # ./obj/nsfilehandle 2009-01-04 21:31:50.656 nsfilehandle[5696] <> Test passed (length:1870) 2009-01-04 21:31:50.978 nsfilehandle[5696] Data is (nil) not really sure whether this should be considered a bug in the testsuite? Does there exist a target so that I can call gmake test or something and not need to run each test manually, as I did? the following happens only on sparc64, on i386 I get "Test passed": # ./nsundomanager 2009-01-04 20:52:38.467 nsundomanager[30826] Failed undo ./obj/basic on sparc64: ... fref nsconnection_client nsindexset nstask.m.o Second task has completed 2009-01-04 21:25:54.393 basic[23557] Caught NAME:NSGenericException REASON:an exception INFO:(nil) /usr/ports/x11/gnustep/base/w-gnustep-base-1.18.0p0/gnustep-base-1.18.0/Testing/obj/basic: Uncaught exception NSGenericException, reason: an exception Program received signal SIGABRT, Aborted. abort () at /usr/src/lib/libc/stdlib/abort.c:74 74 /usr/src/lib/libc/stdlib/abort.c: No such file or directory. in /usr/src/lib/libc/stdlib/abort.c (gdb) bt #0 abort () at /usr/src/lib/libc/stdlib/abort.c:74 #1 0x00000000409534d8 in _terminate () at NSException.m:697 #2 0x0000000040953d40 in -[NSException raise] (self=0x4affe8d0, _cmd=0x40de26c0) at NSException.m:867 #3 0x00000000409538e4 in +[NSException raise:format:arguments:] (self=0x40de22c0, _cmd=0x40de2690, name=0x40de28b8, format=0x3018f8, argList=0xfffffffffffda6b0) at NSException.m:781 #4 0x0000000040953830 in +[NSException raise:format:] (self=0x40de22c0, _cmd=0x3017f0, name=0x40de28b8, format=0x3018f8) at NSException.m:767 #5 0x000000000010145c in gnustep_base_user_main () at basic.m:53 #6 0x0000000000100cd8 in _start () #7 0x0000000000100cd8 in _start () Previous frame identical to this frame (corrupt stack?) (gdb) list basic.m:53 48 [task waitUntilExit]; 49 50 printf("Second task has completed\n"); 51 52 NSSetUncaughtExceptionHandler(handler); 53 [NSException raise: NSGenericException format: @"an exception"]; 54 55 DESTROY(arp); 56 return 0; 57 } or should it raise an exception here intentionally and all is fine?