[Xapian-tickets] [Xapian] #665: getenv() not guaranteed to be thread-safe

Xapian nobody at xapian.org
Tue Dec 16 04:18:24 GMT 2014


#665: getenv() not guaranteed to be thread-safe
--------------------------------+-------------------
        Reporter:  olly         |      Owner:  olly
            Type:  defect       |     Status:  new
        Priority:  normal       |  Milestone:  1.3.x
       Component:  Library API  |    Version:  1.3.2
        Severity:  normal       |   Keywords:
      Blocked By:               |   Blocking:
Operating System:  All          |
--------------------------------+-------------------
 Currently we use environmental variables to control a few things (default
 backend for a newly created DB, flush threshold, replication stuff, cjk
 ngram, debug logging) but {{{getenv()}}} isn't necessarily thread safe.

 Adding a mutex which we lock while calling it wouldn't help as it isn't
 Xapian potentially calling {{{setenv()}}}/{{{putenv()}}}.

 In general we'll be unlucky to hit problems, as we don't call
 {{{getenv()}}} very often, but that's not very reassuring.

 I don't see a good fix, aside from not reading environmental variables.
 Debug logging is a special case, but aside from that I think we should
 probably try to phase them out - being able to change the default backend
 without changing the code is kind of nice, but otherwise these things
 would arguably be better specified in the code.

--
Ticket URL: <http://trac.xapian.org/ticket/665>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list