This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug time/19179] New: gmtime_r internally calls getenv("TZ") which is not thread-safe


https://sourceware.org/bugzilla/show_bug.cgi?id=19179

            Bug ID: 19179
           Summary: gmtime_r internally calls getenv("TZ") which is not
                    thread-safe
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: time
          Assignee: unassigned at sourceware dot org
          Reporter: nszabolcs at gmail dot com
  Target Milestone: ---

gmtime_r should be thread-safe, but it calls tzset_internal which calls
getenv("TZ") which is non-thread-safe.

a multi-threaded application may modify the TZ env var through the
environ pointer if there is no concurrent access to this env var in
other threads.

gmtime_r is not specified to access TZ, if it does, that can introduce
a data race in a conforming application and gmtime_r may misbehave if
it observes TZ in an inconsistent state.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]