dk@mace /artimi-src/davek/test/mt-test/test1> ls -la total 42 drwxr-xr-x+ 2 dk Domain U 0 Jan 5 15:26 . drwxr-xr-x+ 3 dk Domain U 0 Jan 5 14:19 .. -rw-r--r-- 1 dk Domain U 38303 Jan 5 15:26 cygcheck-out.txt -rwxr-xr-x 1 dk Domain U 219 Jan 5 14:51 makefile -rw-r--r-- 1 dk Domain U 2593 Jan 5 15:21 mttest1.c dk@mace /artimi-src/davek/test/mt-test/test1> make gcc -O2 -g -D_MT -D_REENTRANT -lm -lpthread -Wall mttest1.c -o mttest1.exe dk@mace /artimi-src/davek/test/mt-test/test1> ./mttest1.exe Press return/enter to terminate.....Thread #1 enters tf1... Thread #2 enters tf2... RWRWRWRWR Segmentation fault (core dumped) dk@mace /artimi-src/davek/test/mt-test/test1> gdb ./mttest1.exe GNU gdb 2003-09-20-cvs (cygwin-special) Copyright 2003 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 "i686-pc-cygwin"... (gdb) run Starting program: /artimi-src/davek/test/mt-test/test1/mttest1.exe Press return/enter to terminate.....Thread #1 enters tf1... Thread #2 enters tf2... RWRWRWRWRRW Program received signal SIGSEGV, Segmentation fault. 0x610b77bb in memcpy () from /usr/bin/cygwin1.dll (gdb) bt #0 0x610b77bb in memcpy () from /usr/bin/cygwin1.dll #1 0x610b3434 in fread () from /usr/bin/cygwin1.dll (gdb) thread apply all bt Thread 4 (thread 1040.0x2b8): #0 0x7ffe0304 in ?? () #1 0x77f5c524 in ntdll!ZwWaitForMultipleObjects () from ntdll.dll #2 0x77e75ee0 in WaitForMultipleObjectsEx () from /win/c/WINDOWS/system32/kernel32.dll #3 0x00000002 in ?? () #4 0x00f5ee58 in ?? () #5 0x00000001 in ?? () Thread 3 (thread 1040.0x574): #0 0x7ffe0304 in ?? () #1 0x77f5c524 in ntdll!ZwWaitForMultipleObjects () from ntdll.dll #2 0x77e75ee0 in WaitForMultipleObjectsEx () from /win/c/WINDOWS/system32/kernel32.dll #3 0x00000002 in ?? () #4 0x00d5ee58 in ?? () #5 0x00000001 in ?? () Thread 2 (thread 1040.0x64c): #0 0x7ffe0304 in ?? () #1 0x77f5c524 in ntdll!ZwWaitForMultipleObjects () from ntdll.dll #2 0x77e75ee0 in WaitForMultipleObjectsEx () from /win/c/WINDOWS/system32/kernel32.dll #3 0x00000003 in ?? () #4 0x0065fe58 in ?? () #5 0x00000001 in ?? () Thread 1 (thread 1040.0x468): #0 0x610b77bb in memcpy () from /usr/bin/cygwin1.dll #1 0x610b3434 in fread () from /usr/bin/cygwin1.dll (gdb) q The program is running. Exit anyway? (y or n) y dk@mace /artimi-src/davek/test/mt-test/test1> dk@mace /artimi-src/davek/test/mt-test/test1> ./mttest1.exe Press return/enter to terminate.....RWRWRWRWRRWnters tf1... Segmentation fault (core dumped) dk@mace /artimi-src/davek/test/mt-test/test1>