public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/10320] New: erand48 implementation not thread safe but POSIX says it should be
@ 2009-06-23 19:25 simon at josefsson dot org
  2009-06-23 20:11 ` [Bug libc/10320] " simon at josefsson dot org
  0 siblings, 1 reply; 11+ messages in thread
From: simon at josefsson dot org @ 2009-06-23 19:25 UTC (permalink / raw)
  To: glibc-bugs

POSIX specification for erand48:

http://www.opengroup.org/onlinepubs/9699919799/functions/erand48.html

It doesn't say the function may be non-reentrant, which IIUC, means it should be
thread safe.  However the implementation of erand48 does use a global variable:

http://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/erand48.c;hb=HEAD

The variable is __libc_drand48_data and is defined in:

http://sourceware.org/git/?p=glibc.git;a=blob;f=stdlib/drand48-iter.c;hb=HEAD

I can't find anyplace where it is made thread-local, so I'm assuming it is a
real global variable.

As far as I can tell, there is no requirement in the specification that erand48
update the global drand48 state.

-- 
           Summary: erand48 implementation not thread safe but POSIX says it
                    should be
           Product: glibc
           Version: 2.11
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: simon at josefsson dot org
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=10320

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-07-01  7:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-10320-131@http.sourceware.org/bugzilla/>
2012-12-19 10:49 ` [Bug libc/10320] erand48 implementation not thread safe but POSIX says it should be schwab@linux-m68k.org
2012-12-19 21:41 ` neleai at seznam dot cz
2012-12-20  8:21 ` simon at josefsson dot org
2012-12-20 12:12 ` neleai at seznam dot cz
2012-12-20 22:52 ` bugdal at aerifal dot cx
2012-12-21  8:13 ` simon at josefsson dot org
2012-12-21 20:35 ` bugdal at aerifal dot cx
2014-02-16 17:45 ` jackie.rosen at hushmail dot com
2014-05-28 19:42 ` schwab at sourceware dot org
2014-07-01  7:57 ` fweimer at redhat dot com
2009-06-23 19:25 [Bug libc/10320] New: " simon at josefsson dot org
2009-06-23 20:11 ` [Bug libc/10320] " simon at josefsson dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).