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:
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
this has been fixed by the tsafe integration and some rework by andrew to avoid non-reetrant calls in the pacemaker plugin.