[exim-dev] [Bug 1007] New: tod_stamp uses non-reentrant loca…

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Phil Pennock
Data:  
Para: exim-dev
Temas novos: [exim-dev] [Bug 1007] tod_stamp uses non-reentrant localtime(), [exim-dev] [Bug 1007] tod_stamp uses non-reentrant localtime(), [exim-dev] [Bug 1007] tod_stamp uses non-reentrant localtime(), [exim-dev] [Bug 1007] tod_stamp uses non-reentrant localtime(), [exim-dev] [Bug 1007] tod_stamp uses non-reentrant localtime(), [exim-dev] [Bug 1007] tod_stamp uses non-reentrant localtime(), [exim-dev] [Bug 1007] tod_stamp uses non-reentrant localtime()
Asunto: [exim-dev] [Bug 1007] New: tod_stamp uses non-reentrant localtime()
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1007
           Summary: tod_stamp uses non-reentrant localtime()
           Product: Exim
           Version: 4.71
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: bug
          Priority: medium
         Component: General execution
        AssignedTo: pdp@???
        ReportedBy: pdp@???
                CC: exim-dev@???



exiwhat(1) uses SIGUSR1 which traps into exim.c:usr1_handler() which uses
log_write which uses tod_stamp which uses the non-reentrant
gmtime()/localtime().

localtime() can then deadlock on waiting for a tz lock.

Work-around: *probably* sufficient to set: timezone = UTC

Need to make tod_stamp() use the *_r() variants if available. localtime_r() is
optional in SUSv3, is present in SUSv2 which notes that it's derived from the
POSIX Threads Extension, 1003.1c-1995. I suspect that it's best to switch to
the _r variants but provide a compile-time knob, which some OSes can set, to
stub out localtime_r() to just unsafely call localtime(). People who complain
should use OSes that provide the *_r() variants.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email