Bug 9357

Summary: [UPDATE REQUEST] Update asterisk to 17.4.0
Product: [ROSA-based products] ROSA Fresh Reporter: Dmitry Postnikov <pastordidi>
Component: Contributed PackagesAssignee: ROSA Linux Bugs <bugs>
Status: RESOLVED FIXED QA Contact: ROSA Linux Bugs <bugs>
Severity: normal    
Priority: Normal CC: alzim, andrey.bondrov, denis.silakov, mc2374, zombie.ryushu
Version: All   
Target Milestone: ---   
Hardware: All   
OS: Linux   
URL: https://www.asterisk.org/downloads
Whiteboard:
Platform: 2016.1 ROSA Vulnerability identifier: A lot (30+) of CVEs
RPM Package: asterisk-13.7.2-7.src.rpm ISO-related:
Bad POT generating: Upstream:

Description Dmitry Postnikov 2018-09-27 13:57:19 MSK
Update asterisk 13.7.2 to 15.6 (stable)
Comment 1 Giovanni Mariani 2019-09-09 13:13:15 MSK
*** Bug 7439 has been marked as a duplicate of this bug. ***
Comment 2 Giovanni Mariani 2019-09-09 13:22:40 MSK
The requested release is affected by at lest 10 CVEs, in addition to the boatload affecting our actual (and ancient) release:
see https://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=asterisk

We should go directly for the latest stable (16.5.0): change title accordingly...
Comment 3 Zombie Ryushu 2020-04-28 21:55:42 MSK
At the very least, we need to attempt to get Asterisk 13.20 built. I actually managed to get our current build partly working.
Comment 4 Zombie Ryushu 2020-04-28 21:56:38 MSK
Andrey, can you help with an update?
Comment 5 Andrey Bondrov 2020-04-29 08:40:08 MSK
(In reply to Zombie Ryushu from comment #4)
> Andrey, can you help with an update?

Maybe later. Now I'm busy with other packages.
Comment 6 Giovanni Mariani 2020-04-29 10:19:06 MSK
I'm slowly working on packaging 17.3.0.
I already did a stab at asterisk in the past but got stuck on the menuselect options... I'm hoping to have better luck this time...
Comment 7 Giovanni Mariani 2020-05-04 19:32:02 MSK
The new 17.3.0 update was just published, the updates for sound files packages should follow in the next few days.
Closing this. Please open new bugs for issues eventually arising...
Comment 8 Zombie Ryushu 2020-05-04 21:47:52 MSK
Your build immediately crashes with a core dump. Illegal instruction.
Comment 9 Zombie Ryushu 2020-05-06 07:18:16 MSK
Program received signal SIGILL, Illegal instruction.
0x000000000056104c in optimal_alloc_size (size=<optimized out>) at stringfields.c:53
53              for (count = 1; size; size >>= 1, count++);
(gdb) bt
#0  0x000000000056104c in optimal_alloc_size (size=<optimized out>) at stringfields.c:53
#1  __ast_calloc_with_stringfields (num_structs=num_structs@entry=1, struct_size=struct_size@entry=120, 
    field_mgr_offset=field_mgr_offset@entry=72, field_mgr_pool_offset=field_mgr_pool_offset@entry=24, pool_size=201, 
    file=file@entry=0x6254c4 "logger.c", lineno=1623, func=0x626790 <__PRETTY_FUNCTION__.17447> "format_log_message_ap")
    at stringfields.c:388
#2  0x00000000005b5a7f in format_log_message_ap (level=level@entry=0, sublevel=sublevel@entry=-1, 
    file=file@entry=0x61752f "utils.c", line=line@entry=2630, 
    function=function@entry=0x617740 <__PRETTY_FUNCTION__.11627> "ast_set_default_eid", callid=callid@entry=0, 
    fmt=0x617418 "Seeding global EID '%s' from '%s' using 'siocgifhwaddr'\n", ap=0x7fffffffbf18) at logger.c:1623
#3  0x00000000005b7b32 in ast_log_full (level=0, sublevel=-1, file=0x61752f "utils.c", line=2630, 
    function=0x617740 <__PRETTY_FUNCTION__.11627> "ast_set_default_eid", callid=0, 
    fmt=0x617418 "Seeding global EID '%s' from '%s' using 'siocgifhwaddr'\n", ap=0x7fffffffbf18) at logger.c:1986
#4  0x00000000005b80d5 in ast_log_ap (level=0, file=0x61752f "utils.c", line=2630, 
    function=0x617740 <__PRETTY_FUNCTION__.11627> "ast_set_default_eid", 
    fmt=0x617418 "Seeding global EID '%s' from '%s' using 'siocgifhwaddr'\n", ap=ap@entry=0x7fffffffbf18) at logger.c:2027
