[Home]

Summary:ASTERISK-26518: Error loading module 'res_pjsip.so': undefined symbol: ast_sip_session_register_supplement
Reporter:Anthony Messina (amessina)Labels:
Date Opened:2016-10-28 21:05:18Date Closed:2017-10-09 17:49:05
Priority:MajorRegression?
Status:Closed/CompleteComponents:Resources/res_pjsip
Versions:13.13.0 14.1.1 GIT Frequency of
Occurrence
Constant
Related
Issues:
is duplicated byASTERISK-27132 Asterisk starts with multiple "undefined symbol" errors in pjsip modules
is duplicated byASTERISK-27287 Cyclic reference between res_pjsip and res_pjsip_session
is related toASTERISK-27306 chan_pjsip: Cannot be tested for memory leaks.
Environment:Fedora 24 x86_64Attachments:( 0) ast.diff
( 1) restore_multihomed_module.patch
Description:After upgrading to Asterisk 14.1.1 with branch 14 updates up to d84eaa4 applied, the PJSIP modules won't load when _hardened_build is defined (see below).  When _hardened_build is undefined, Asterisk/PJSIP starts properly.  This seems strikingly similar to ASTERISK-25727 but I do have OPTIONAL_API enabled.  I did not see this issue with 14.0.2.

{code}
NOTICE[30928]: loader.c:1440 load_modules: 269 modules will be loaded.
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'func_pjsip_aor.so': /usr/lib64/asterisk/modules/func_pjsip_aor.so: undefined symbol: ast_sip_location_retrieve_aor_contacts
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_diversion.so': /usr/lib64/asterisk/modules/res_pjsip_diversion.so: undefined symbol: ast_copy_pj_str
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_mwi_body_generator.so': /usr/lib64/asterisk/modules/res_pjsip_mwi_body_generator.so: undefined symbol: ast_sip_get_pjsip_endpoint
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_pidf_digium_body_supplement.so': /usr/lib64/asterisk/modules/res_pjsip_pidf_digium_body_supplement.so: undefined symbol: ast_sip_presence_xml_create_node
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_authenticator_digest.so': /usr/lib64/asterisk/modules/res_pjsip_authenticator_digest.so: undefined symbol: ast_sip_unregister_authenticator
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_empty_info.so': /usr/lib64/asterisk/modules/res_pjsip_empty_info.so: undefined symbol: ast_sip_session_register_supplement
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_registrar_expire.so': /usr/lib64/asterisk/modules/res_pjsip_registrar_expire.so: undefined symbol: ast_sip_location_delete_contact
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_mwi.so': /usr/lib64/asterisk/modules/res_pjsip_mwi.so: undefined symbol: ast_sip_create_request
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_endpoint_identifier_user.so': /usr/lib64/asterisk/modules/res_pjsip_endpoint_identifier_user.so: undefined symbol: ast_copy_pj_str
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_outbound_registration.so': /usr/lib64/asterisk/modules/res_pjsip_outbound_registration.so: undefined symbol: ast_sip_cli_traverse_objects
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_header_funcs.so': /usr/lib64/asterisk/modules/res_pjsip_header_funcs.so: undefined symbol: ast_sip_session_register_supplement
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_refer.so': /usr/lib64/asterisk/modules/res_pjsip_refer.so: undefined symbol: ast_copy_pj_str
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_messaging.so': /usr/lib64/asterisk/modules/res_pjsip_messaging.so: undefined symbol: ast_sip_default_outbound_endpoint
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_exten_state.so': /usr/lib64/asterisk/modules/res_pjsip_exten_state.so: undefined symbol: ast_sip_subscription_is_terminated
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_registrar.so': /usr/lib64/asterisk/modules/res_pjsip_registrar.so: undefined symbol: ast_sip_report_failed_acl
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_sdp_rtp.so': /usr/lib64/asterisk/modules/res_pjsip_sdp_rtp.so: undefined symbol: ast_copy_pj_str
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_nat.so': /usr/lib64/asterisk/modules/res_pjsip_nat.so: undefined symbol: ast_sip_session_register_supplement
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_dlg_options.so': /usr/lib64/asterisk/modules/res_pjsip_dlg_options.so: undefined symbol: ast_sip_session_register_supplement
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_session.so': /usr/lib64/asterisk/modules/res_pjsip_session.so: undefined symbol: ast_sip_get_distributor_serializer
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip.so': /usr/lib64/asterisk/modules/res_pjsip.so: undefined symbol: ast_sip_session_register_supplement
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_xpidf_body_generator.so': /usr/lib64/asterisk/modules/res_pjsip_xpidf_body_generator.so: undefined symbol: ast_sip_presence_xml_create_attr
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_transport_management.so': /usr/lib64/asterisk/modules/res_pjsip_transport_management.so: undefined symbol: ast_sip_get_pjsip_endpoint
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_transport_websocket.so': /usr/lib64/asterisk/modules/res_pjsip_transport_websocket.so: undefined symbol: ast_sip_create_serializer
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_path.so': /usr/lib64/asterisk/modules/res_pjsip_path.so: undefined symbol: ast_copy_pj_str
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_pubsub.so': /usr/lib64/asterisk/modules/res_pjsip_pubsub.so: undefined symbol: ast_sip_get_distributor_serializer
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_rfc3326.so': /usr/lib64/asterisk/modules/res_pjsip_rfc3326.so: undefined symbol: ast_copy_pj_str
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'func_pjsip_contact.so': /usr/lib64/asterisk/modules/func_pjsip_contact.so: undefined symbol: ast_sip_get_contact_status_label
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_caller_id.so': /usr/lib64/asterisk/modules/res_pjsip_caller_id.so: undefined symbol: ast_copy_pj_str
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_sips_contact.so': /usr/lib64/asterisk/modules/res_pjsip_sips_contact.so: undefined symbol: ast_sip_get_pjsip_endpoint
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'func_pjsip_endpoint.so': /usr/lib64/asterisk/modules/func_pjsip_endpoint.so: undefined symbol: ast_sip_get_sorcery
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_publish_asterisk.so': /usr/lib64/asterisk/modules/res_pjsip_publish_asterisk.so: undefined symbol: ast_sip_register_publish_handler
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_t38.so': /usr/lib64/asterisk/modules/res_pjsip_t38.so: undefined symbol: ast_sip_session_resume_reinvite
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_history.so': /usr/lib64/asterisk/modules/res_pjsip_history.so: undefined symbol: ast_copy_pj_str
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_one_touch_record_info.so': /usr/lib64/asterisk/modules/res_pjsip_one_touch_record_info.so: undefined symbol: ast_sip_session_register_supplement
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_send_to_voicemail.so': /usr/lib64/asterisk/modules/res_pjsip_send_to_voicemail.so: undefined symbol: ast_sip_session_register_supplement
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_acl.so': /usr/lib64/asterisk/modules/res_pjsip_acl.so: undefined symbol: ast_copy_pj_str
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_notify.so': /usr/lib64/asterisk/modules/res_pjsip_notify.so: undefined symbol: ast_sip_default_outbound_endpoint
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_pidf_body_generator.so': /usr/lib64/asterisk/modules/res_pjsip_pidf_body_generator.so: undefined symbol: ast_sip_get_pjsip_endpoint
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_outbound_publish.so': /usr/lib64/asterisk/modules/res_pjsip_outbound_publish.so: undefined symbol: ast_sip_push_task_synchronous
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_endpoint_identifier_ip.so': /usr/lib64/asterisk/modules/res_pjsip_endpoint_identifier_ip.so: undefined symbol: ast_sip_cli_traverse_objects
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_logger.so': /usr/lib64/asterisk/modules/res_pjsip_logger.so: undefined symbol: ast_sip_get_pjsip_endpoint
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_dialog_info_body_generator.so': /usr/lib64/asterisk/modules/res_pjsip_dialog_info_body_generator.so: undefined symbol: ast_sip_presence_xml_create_node
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'chan_pjsip.so': /usr/lib64/asterisk/modules/chan_pjsip.so: undefined symbol: ast_sip_create_request
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_dtmf_info.so': /usr/lib64/asterisk/modules/res_pjsip_dtmf_info.so: undefined symbol: ast_sip_session_register_supplement
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_outbound_authenticator_digest.so': /usr/lib64/asterisk/modules/res_pjsip_outbound_authenticator_digest.so: undefined symbol: ast_sip_unregister_outbound_authenticator
WARNING[30928]: loader.c:552 load_dynamic_module: Error loading module 'res_pjsip_pidf_eyebeam_body_supplement.so': /usr/lib64/asterisk/modules/res_pjsip_pidf_eyebeam_body_supplement.so: undefined symbol: ast_sip_presence_xml_create_node
{code}
Comments:By: Asterisk Team (asteriskteam) 2016-10-28 21:05:19.396-0500

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.

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].

