Programs compiled with libkse does not work at all. Fix: I have preliminary patch. Also needed kernel patch from PR sparc64/72998 <http://www.freebsd.org/cgi/query-pr.cgi?pr=sparc64/72998> How-To-Repeat: Use this test code: --- ss2.c begins here --- #include <stdio.h> #include <string.h> #include <pthread.h> static void * entry1(void *argp) { long x = 0, y = 1; while (1) { if ((y - x) != 1) { fprintf(stderr, "FATAL ERROR: (y - x) != 1, " "x = %ld, y = %ld\n", x, y); } x++; y++; } return NULL; } void * entry2(void *argp) { long x = 0, y = -1; while (1) { if ((y - x) != -1) { fprintf(stderr, "FATAL ERROR: (y - x) != -1, " "x = %ld, y = %ld\n", x, y); } x--; y--; } return NULL; } static void * entry3(void *argp) { long x = 0, y = 2; while (1) { if ((y - x) != 2) { fprintf(stderr, "FATAL ERROR: (y - x) != 2, " "x = %ld, y = %ld\n", x, y); } x += 2; y += 2; } return NULL; } static void * entry4(void *argp) { long x = 0, y = -2; while (1) { if ((y - x) != -2) { fprintf(stderr, "FATAL ERROR: (y - x) != -2, " "x = %ld, y = %ld\n", x, y); } x -= 2; y -= 2; } return NULL; } struct thr_table { void * (*entry)(void *); pthread_t thread; }; static struct thr_table threads[] = { {entry1, NULL}, {entry2, NULL}, {entry3, NULL}, {entry4, NULL}, {NULL, NULL} }; int main() { int error; struct thr_table *pthr; for (pthr = threads; pthr->entry != NULL; pthr++) { error = pthread_create(&pthr->thread, NULL, pthr->entry, NULL); if (error) fprintf(stderr, "Error in pthread_create(): %s\n", strerror(error)); } sleep(20); return 0; } --- ss2.c ends here --- bel@bel$ cc -g -o ss2 ss2.c -lkse bel@bel$ ./ss2 Segmentation fault (core dumped) bel@bel$ gdb ss2 ss2.core GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. [...] This GDB was configured as "sparc64-marcel-freebsd"... Core was generated by `ss2'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/lib/libkse.so.1...done. Loaded symbols for /usr/lib/libkse.so.1 Reading symbols from /lib/libc.so.5...done. Loaded symbols for /lib/libc.so.5 Reading symbols from /libexec/ld-elf.so.1...done. Loaded symbols for /libexec/ld-elf.so.1 #0 0x0000000040507bb0 in __utrap_panic () from /lib/libc.so.5 (gdb) bt #0 0x0000000040507bb0 in __utrap_panic () from /lib/libc.so.5 #1 0x00000000405079d4 in __sparc_utrap () from /lib/libc.so.5 #2 0x000000004049ab6c in __sparc_utrap_gen () from /lib/libc.so.5 #3 0x000000004049ab6c in __sparc_utrap_gen () from /lib/libc.so.5 Previous frame identical to this frame (corrupt stack?) (gdb) quit
Responsible Changed From-To: freebsd-sparc64->trhodes I'd like to take a look at this.
State Changed From-To: open->closed KSE is no more...