[asterisk-bugs] [Asterisk 0016782]: [patch] res_pktccops.so doesn't export a symbol, chan_mgcp will not load or will malfunction depending on gcc version

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Feb 10 15:55:43 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16782 
====================================================================== 
Reported By:                nahuelgreco
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   16782
Category:                   Channels/chan_mgcp
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 245184 
Request Review:              
====================================================================== 
Date Submitted:             2010-02-05 18:56 CST
Last Modified:              2010-02-10 15:55 CST
====================================================================== 
Summary:                    [patch] res_pktccops.so doesn't export a symbol,
chan_mgcp will not load or will malfunction depending on gcc version
Description: 
res_pktccops.so is generated without exported symbols, because a
res_pktccops.exports file is missing in the res/ directory.

This is fun, because if you try it in a modern platform, AST_OPTIONAL_API
macro will do his magic and chan_mgcp.so will load with no complaints
because the ast_pktccops_gate_alloc symbol is declared as an optional
dependency. But then it will silenty fail when trying to open gates at the
CMTS, because AST_OPTIONAL_API will provide ast_pktccops_gate_alloc as a an
always-returning-NULL stub.

If you try it in an old platform, like RHEL 5.0 (gcc 4.1.1), chan_mgcp.so
will not load, saying there is an undefined symbol
ast_pktccops_gate_alloc... while res_pktccops.so is already loaded. That's
because AST_OPTIONAL_API macro will do nothing special in presence of a gcc
version that doesn't support weak symbols, so all symbols will be
required.

Solution: Add the attached res_pktccops.exports file to the res/
directory.

This was tested with SVN trunk rev 245184.

RHEL 5.0 log (second case):

*CLI> module show like pkt
Module                         Description                             
Use Count
res_pktccops.so                PktcCOPS manager for MGCP                0
1 modules loaded
*CLI> module load chan_mgcp.so
[2010-02-05 18:39:15.565] WARNING[2761]: loader.c:429 load_dynamic_module:
Error loading module 'chan_mgcp.so':
/usr/lib/asterisk/modules/chan_mgcp.so: undefined symbol:
ast_pktccops_gate_alloc
[2010-02-05 18:39:15.565] WARNING[2761]: loader.c:820 load_resource:
Module 'chan_mgcp.so' could not be loaded.
Unable to load module chan_mgcp.so
Command 'module load chan_mgcp.so ' failed.
*CLI>

====================================================================== 

---------------------------------------------------------------------- 
 (0117972) svnbot (reporter) - 2010-02-10 15:55
 https://issues.asterisk.org/view.php?id=16782#c117972 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 246208

A   trunk/res/res_pktccops.exports

------------------------------------------------------------------------
r246208 | tilghman | 2010-02-10 15:55:43 -0600 (Wed, 10 Feb 2010) | 7
lines

res_pktccops needs to be able to export a symbol for chan_mgcp

(closes issue https://issues.asterisk.org/view.php?id=16782)
 Reported by: nahuelgreco
 Patches: 
       res_pktccops.exports uploaded by nahuelgreco (license 162)

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

http://svn.digium.com/view/asterisk?view=rev&revision=246208 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-02-10 15:55 svnbot         Checkin                                      
2010-02-10 15:55 svnbot         Note Added: 0117972                          
======================================================================




More information about the asterisk-bugs mailing list