By: George Joseph (gjoseph) 2016-11-02 15:42:41.710-0500

Anthony, did any Fedora packages update before trying 14.1.1?  I ask because there was an issue a while back where one package (snmp i think) had hard-coded references to the hardened build stuff and it had a ripple effect.

Also, can you do a 'dnf list installed *rpm*' for me?




By: Anthony Messina (amessina) 2016-11-02 19:13:01.711-0500

I'm not exactly sure at what you're getting at...  But, I do keep this system upgraded with daily updated from upstream Fedora, so my answer would be yes, there probably were other updates for the system.  I build Asterisk rpms myself (https://messinet.com/rpms/log/asterisk/) and try to keep updated every week or two with updates from the upstream Asterisk 14 branch.  

Below is the output you requested, I think, but I'm not sure this is what you wanted.  Are you looking for a list of all intstalled RPMs?
{code}
~]# dnf list installed *rpm*
Last metadata expiration check: 2:39:01 ago on Wed Nov  2 16:25:15 2016.
Installed Packages
deltarpm.x86_64                                                                                                 3.6-15.fc24                                                                                        @fedora                  
fpc-srpm-macros.noarch                                                                                          1.0-1.fc24                                                                                         @fedora                  
ghc-srpm-macros.noarch                                                                                          1.4.2-4.fc24                                                                                       @fedora                  
gnat-srpm-macros.noarch                                                                                         4-1.fc24                                                                                           @fedora                  
go-srpm-macros.noarch                                                                                           2-6.fc24                                                                                           @fedora                  
ocaml-srpm-macros.noarch                                                                                        2-4.fc24                                                                                           @fedora                  
perl-srpm-macros.noarch                                                                                         1-18.fc24                                                                                          @fedora                  
python-deltarpm.x86_64                                                                                          3.6-15.fc24                                                                                        @fedora                  
python-srpm-macros.noarch                                                                                       3-7.fc24                                                                                           @fedora                  
redhat-rpm-config.noarch                                                                                        41-2.fc24                                                                                          @updates                  
rpm.x86_64                                                                                                      4.13.0-0.rc1.27.fc24                                                                               @fedora                  
rpm-build-libs.x86_64                                                                                           4.13.0-0.rc1.27.fc24                                                                               @fedora                  
rpm-libs.x86_64                                                                                                 4.13.0-0.rc1.27.fc24                                                                               @fedora                  
rpm-plugin-selinux.x86_64                                                                                       4.13.0-0.rc1.27.fc24                                                                               @fedora                  
rpm-plugin-systemd-inhibit.x86_64                                                                               4.13.0-0.rc1.27.fc24                                                                               @fedora                  
rpm-python.x86_64                                                                                               4.13.0-0.rc1.27.fc24                                                                               @fedora                  
rpm-python3.x86_64                                                                                              4.13.0-0.rc1.27.fc24                                                                               @fedora                  
rpm-sign.x86_64                                                                                                 4.13.0-0.rc1.27.fc24                                                                               @fedora                  
rpmfusion-free-release.noarch                                                                                   24-2                                                                                               @rpmfusion-free-updates  
rpmfusion-nonfree-release.noarch                                                                                24-2                                                                                               @rpmfusion-nonfree-updates
{code}

