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

Bug#276062: Please test /usr/include/nptl and /usr/lib/nptl with glibc 2.3.5-1 in experimental



Eric Valette wrote:
> GOTO Masanori wrote:
> 
>>Eric,
>>
>>I put /usr/include/nptl headers and /usr/lib/nptl static libraries
>>into glibc 2.3.5-1 which is available in experimental.  If you need it
>>so much, could you test it?  

OK I did. It work on a basic test at least :

gcc-3.4 -v -static -I/usr/include/nptl -L/usr/lib/nptl t3.c -o t3 -lpthread

---------------------------------------------------------------------------
Reading specs from /usr/lib/gcc/i486-linux/3.4.4/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr
--libexecdir=/usr/lib --with-gxx-include-dir=/usr/include/c++/3.4
--enable-shared --with-system-zlib --enable-nls
--without-included-gettext --program-suffix=-3.4 --enable-__cxa_atexit
--enable-libstdcxx-allocator=mt --enable-clocale=gnu
--enable-libstdcxx-debug --enable-java-gc=boehm --enable-java-awt=gtk
--disable-werror i486-linux
Thread model: posix
gcc version 3.4.4 20050314 (prerelease) (Debian 3.4.3-12)
 /usr/lib/gcc/i486-linux/3.4.4/cc1 -quiet -v -I/usr/include/nptl t3.c
-quiet -dumpbase t3.c -mtune=i486 -auxbase t3 -version -o /tmp/ccMmtk1o.s
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/usr/lib/gcc/i486-linux/3.4.4/../../../../i486-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/nptl
 /usr/lib/gcc/i486-linux/3.4.4/include
 /usr/include
End of search list.
GNU C version 3.4.4 20050314 (prerelease) (Debian 3.4.3-12) (i486-linux)
        compiled by GNU C version 3.4.4 20050314 (prerelease) (Debian
3.4.3-12).GGC heuristics: --param ggc-min-expand=64 --param
ggc-min-heapsize=64195
t3.c: In function `main':
t3.c:46: warning: passing arg 3 of `pthread_create' from incompatible
pointer type
 as -V -Qy --32 -o /tmp/ccMptMXU.o /tmp/ccMmtk1o.s
GNU assembler version 2.15 (i386-linux) using BFD version 2.15
 /usr/lib/gcc/i486-linux/3.4.4/collect2 -m elf_i386 -static -o t3
/usr/lib/gcc/i486-linux/3.4.4/../../../../lib/crt1.o
/usr/lib/gcc/i486-linux/3.4.4/../../../../lib/crti.o
/usr/lib/gcc/i486-linux/3.4.4/crtbeginT.o -L/usr/lib/nptl
-L/usr/lib/gcc/i486-linux/3.4.4 -L/usr/lib/gcc/i486-linux/3.4.4
-L/usr/lib/gcc/i486-linux/3.4.4/../../../../lib
-L/usr/lib/gcc/i486-linux/3.4.4/../../.. -L/lib/../lib -L/usr/lib/../lib
/tmp/ccMptMXU.o -lpthread --start-group -lgcc -lgcc_eh -lc --end-group
/usr/lib/gcc/i486-linux/3.4.4/crtend.o
/usr/lib/gcc/i486-linux/3.4.4/../../../../lib/crtn.o
...


---------------------------------------------------------------------------------
33 tri-yann:~/tmp->strace -f t3
execve("./t3", ["t3"], [/* 79 vars */]) = 0
uname({sys="Linux", node="tri-yann", ...}) = 0
brk(0)                                  = 0x80be000
brk(0x80bec90)                          = 0x80bec90
set_thread_area({entry_number:-1 -> 6, base_addr:0x80be830,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1}) = 0
set_tid_address(0x80be878)              = 9183
rt_sigaction(SIGRTMIN, {0x804ab30, [], SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x804abb0, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
_sysctl({{CTL_KERN, KERN_VERSION}, 2, 0xbfffefe0, 30, (nil), 0}) = 0
brk(0x80dfc90)                          = 0x80dfc90
brk(0x80e0000)                          = 0x80e0000
mmap2(NULL, 8388608, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xb7800000
mprotect(0xb7800000, 4096, PROT_NONE)   = 0
clone(Process 9184 attached
child_stack=0xb7fff364,
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb7fffbf8, {entry_number:6, base_addr:0xb7fffbb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb7fffbf8) = 9184
[pid  9183] futex(0x80bc380, FUTEX_WAKE, 2147483647) = 0
[pid  9183] _exit(0)                    = ?
[pid  9184] rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
[pid  9184] rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
[pid  9184] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
[pid  9184] nanosleep({1, 0}, {1, 0})   = 0
[pid  9184] mmap2(NULL, 8388608, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7000000
[pid  9184] mprotect(0xb7000000, 4096, PROT_NONE) = 0
[pid  9184] clone(Process 9185 attached
child_stack=0xb77ff364,
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb77ffbf8, {entry_number:6, base_addr:0xb77ffbb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb77ffbf8) = 9185
[pid  9184] mmap2(NULL, 8388608, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6800000
[pid  9184] mprotect(0xb6800000, 4096, PROT_NONE) = 0
[pid  9184] clone(Process 9186 attached
child_stack=0xb6fff364,
flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID|CLONE_DETACHED,
parent_tidptr=0xb6fffbf8, {entry_number:6, base_addr:0xb6fffbb0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1},
child_tidptr=0xb6fffbf8) = 9186
[pid  9184] futex(0xb77ffbf8, FUTEX_WAIT, 9185, NULL <unfinished ...>
[pid  9185] fstat64(1,  <unfinished ...>
[pid  9186] futex(0x80bcc28, FUTEX_WAIT, 2, NULL <unfinished ...>
[pid  9185] <... fstat64 resumed> {st_mode=S_IFCHR|0620,
st_rdev=makedev(136, 2), ...}) = 0
[pid  9185] mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb67ff000
[pid  9185] write(1, "Thread 1 \n", 10Thread 1
) = 10
[pid  9185] futex(0x80bcc28, FUTEX_WAKE, 1 <unfinished ...>
[pid  9186] <... futex resumed> )       = 0
[pid  9186] write(1, "Thread 2 \n", 10Thread 2
) = 10
[pid  9186] futex(0x80bcc28, FUTEX_WAKE, 1) = 0
[pid  9186] _exit(0)                    = ?
Process 9186 detached
[pid  9185] <... futex resumed> )       = 1
[pid  9185] _exit(0)                    = ?
Process 9185 detached
[pid  9184] <... futex resumed> )       = 0
[pid  9184] write(1, "Thread 1 returns: 0\n", 20Thread 1 returns: 0
) = 20
[pid  9184] write(1, "Thread 2 returns: 0\n", 20Thread 2 returns: 0
) = 20
[pid  9184] munmap(0xb67ff000, 4096)    = 0
[pid  9184] exit_group(0)               = ?
Process 9184 detached
34 tri-yann:~/tmp->
  --------------------------------------------------------------------


The futex system calls above clearly sho that I'm indeed using the NPTL
implementation for the posix threads library and it seems to work.

To be sure, I would however recommand to run the openposix test suite
and compare the results as I did when releasing my own static version to
my customers ...


-- 
   __
  /  `                   	Eric Valette
 /--   __  o _.          	6 rue Paul Le Flem
(___, / (_(_(__         	35740 Pace

Tel: +33 (0)2 99 85 26 76	Fax: +33 (0)2 99 85 26 76
E-mail: eric.valette@free.fr






Reply to: