And problems regarding -lthr (1:1 KSE)

TeJun Huh tj at atj.dyndns.org
Thu Jul 31 20:16:41 PDT 2003


 I forgot to mention about -lthr (1:1 KSE threading) related problems.

 1. If the program is compiled with '-static -lthr', the program
crashes at the first thread creation.  Stack trace follows.

(gdb) bt full
#0  0x0804da8c in _spinlock_pthread (pthread=0x0, lck=0x805c3f8) at umtx.h:59
No locals.
#1  0x0804da2a in _spinlock (lck=0x805c3f8)
    at /usr/src/lib/libthr/thread/thr_spinlock.c:69
No locals.
#2  0x08058344 in malloc ()
No symbol table info available.
#3  0x080483f9 in _pthread_create (thread=0x0, attr=0x3a0, start_routine=0, 
    arg=0x0) at /usr/src/lib/libthr/thread/thr_create.c:80
        f_gc = 928
        ret = 0
        gc_thread = (struct pthread *) 0x0
        new_thread = (struct pthread *) 0x2c
        pattr = (struct pthread_attr *) 0x80487a8
        flags = 0
        stack = (void *) 0x805c3f8
#4  0x0804835b in main (argc=2, argv=0xbfbffb40) at testpthread.c:50
        stack = (void *) 0x8062000
        thr = (struct pthread *) 0x0
        attr = (struct pthread_attr *) 0x806a000
        ts1sec = {tv_sec = 1, tv_nsec = 0}
        nr = 10
        i = 0
#5  0x08048145 in _start ()


 2. Without -static, the program works fine, but pthread_create()
fails with EAGAIN at thread count 110.  B.T.W. pthread_create() return
value handling was wrong in the example program.  It always confuses
me. :-( How can I increase this limit?  Again, I'm looking for
something like ten thousands.


More information about the freebsd-threads mailing list