You mentioned snmp, so the following are installed as well:
{code}
~]# rpm -qa|grep snmp                                                                                                                                                                                                          
net-snmp-libs-5.7.3-13.fc24.x86_64
net-snmp-agent-libs-5.7.3-13.fc24.x86_64
{code}

By: George Joseph (gjoseph) 2016-11-03 07:52:41.752-0500

That's what I needed.  It's the redhat-rpm-config package that provides the hardened compiler and linker.  I wanted to verify that we were running the same version.  I'm investigating.


By: George Joseph (gjoseph) 2016-11-03 15:42:48.328-0500

I did rpmbuilds with and without hardened and with and without pjproject bundled and got no errors at build or runtime.  This is on my current Fedora 24 system.

Can you send me your spec file?
Also, were you using bundled pjproject or external?
If external, where from and how was it built?


By: Anthony Messina (amessina) 2016-11-04 02:24:26.761-0500

I keep my spec file here: https://messinet.com/rpms/browser/asterisk/asterisk.spec

I have been using your bundled pjproject for some time as you're constantly fixing issues and reporting them upstream, which take a while to filter back down to the distributions.

By: George Joseph (gjoseph) 2016-11-04 08:45:53.749-0500

I'll test yours this morning.  Looks pretty similar to Fedora's which is what mine is also based on. :)


