Bug 561181 - RFE implement thread safe syslog call for corosync internal use
Summary: RFE implement thread safe syslog call for corosync internal use
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: corosync
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Steven Dake
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 561187
TreeView+ depends on / blocked
 
Reported: 2010-02-02 23:27 UTC by Steven Dake
Modified: 2016-04-27 03:20 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
: 561187 (view as bug list)
Environment:
Last Closed: 2010-06-15 17:21:17 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Steven Dake 2010-02-02 23:27:16 UTC
Description of problem:
corosync-1.2.0 uses syslog api which uses thread-unsafe strftime API (uses getenv internally, resulting in segfaults if environment is changed with setenv while syslog is being used.

Version-Release number of selected component (if applicable):
corosync-1.2.0

How reproducible:
very rare

Steps to Reproduce:
1.
2.
3.
  
Actual results:
segfault rarely

Expected results:
no segfault

Additional info:

Comment 1 kerdosa 2010-02-03 01:25:10 UTC
Adding stacktrace when corosync got a seg fault to show how syslog calls strftime and getenv.

core was generated by `/usr/sbin/corosync'.
#0  0x0013b7ee in getenv (name=<value optimized out>) at getenv.c:90
90                if (name_start == ep_start && !strncmp (*ep + 2, name, len)
[New process 4174]
(gdb) bt
#0  0x0013b7ee in getenv (name=<value optimized out>) at getenv.c:90
#1  0x00193cf0 in tzset_internal (always=<value optimized out>, explicit=<value optimized out>) at tzset.c:162
#2  0x0019480d in __tzset () at tzset.c:543
#3  0x00198f96 in __strftime_l (s=<value optimized out>, maxsize=<value optimized out>, format=<value optimized out>, tp=<value optimized out>,
    loc=<value optimized out>) at strftime_l.c:562
#4  0x001df70b in __vsyslog_chk (pri=<value optimized out>, flag=<value optimized out>, fmt=<value optimized out>, ap=<value optimized out>)
    at ../misc/syslog.c:197
#5  0x001dfc29 in __syslog_chk (pri=Could not find the frame base for "__syslog_chk".
) at ../misc/syslog.c:131
#6  0x0590b9fc in log_printf_to_logs (rec_ident=<value optimized out>, file_name=0xb7e91bd8 "utils.c", function_name=0xb7e91be4 "get_config_opt",
    file_line=612, buffer=0xb7e91bf8 "info: get_config_opt: Defaulting to 'off' for option: to_file") at logsys.c:545
#7  0x0590c56c in logsys_worker_thread (data=0x0) at logsys.c:650
#8  0x002ec4d2 in start_thread (arg=<value optimized out>) at pthread_create.c:297
#9  0x001e348e in clone () from /lib/i686/nosegneg/libc.so.6

Comment 2 Steven Dake 2010-06-15 17:21:17 UTC
this has been fixed by the tsafe integration and some rework by andrew to avoid non-reetrant calls in the pacemaker plugin.


Note You need to log in before you can comment on or make changes to this bug.