Summary:ASTERISK-04526: [patch] segfault when Asterisk auto-rotates log on getting a SIGXFSV on a log file write (which means file too large)
Reporter:Kevin P. Fleming (kpfleming)Labels:
Date Opened:2005-07-05 16:23:53Date Closed:2011-06-07 14:00:50
Versions:Frequency of
Description:Symptom is an asterisk crash with segfault - caused by Asterisk attempting an automatic logfile rotation when a log file gets to 2GB in size.<br />
<br />
If logger.c gets a SIGXFSV whilst writing a log file, there is code in logger.c to attempt to automatically rotate the logs.  This code was being triggered on my system.<br />
<br />
Unfortunately, the called reload_logger  routine itself calls ast_log.  It does this whilst the pending_logger_reload flag is still set to 1.  So, ast_log again calls reload_logger, which again calls ast_log, which calls reload_logger etc etc until we fall over.<br />
<br />
I attach a simple patch which moves the clearing of pending_logger_reload to BEFORE ast_log is called.  This fixes the crash.<br />
<br />
You have my disclaimer on file; I read the guidelines and can't find any similar bug report.  Its in diff 0u format.  Anything I've forgotten?<br />
<br />
Regards,<br />
Steve Davies
Comments:By: Russell Bryant (russell) 2005-07-07 13:35:20

fixed in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:40:09.000-0600

Repository: asterisk
Revision: 6045

U   branches/v1-0/CHANGES
U   branches/v1-0/logger.c

r6045 | russell | 2008-01-15 15:40:08 -0600 (Tue, 15 Jan 2008) | 2 lines

make sure an automatic log rotation doesn't result in nasty recursion (bug ASTERISK-4526)