#5  0x00000000005b8198 in ast_log (level=level@entry=0, file=file@entry=0x61752f "utils.c", line=line@entry=2630, 
    function=function@entry=0x617740 <__PRETTY_FUNCTION__.11627> "ast_set_default_eid", 
    fmt=fmt@entry=0x617418 "Seeding global EID '%s' from '%s' using 'siocgifhwaddr'\n") at logger.c:2014
#6  0x0000000000576f0e in ast_set_default_eid (eid=eid@entry=0x8b8008 <ast_eid_default>) at utils.c:2629
#7  0x00000000004ef2de in load_asterisk_conf () at options.c:227
#8  0x0000000000436c31 in main (argc=2, argv=0x7fffffffe368) at asterisk.c:3557
Comment 10 Zombie Ryushu 2020-05-06 08:03:10 MSK
   field_mgr_offset=field_mgr_offset@entry=72, field_mgr_pool_offset=field_mgr_pool_offset@entry=24, pool_size=201, 
    file=file@entry=0x6254c4 "logger.c", lineno=1623, func=0x626790 <__PRETTY_FUNCTION__.17447> "format_log_message_ap")
    at stringfields.c:388
#2  0x00000000005b5a7f in format_log_message_ap (level=level@entry=0, sublevel=sublevel@entry=-1, 
    file=file@entry=0x61752f "utils.c", line=line@entry=2630, 
    function=function@entry=0x617740 <__PRETTY_FUNCTION__.11627> "ast_set_default_eid", callid=callid@entry=0, 
    fmt=0x617418 "Seeding global EID '%s' from '%s' using 'siocgifhwaddr'\n", ap=0x7fffffffbf18) at logger.c:1623
#3  0x00000000005b7b32 in ast_log_full (level=0, sublevel=-1, file=0x61752f "utils.c", line=2630, 
    function=0x617740 <__PRETTY_FUNCTION__.11627> "ast_set_default_eid", callid=0, 
    fmt=0x617418 "Seeding global EID '%s' from '%s' using 'siocgifhwaddr'\n", ap=0x7fffffffbf18) at logger.c:1986
#4  0x00000000005b80d5 in ast_log_ap (level=0, file=0x61752f "utils.c", line=2630, 
    function=0x617740 <__PRETTY_FUNCTION__.11627> "ast_set_default_eid", 
    fmt=0x617418 "Seeding global EID '%s' from '%s' using 'siocgifhwaddr'\n", ap=ap@entry=0x7fffffffbf18) at logger.c:2027
#5  0x00000000005b8198 in ast_log (level=level@entry=0, file=file@entry=0x61752f "utils.c", line=line@entry=2630, 
    function=function@entry=0x617740 <__PRETTY_FUNCTION__.11627> "ast_set_default_eid", 
    fmt=fmt@entry=0x617418 "Seeding global EID '%s' from '%s' using 'siocgifhwaddr'\n") at logger.c:2014
#6  0x0000000000576f0e in ast_set_default_eid (eid=eid@entry=0x8b8008 <ast_eid_default>) at utils.c:2629
#7  0x00000000004ef2de in load_asterisk_conf () at options.c:227
#8  0x0000000000436c31 in main (argc=2, argv=0x7fffffffe368) at asterisk.c:3557
(gdb) bt full
#0  0x000000000056104c in optimal_alloc_size (size=<optimized out>) at stringfields.c:53
        count = 10
#1  __ast_calloc_with_stringfields (num_structs=num_structs@entry=1, struct_size=struct_size@entry=120, 
    field_mgr_offset=field_mgr_offset@entry=72, field_mgr_pool_offset=field_mgr_pool_offset@entry=24, pool_size=201, 
    file=file@entry=0x6254c4 "logger.c", lineno=1623, func=0x626790 <__PRETTY_FUNCTION__.17447> "format_log_message_ap")
    at stringfields.c:388
        mgr = <optimized out>
        pool = <optimized out>
        pool_head = <optimized out>
        pool_size_needed = 233
        allocation = <optimized out>
        p = <optimized out>
        initial_vector_size = <optimized out>
        __PRETTY_FUNCTION__ = "__ast_calloc_with_stringfields"
#2  0x00000000005b5a7f in format_log_message_ap (level=level@entry=0, sublevel=sublevel@entry=-1, 
    file=file@entry=0x61752f "utils.c", line=line@entry=2630, 
    function=function@entry=0x617740 <__PRETTY_FUNCTION__.11627> "ast_set_default_eid", callid=callid@entry=0, 
    fmt=0x617418 "Seeding global EID '%s' from '%s' using 'siocgifhwaddr'\n", ap=0x7fffffffbf18) at logger.c:1623
        logmsg = 0x0
        buf = <optimized out>
        tm = {tm_sec = 1588738632, tm_min = 0, tm_hour = 207965, tm_mday = 0, tm_mon = 0, tm_year = 0, tm_wday = 0, 
          tm_yday = 0, tm_isdst = 0, tm_gmtoff = 0, tm_zone = 0x0, tm_usec = 0}
        now = {tv_sec = 1588738632, tv_usec = 207965}
        res = <optimized out>
        datestring = '\000' <repeats 86 times>, "c7\000\000\000\000\000\000\000\000\260\275\377\377\377\177\000\000\377\377\377\377\377\377\377\377\002\000\000\000\377\177\000\000\000\276\377\377\377\177\000\000\004\000\000\000\000\000\000\000\377\275\377\377\377\177\000\000?\300\377\377\377\177\000\000\254\"Q\004\062\000\000\000\001\200\255\373\000\000\000\000\001B\000\000\000\200\377\377\000\000\000\000\000\000\000\000\002\000\000\000\060", '\000' <repeats 19 times>...
        __PRETTY_FUNCTION__ = "format_log_message_ap"
