[Home]

Summary:ASTERISK-29148: AST_MODULE_INFO no, MODULEINFO depend
Reporter:Alexander Traud (traud)Labels:
Date Opened:2020-11-02 01:24:21.000-0600Date Closed:2020-11-20 13:52:51.000-0600
Priority:TrivialRegression?
Status:Closed/CompleteComponents:General
Versions:16.14.0 18.0.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Found this, while debugging the channel driver {{chan_sip}} while {{noload => res_pjsip}}. Commit [9cfdb81|https://gerrit.asterisk.org/7872] added ‘.requires’ to AST_MODULE_INFO: The listed modules get required at runtime. 34 months later, that change is still not complete because much more requirements exit. This is a follow-up to
* ASTERISK-28789 which looked at *use/require* and
* ASTERISK-28838 which looked at *no/require*

Here, the topic is *depend/no*:
MODULEINFO declares other modules as dependencies at build-time. At runtime, those dependencies are still required. Consequently, each ‘depend’ in MODULEINFO has to be copied over to ‘.requires’ in AST_MODULE_INFO.

In other words, if an Asterisk module is loaded at runtime, its Linux shared library is loaded. When such a module/library does not find all its dependencies, the command-line interface prints the missing symbols. Those are quite cryptic. Therefore, is not always obvious which module is required. For that, ‘.requires’ in AST_MODULE_INFO helps because it prints not the missing symbol(s) names but the missing module(s) names.

For example, {{noload => res_pjsip_session}} in the configurations file {{/etc/asterisk/modules.conf}} gives:{code}ERROR: loader.c:2396 load_modules: Error loading module 'res_hep_pjsip.so': /usr/lib/asterisk/modules/res_hep_pjsip.so: undefined symbol: ast_sip_dialog_get_session{code}Actually, I expected the same for the new module {{res_pjsip_stir_shaken}}. However, it does not depend/require on {{res_pjsip_session}} actually, because the two used symbols got moved to {{res_pjsip}} in commit [7d04544|https://gerrit.asterisk.org/6647]. Nevertheless, for symmetry, I also enhanced {{res_pjsip_stir_shaken}}, too.

{{noload => res_sorcery_memory.so}} gives:
{code}ERROR: sorcery.c:886 __ast_sorcery_object_type_insert_wizard: Wizard 'memory' could not be applied to object type 'nat_hook' as it was not found
ERROR: res_pjsip/pjsip_configuration.c:2011 ast_res_pjsip_initialize_configuration: Failed to register nat_hook{code}This is special because the module still starts. Consequently, it raises the question whether (A) the originating MODULEINFO depend is correct. or whether (B) the failure code in module {{res_pjsip}} is correct.

{{noload => res_pjsip}} gives:
{code}ERROR: loader.c:2396 load_modules: Error loading module 'res_prometheus.so': /usr/lib/asterisk/modules/res_prometheus.so: undefined symbol: ast_sip_get_sorcery{code}This is special because it does not list the module {{res_pjsip}} as MODULEINFO depend. This is because it can be build without PJProject. However, in that case, it has to be optional in MODULEINFO and conditional in AST_MODULE_INFO.

{{noload => res_sorcery_config.so}} gives:
{code}ERROR: sorcery.c:886 __ast_sorcery_object_type_insert_wizard: Wizard 'config' could not be applied to object type 'log_mappings' as it was not found
WARNING: res_pjproject.c:665 load_module: Failed to register pjproject log_mappings object with sorcery
ERROR: loader.c:2396 load_modules: res_pjproject declined to load.{code}This unveiled a previously unmentioned dependency.
Comments:By: Asterisk Team (asteriskteam) 2020-11-02 01:24:22.649-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Friendly Automation (friendly-automation) 2020-11-20 13:52:52.340-0600

Change 15126 merged by George Joseph:
loader: Sync load- and build-time deps.

[https://gerrit.asterisk.org/c/asterisk/+/15126|https://gerrit.asterisk.org/c/asterisk/+/15126]

By: Friendly Automation (friendly-automation) 2020-11-20 13:53:08.158-0600

Change 15127 merged by George Joseph:
loader: Sync load- and build-time deps.

[https://gerrit.asterisk.org/c/asterisk/+/15127|https://gerrit.asterisk.org/c/asterisk/+/15127]

By: Friendly Automation (friendly-automation) 2020-11-20 13:53:23.189-0600

Change 15119 merged by George Joseph:
loader: Sync load- and build-time deps.

[https://gerrit.asterisk.org/c/asterisk/+/15119|https://gerrit.asterisk.org/c/asterisk/+/15119]