By: George Joseph (gjoseph) 2016-11-07 11:20:12.075-0600

Well, I've run this a few times now without failure.  I can't use your spec file exactly because you have patches I don't have but I did make sure that I was setting the macros the same way and verified I was getting a hardened build.  Are you testing on the same machine you did the build on or a different machine?  I'm also going to tickle [~jsmith] and see if he has any insights.


By: Anthony Messina (amessina) 2016-11-11 20:53:02.764-0600

The patch (with the exception of the callerid/confbridge patch) is just the difference between the latest release version and the git pull from the upstream 14 branch.  That way, I'm building with the latest branch fixes applied. I guess it's a way to pull in features/fixes a little early as well as find issues before a release.

The build occurs in a clean Koji/Mock instance--the same type of buildsystem that Fedora uses upstream.

Up until I entered the original report, I was able to build with _hardened_build enabled.



By: nappsoft (nappsoft) 2016-11-23 23:55:26.718-0600

I get exactly the same error (linux from scratch/musl based distribution with gcc 4.9.3) with asterisk 13.13.0 as long as I do not apply ast.diff

By: George Joseph (gjoseph) 2016-11-29 09:03:33.837-0600

I'll see if I can reproduce again.


By: Emil Petrakov (iq180) 2017-01-15 05:53:48.090-0600

I got same errors starting v13.13 with gcc 4.9.4 (Gentoo Hardened 4.9.4 p1.0, pie-0.6.4).

By: Alex Hermann (gaaf) 2017-01-20 10:41:38.783-0600

Not sure if this is the way to go to solve this, but putting the merged multihomed module back into it's own module solved the circular dependency for me.

Patch is against 13.13, should apply to other versions without much hassle/fuzz.

By: Oleksandr Natalenko (post-factum) 2017-07-17 07:26:56.886-0500

Workaround works for 14.6.0.

By: Oleksandr Natalenko (post-factum) 2017-10-07 23:28:01.772-0500

Asterisk 15 is also affected, but workaround (patch) works.

By: Corey Farrell (coreyfarrell) 2017-10-08 05:19:09.496-0500

If you can test against Asterisk 15 please try the patch at https://gerrit.asterisk.org/6649.  This moves the session supplement registration from res_pjsip_session to res_pjsip, which resolves a circular symbol dependency between the two modules.  Be aware that patch has not yet been reviewed and has received very little testing.  It is not yet available for 13/14 as the patch does not cleanly apply.  I don't plan on backporting until the patch gets some reviews.

By: Oleksandr Natalenko (post-factum) 2017-10-09 14:43:52.652-0500

I think that patch from gerrit requires something else applied first since git am complains that res/res_pjsip/pjsip_message_filter.c does not exist.

By: Oleksandr Natalenko (post-factum) 2017-10-09 14:58:08.816-0500

I've cherry picked these:

{code}
c05366f14b (HEAD -> fixes-15.0.0) res_pjsip: Fix issues that prevented shutdown of modules.
69749c84b4 pjsip_message_filter: Fix regression causing bad contact address
f3600ac1fa res_pjsip:  Filter out non SIP(S) requests
{code}

v15 started okay.

By: Corey Farrell (coreyfarrell) 2017-10-09 17:49:05.427-0500

Thank you for confirming.  The gerrit reviews are currently being merged:
* 13 - https://gerrit.asterisk.org/6693
* 14 - https://gerrit.asterisk.org/6692
* 15 - https://gerrit.asterisk.org/6649
* master - https://gerrit.asterisk.org/6647