Hi, all!
I'm getting different behavior regarding errno variable in
multi-threaded programs when comparing with glibc
and would like to ask if it is a bug or not.
Attached program has very different behavior when comparing with glibc.
under glibc, the output is always like this, no matter if the line 43 of the
attached program is commented or not:
from thread 1! errno is 1 right now...
from thread 2! errno is 2 right now...
from thread 3! errno is 3 right now...
from thread 4! errno is 4 right now...
from thread 1! errno is 1 right now...
from thread 2! errno is 2 right now...
from thread 3! errno is 3 right now...
from thread 4! errno is 4 right now...
from main! errno is 5 right now...
from thread 1! errno is 1 right now...
from thread 2! errno is 2 right now...
from thread 3! errno is 3 right now...
from thread 4! errno is 4 right now...
from main! errno is 5 right now...
from thread 1! errno is 1 right now...
from thread 2! errno is 2 right now...
from thread 3! errno is 3 right now...
from thread 4! errno is 4 right now...
from main! errno is 5 right now...
...
...
...
But under uClibc, I get this output when line 43 ("errno = 5;") is
commented, but not when it is commented:
from thread 1! errno is 1 right now...
from thread 2! errno is 2 right now...
from thread 3! errno is 3 right now...
from thread 4! errno is 4 right now...
from thread 1! errno is 1 right now...
from thread 2! errno is 2 right now...
from thread 3! errno is 3 right now...
from thread 4! errno is 4 right now...
from main! errno is 4 right now...
from thread 1! errno is 1 right now...
from thread 2! errno is 2 right now...
from thread 3! errno is 3 right now...
from thread 4! errno is 4 right now...
NOK - errno should be thread local(== 5), but its value is 4
from main! errno is 4 right now...
from thread 1! errno is 1 right now...
from thread 2! errno is 2 right now...
from thread 3! errno is 3 right now...
from thread 4! errno is 4 right now...
...
...
...
Program is compiled like this:
[glibc-2.3.5]
gcc -lpthread main3.c -o errno_test
[uClibc-0.9.28]
mipsel-linux-gcc -lpthread main3.c -o errno_test
ggc version is 4.0.2
and
mipsel-linux-gcc version is 3.4.6
Could you please shed a light on this issue to me?
Thanks in advance,
André Goddard Rosa
R&D Engineer
Brazil DTV Lab
phone: +55 (11) 2202-5300
fax: +55 (11) 2202-5200
email: <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
site: http://www.lge.com <http://www.lge.com/>
main3.c
Description: Binary data
_______________________________________________ uClibc mailing list [email protected] http://busybox.net/cgi-bin/mailman/listinfo/uclibc
