Asterisk crash on CentOS 7.4

Hi,

I see a crash with Asterisk 13.13-cert1 on CentOS 7.4 very early in the startup process:

(gdb) run -cvvv
Starting program: /sbin/asterisk -cvvv
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Program received signal SIGILL, Illegal instruction.
0x00000000005bfd19 in tzload ()
Missing separate debuginfos, use: debuginfo-install foo.x86_64
(gdb) bt
#0  0x00000000005bfd19 in tzload ()
#1  0x00000000005c0bb7 in ast_tzset ()
#2  0x00000000005c3a18 in ast_localtime ()
#3  0x000000000052d6d6 in ast_log_full ()
#4  0x000000000052f4e0 in ast_log_callid ()
#5  0x000000000052f72f in __ast_verbose_ap ()
#6  0x000000000052fa68 in __ast_verbose ()
#7  0x00000000004532cb in print_intro_message ()
#8  0x0000000000434cdf in main ()

The problem does not occur with CentOS 7.3.

I ran strace with CentOS 7.3 and I see this:

access("/etc/localtime", R_OK)          = 0
open("/etc/localtime", O_RDONLY)        = 3
read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0\0"..., 41992) = 1892
close(3)                                = 0
open("/usr/share/zoneinfo/posixrules", O_RDONLY) = 3
read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\4\0\0\0\0"..., 41992) = 3519
close(3)                                = 0
gettid()                                = 27501
futex(0x8a1ff0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
write(1, "Asterisk certified/13.13-cert1, "..., 84Asterisk certified/13.13-cert1, Copyright (C) 1999 - 2014, Digium, Inc. and others.
) = 84
write(1, "Created by Mark Spencer <markste"..., 46Created by Mark Spencer markster@digium.com
) = 46
write(1, "Asterisk comes with ABSOLUTELY N"..., 83Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.

On CentOS 7.4, asterisk closes /etc/localtime, but then crashes:

access("/etc/localtime", R_OK)          = 0
open("/etc/localtime", O_RDONLY)        = 3
read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0\0\0\6\0\0\0\0"..., 41992) = 3559
close(3)                                = 0
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPN, si_addr=0x5bfd19} ---
+++ killed by SIGILL (core dumped) +++
Illegal instruction

I tried on different hardware, but Asterisk 13.13-cert1 always crashed with CentOS 7.4.
Any idea what the problem may be?

Regards,
Ouss

Are you compiling from source? Did you try with build native disabled in make menuselect?

Yes, I compile from source. Seems like he stumbles over the vxorpd instruction:

Program received signal SIGILL, Illegal instruction.
0x00000000005e5302 in timesub ()
Missing separate debuginfos, use: debuginfo-install foo.x86_64
(gdb) bt
#0  0x00000000005e5302 in timesub ()
#1  0x00000000005e47cb in localsub ()
#2  0x00000000005e4866 in ast_localtime ()
#3  0x000000000054271e in ast_log_full ()
#4  0x00000000005432ef in ast_log_callid ()
#5  0x0000000000543691 in __ast_verbose_ap ()
#6  0x0000000000543771 in __ast_verbose ()
#7  0x000000000045ab9c in print_intro_message ()
#8  0x000000000045c514 in asterisk_daemon ()
#9  0x000000000045c14b in main ()
(gdb) disassemble 0x00000000005e5300, +32
Dump of assembler code from 0x5e5300 to 0x5e5320:
   0x00000000005e5300 <timesub+927>:    add    %eax,(%rax)
=> 0x00000000005e5302 <timesub+929>:    vxorpd %xmm0,%xmm0,%xmm0
   0x00000000005e5306 <timesub+933>:    vcvtsi2sd %rax,%xmm0,%xmm0
   0x00000000005e530b <timesub+938>:    vmovsd 0x8d2c5(%rip),%xmm1        # 0x6725d8
   0x00000000005e5313 <timesub+946>:    vaddsd %xmm1,%xmm0,%xmm0
   0x00000000005e5317 <timesub+950>:    vcvttsd2si %xmm0,%rax
   0x00000000005e531c <timesub+955>:    mov    %rax,-0x50(%rbp)
End of assembler dump.

The instruction seems to be related to the avx CPU feature.

I did not yet try to compile with build native disabled.