[Freeswitch-users] Segfault

David Knell dave at 3c.co.uk
Thu Apr 17 13:51:23 PDT 2008


Hi all -

Just had an interesting FS segfault.  switch_xml_free (called from 
mod_xml_cdr) recursed 3500+ times
and, I guess, the thing ran out of stack space.

Having a look at the core dump shows that it's freeing a valid XML CDR 
structure for a call which
wasn't cleared for ages; FS sat in a loop playing a prompt.  The net 
result would have been a CDR
with a vast number of <application> lines, had the segfault not occurred.

Fixes:
(a) don't get in this situation in the first place;
(b) rewrite switch_xml_free to eliminate recursion;
(c) limit the number of children created in switch_ivr_generate_xml_cdr;
- and probably some more.

My favourite's (c) - any alternatives/objections?  If not, I'll pop this 
with a patch in Jira.

Cheers --

Dave

-- 
David Knell, Director, 3C Limited
T: 020 8114 8901  F: 020 3002 7257  M: 001 415 630 3031
http://www.3c.co.uk 





More information about the FreeSWITCH-users mailing list