errno strange behavior on multi threaded application using uClibc-0.9.28
Andre Rosa
andre_rosa at lge.com
Tue Aug 21 22:14:48 PDT 2007
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:andre_rosa at lge.com> andre_rosa at lge.com
site: http://www.lge.com <http://www.lge.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://busybox.net/lists/uclibc/attachments/20070822/d5015dba/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main3.c
Type: application/octet-stream
Size: 1154 bytes
Desc: not available
Url : http://busybox.net/lists/uclibc/attachments/20070822/d5015dba/attachment.obj
More information about the uClibc
mailing list