* [Bug libfortran/46267] strerror() is not necessarily thread-safe
2010-11-02 11:17 [Bug libfortran/46267] New: strerror() is not necessarily thread-safe jb at gcc dot gnu.org
@ 2010-11-02 12:43 ` jvdelisle at gcc dot gnu.org
2010-11-02 13:06 ` redi at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2010-11-02 12:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46267
Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jvdelisle at gcc dot
| |gnu.org
--- Comment #1 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2010-11-02 12:43:13 UTC ---
I see strerror used in two places:
./intrinsics/gerror.c: p = strerror (errno);
./io/unix.c: return strerror (errno);
There seems to be some configury already in config.h.in for something here.
Can we simply define _GNU_SOURCE to get strerror_r and then just use it?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/46267] strerror() is not necessarily thread-safe
2010-11-02 11:17 [Bug libfortran/46267] New: strerror() is not necessarily thread-safe jb at gcc dot gnu.org
2010-11-02 12:43 ` [Bug libfortran/46267] " jvdelisle at gcc dot gnu.org
@ 2010-11-02 13:06 ` redi at gcc dot gnu.org
2010-11-02 13:20 ` jb at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2010-11-02 13:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46267
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-11-02 13:06:22 UTC ---
(In reply to comment #1)
> Can we simply define _GNU_SOURCE to get strerror_r and then just use it?
What about non-glibc systems?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/46267] strerror() is not necessarily thread-safe
2010-11-02 11:17 [Bug libfortran/46267] New: strerror() is not necessarily thread-safe jb at gcc dot gnu.org
2010-11-02 12:43 ` [Bug libfortran/46267] " jvdelisle at gcc dot gnu.org
2010-11-02 13:06 ` redi at gcc dot gnu.org
@ 2010-11-02 13:20 ` jb at gcc dot gnu.org
2010-11-02 13:41 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jb at gcc dot gnu.org @ 2010-11-02 13:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46267
--- Comment #3 from Janne Blomqvist <jb at gcc dot gnu.org> 2010-11-02 13:20:48 UTC ---
Well, if we want to use strerror_r() we'd have to either first undef
_GNU_SOURCE before we include string.h so that we get the POSIX version (but,
might this cause some other weird breakage?) or then we need to have versions
both for glibc and others. E.g.
#ifdef HAVE_STRERROR_R
#ifdef _GNU_SOURCE
// Use glibc strerror_r()
#else
// Use POSIX strerror_r()
#else
// Use strerror()
#endif
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/46267] strerror() is not necessarily thread-safe
2010-11-02 11:17 [Bug libfortran/46267] New: strerror() is not necessarily thread-safe jb at gcc dot gnu.org
` (2 preceding siblings ...)
2010-11-02 13:20 ` jb at gcc dot gnu.org
@ 2010-11-02 13:41 ` jakub at gcc dot gnu.org
2011-01-20 15:14 ` jb at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2010-11-02 13:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46267
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-11-02 13:41:10 UTC ---
Testing _GNU_SOURCE macro is not the right way to differentiate GNU vs. POSIX
2008 strerror_r, GNU version is used unless POSIX 2008 is requested without
_GNU_SOURCE. I guess much easier would be to check the return type of
strerror_r instead.
#ifdef HAVE_STRERROR_R
if (__builtin_classify_type (strerror_r (0, NULL, 0)) == 5)
/* GNU strerror_r */;
else
/* POSIX strerror_r */;
#endif
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/46267] strerror() is not necessarily thread-safe
2010-11-02 11:17 [Bug libfortran/46267] New: strerror() is not necessarily thread-safe jb at gcc dot gnu.org
` (3 preceding siblings ...)
2010-11-02 13:41 ` jakub at gcc dot gnu.org
@ 2011-01-20 15:14 ` jb at gcc dot gnu.org
2011-01-20 18:59 ` jb at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jb at gcc dot gnu.org @ 2011-01-20 15:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46267
Janne Blomqvist <jb at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2011.01.20 14:44:26
Ever Confirmed|0 |1
--- Comment #5 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-20 14:44:26 UTC ---
Assigning to myself.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/46267] strerror() is not necessarily thread-safe
2010-11-02 11:17 [Bug libfortran/46267] New: strerror() is not necessarily thread-safe jb at gcc dot gnu.org
` (4 preceding siblings ...)
2011-01-20 15:14 ` jb at gcc dot gnu.org
@ 2011-01-20 18:59 ` jb at gcc dot gnu.org
2011-01-21 17:37 ` jb at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jb at gcc dot gnu.org @ 2011-01-20 18:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46267
Janne Blomqvist <jb at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
URL| |http://gcc.gnu.org/ml/gcc-p
| |atches/2011-01/msg01400.htm
| |l
--- Comment #6 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-20 18:14:17 UTC ---
Patch: http://gcc.gnu.org/ml/gcc-patches/2011-01/msg01400.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/46267] strerror() is not necessarily thread-safe
2010-11-02 11:17 [Bug libfortran/46267] New: strerror() is not necessarily thread-safe jb at gcc dot gnu.org
` (5 preceding siblings ...)
2011-01-20 18:59 ` jb at gcc dot gnu.org
@ 2011-01-21 17:37 ` jb at gcc dot gnu.org
2011-01-21 23:01 ` jb at gcc dot gnu.org
2011-01-22 21:10 ` jb at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jb at gcc dot gnu.org @ 2011-01-21 17:37 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46267
Janne Blomqvist <jb at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
URL|http://gcc.gnu.org/ml/gcc-p |http://gcc.gnu.org/ml/gcc-p
|atches/2011-01/msg01400.htm |atches/2011-01/msg01486.htm
|l |l
AssignedTo|unassigned at gcc dot |jb at gcc dot gnu.org
|gnu.org |
--- Comment #7 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-21 17:26:08 UTC ---
Updated patch: http://gcc.gnu.org/ml/gcc-patches/2011-01/msg01486.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/46267] strerror() is not necessarily thread-safe
2010-11-02 11:17 [Bug libfortran/46267] New: strerror() is not necessarily thread-safe jb at gcc dot gnu.org
` (6 preceding siblings ...)
2011-01-21 17:37 ` jb at gcc dot gnu.org
@ 2011-01-21 23:01 ` jb at gcc dot gnu.org
2011-01-22 21:10 ` jb at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jb at gcc dot gnu.org @ 2011-01-21 23:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46267
--- Comment #8 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-21 22:42:26 UTC ---
Author: jb
Date: Fri Jan 21 22:42:17 2011
New Revision: 169110
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=169110
Log:
PR 46267 strerror thread safety
Modified:
trunk/libgfortran/ChangeLog
trunk/libgfortran/config.h.in
trunk/libgfortran/configure
trunk/libgfortran/configure.ac
trunk/libgfortran/intrinsics/gerror.c
trunk/libgfortran/io/unix.c
trunk/libgfortran/libgfortran.h
trunk/libgfortran/runtime/error.c
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libfortran/46267] strerror() is not necessarily thread-safe
2010-11-02 11:17 [Bug libfortran/46267] New: strerror() is not necessarily thread-safe jb at gcc dot gnu.org
` (7 preceding siblings ...)
2011-01-21 23:01 ` jb at gcc dot gnu.org
@ 2011-01-22 21:10 ` jb at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jb at gcc dot gnu.org @ 2011-01-22 21:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46267
Janne Blomqvist <jb at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #9 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-01-22 18:59:41 UTC ---
Fixed, closing
^ permalink raw reply [flat|nested] 10+ messages in thread