#3  0x00000000005b7b32 in ast_log_full (level=0, sublevel=-1, file=0x61752f "utils.c", line=2630, 
    function=0x617740 <__PRETTY_FUNCTION__.11627> "ast_set_default_eid", callid=0, 
    fmt=0x617418 "Seeding global EID '%s' from '%s' using 'siocgifhwaddr'\n", ap=0x7fffffffbf18) at logger.c:1986
        logmsg = 0x0
        __PRETTY_FUNCTION__ = "ast_log_full"
#4  0x00000000005b80d5 in ast_log_ap (level=0, file=0x61752f "utils.c", line=2630, 
    function=0x617740 <__PRETTY_FUNCTION__.11627> "ast_set_default_eid", 
    fmt=0x617418 "Seeding global EID '%s' from '%s' using 'siocgifhwaddr'\n", ap=ap@entry=0x7fffffffbf18) at logger.c:2027
Comment 11 Zombie Ryushu 2020-05-14 13:52:09 MSK
I setup a second asterisk server. I can say, with relative certainty that this build at least runs, but there appear to be RTP Transport issues. Nodes can call each other, but, they immediately hang up on each other.
Comment 12 Zombie Ryushu 2020-05-15 14:48:24 MSK
Error loading module 'res_ari_mailboxes.so': /usr/lib64/asterisk/modules/res_ari_mailboxes.so: undefined symbol: stasis_app_mailbox_to_json

Error loading module 'res_stasis_mailbox.so': /usr/lib64/asterisk/modules/res_stasis_mailbox.so: undefined symbol: ast_mwi_mailbox_set_msgs_old
Comment 13 Giovanni Mariani 2020-05-15 17:54:18 MSK
(In reply to Zombie Ryushu from comment #12)
> Error loading module 'res_ari_mailboxes.so':
> /usr/lib64/asterisk/modules/res_ari_mailboxes.so: undefined symbol:
> stasis_app_mailbox_to_json
> 
> Error loading module 'res_stasis_mailbox.so':
> /usr/lib64/asterisk/modules/res_stasis_mailbox.so: undefined symbol:
> ast_mwi_mailbox_set_msgs_old

In the specfile did you already have "%define _disable_ld_no_undefined 1"?
You can try to add: "%define _disable_ld_now 1"... sometime the first statement is not enough.

If the problem is still present after that, you will have to find where (= in what library or object file) the missing symbols are defined and next where to add that library or object file need to be added...
it's a long and slow work, sorry.
Comment 14 Zombie Ryushu 2020-05-17 19:25:14 MSK
the Asterisk build does not build its IAP Module properly. It build the plain module three times.
Comment 15 Zombie Ryushu 2020-05-17 19:25:24 MSK
IMAP
Comment 16 Giovanni Mariani 2020-05-17 19:32:41 MSK
(In reply to Zombie Ryushu from comment #14)
> the Asterisk build does not build its IAP Module properly. It build the
> plain module three times.

Yes, it could happen...
The thing is that the build files consider the various voicemail plugins as a build time alternative: making one excludes the build of others...
This is why in the specfile we do all the tricks we are doing with the library names.
Comment 17 Zombie Ryushu 2020-05-17 19:56:45 MSK
Need to try and fix this pronto. I have the people in #asterisk on IRC crewing me out over this. I have a working Asterisk setup. Voicemail works, but IMAP does not.
Comment 18 Zombie Ryushu 2020-05-17 19:58:11 MSK
I think the actual Build option is MENUSELECT_APPS=app_voicemail_imap
Comment 19 Zombie Ryushu 2020-05-17 20:03:14 MSK
Can you try another build with my suggested changes? This is sorta Priority.
Comment 20 Giovanni Mariani 2020-05-17 21:45:35 MSK
(In reply to Zombie Ryushu from comment #19)
> Can you try another build with my suggested changes? This is sorta Priority.
Unfortunately no...
I'm busy on "real work" just now and in debugging a nasty freeradius failure on startup...
Comment 21 Giovanni Mariani 2020-06-21 21:20:46 MSK
Published 17.5.1 with hopefully resolved the voicemail modules issue...
Closing.