[asterisk-bugs] [Asterisk 0010295]: segfault on reload

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Jul 26 11:50:40 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10295 
====================================================================== 
Reported By:                junky
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   10295
Category:                   CDR/cdr_pgsql
Reproducibility:            sometimes
Severity:                   minor
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.4.9  
SVN Branch (only for SVN checkouts, not tarball releases): N/A  
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             07-24-2007 19:58 CDT
Last Modified:              07-26-2007 11:50 CDT
====================================================================== 
Summary:                    segfault on reload
Description: 
After an upgrade to 1.4.9
I've that weird segfault.
======================================================================
Relationships       ID      Summary
----------------------------------------------------------------------
related to          0010020 Memory leaks in cdr_pgsql
====================================================================== 

---------------------------------------------------------------------- 
 prashant_jois - 07-26-07 11:50  
---------------------------------------------------------------------- 
I just noticed another problem:

lines 88-92:

   pgerror = PQerrorMessage(conn);
   PQfinish(conn);
   ast_log(LOG_ERROR, "cdr_pgsql: Unable to connect to database server %s.
 Calls will not be logged!\n", pghostname);
   ast_log(LOG_ERROR, "cdr_pgsql: Reason: %s\n", pgerror);

---------------

PQfinish should come after line 92, because pgerror is a pointer to one of
the fields in conn:


   pgerror = PQerrorMessage(conn);
   ast_log(LOG_ERROR, "cdr_pgsql: Unable to connect to database server %s.
 Calls will not be logged!\n", pghostname);
   ast_log(LOG_ERROR, "cdr_pgsql: Reason: %s\n", pgerror);
   PQfinish(conn);

---------------

The same goes for lines 148-152.  It should be:

   pgerror = PQerrorMessage(conn);
   ast_log(LOG_ERROR, "cdr_pgsql: Unable to reconnect to database server
%s. Calls will not be logged!\n", pghostname);
   ast_log(LOG_ERROR, "cdr_pgsql: Reason: %s\n", pgerror);
   PQfinish(conn); 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-26-07 11:50  prashant_jois  Note Added: 0067932                          
======================================================================




More information about the asterisk-bugs mailing list