OSSP CVS Repository

ossp - Ticket #24
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Attach]  [Edit]  [History

Ticket 24: l2 is not thread safe when used along with fsl

l2 appears to be thread safe if used carefully by itself. However, when l2 is used with fsl, thread safety problems are evident when log lines start overwriting each other once the thread level becomes dense. The problem arises in the l2_channel_vlog call, which takes as an argument the l2 channel that fsl creates. From this channel, the function extracts the l2_env_t struct, which has a buffer that is used by a subsequent call to l2_util_format to store the formatted log message. The problem is that this l2_env_t struct is part of the l2 channel that fsl passed, which is global. The log line overwriting can occur anywhere after this buffer in l2_env_t is used becacuse any thread can write to it during the l2_util_format call while other threads read from it in downstream calls. The temporary solution that serves our purpose was to store the message in a local function variable before passing it to l2_util_format. The patch file used is attached.
[Add remarks]

Remarks:

Properties:

Type: code           Version: 0.9.4 
Status: new          Created: 2003-Oct-31 21:35
Severity:          Last Change: 2003-Oct-31 21:35
Priority:          Subsystem: l2 
Assigned To: rse           Derived From:  
Creator: anonymous 

Attachments:

CVSTrac 2.0.1