[Asterisk-Dev] Bug 4621: patch for segfault when Asterisk auto-rotates logs when it gets a SIGXFSZ

steve at daviesfam.org steve at daviesfam.org
Fri Jul 1 05:58:48 MST 2005


Hi,

I've posted a tiny patch to the bug tracker to fix a reproducible segfault 
crash which happens like so:

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; it happens when an output log file gets to 2GB in 
size.

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.

The patch just resets the "pending_logger_reload flag _before_ doing the 
ast_logs, rather than after.

Really - the problem is obvious when you look at the code, the the 
solution patch is trivial.  Could someone with commit right please put 
this one in?

Thanks,
Steve Davies




More information about the asterisk-dev mailing list