tzset generates ThreadSanitizer warnings if TZ not set

Bug #2036420 reported by Fredrik Arnerup
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glibc (Ubuntu)

Bug Description

A program that calls tzset (e.g. via mktime) from multiple threads will generate ThreadSanitizer warnings, but only if the environment variable TZ is not set. Please see attached example.

Not sure if it is a glibc bug or a limitation in ThreadSanitizer.

$ lsb_release -rd
Description: Ubuntu 22.04.3 LTS
Release: 22.04

$ apt-cache policy libc6
  Installed: 2.35-0ubuntu3.1
  Candidate: 2.35-0ubuntu3.1
  Version table:
 *** 2.35-0ubuntu3.1 500
        500 jammy-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.35-0ubuntu3 500
        500 jammy/main amd64 Packages

Revision history for this message
Fredrik Arnerup (farnerup) wrote :
Revision history for this message
Simon Chopin (schopin) wrote :

Might be a false positive. AFAICT this warns about writing to old_tz, which AFAICT is always dealt with under the tzset_lock except in __libc_tzset_freemem which I'm guessing is only ran when the main thread exits.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.