[SOLVED] "Illegal instruction Error" after ec2 instance is launched

Hi.

After restarting our server I suddenly get Illegal instruction error after our ec2 instance is launched.
After that the error keeps showing up like illegal instruction. I am not able to start the asterisk process anymore.

I used gdb command and get follow error.
What would be causing this error and how can I avoid this?

technocraft-asterisk1 tmp # gdb -c /tmp/core.5031 /usr/sbin/asterisk
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-110.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/sbin/asterisk...done.
[New LWP 5031]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
Core was generated by `/usr/sbin/asterisk -f -vvvg -c'.
Program terminated with signal 4, Illegal instruction.
#0  0x00000000004d9abf in cfmtime_new (who_asked=0x6029cd "", 
    filename=0x7ffea0d32dc0 "/etc/asterisk/asterisk.conf") at config.c:1555
1555            cfmtime = ast_calloc(1,
(gdb) bt full
#0  0x00000000004d9abf in cfmtime_new (who_asked=0x6029cd "", 
    filename=0x7ffea0d32dc0 "/etc/asterisk/asterisk.conf") at config.c:1555
        dst = <optimized out>
#1  config_text_file_load (database=<optimized out>, table=<optimized out>, filename=<optimized out>, 
    cfg=<optimized out>, flags=..., suggested_include_file=0x6029cd "", who_asked=0x6029cd "") at config.c:2131
        i = <optimized out>
        fn = "/etc/asterisk/asterisk.conf", '\000' <repeats 228 times>
        buf = '\000' <repeats 4536 times>...
        new_buf = <optimized out>
        comment_p = <optimized out>
        process_buf = <optimized out>
        f = <optimized out>
        lineno = <optimized out>
        comment = <optimized out>
        nest = {0 <repeats 128 times>}
        cat = 0x0
        count = <optimized out>
        statbuf = {st_dev = 51713, st_ino = 21948149, st_nlink = 1, st_mode = 33204, st_uid = 1000, st_gid = 1000, 
          __pad0 = 0, st_rdev = 0, st_size = 5423, st_blksize = 4096, st_blocks = 16, st_atim = {
            tv_sec = 1537347388, tv_nsec = 652982529}, st_mtim = {tv_sec = 1535593197, tv_nsec = 0}, st_ctim = {
            tv_sec = 1536888686, tv_nsec = 925286233}, __unused = {0, 0, 0}}
        cfmtime = <optimized out>
        cfinclude = <optimized out>
        last_var = <optimized out>
---Type <return> to continue, or q <return> to quit---
        last_cat = <optimized out>
        comment_buffer = 0x0
        lline_buffer = 0x0
        glob_ret = <optimized out>
        globbuf = {gl_pathc = 1, gl_pathv = 0xadb1d0, gl_offs = 0, gl_flags = 3088, gl_closedir = 0x0, 
          gl_readdir = 0x0, gl_opendir = 0x0, gl_lstat = 0x0, gl_stat = 0x0}
        __PRETTY_FUNCTION__ = "config_text_file_load"
#2  0x00000000004d7da9 in ast_config_internal_load (
    filename=filename@entry=0x601b34 "/etc/asterisk/asterisk.conf", cfg=cfg@entry=0xadb170, flags=flags@entry=..., 
    suggested_include_file=suggested_include_file@entry=0x6029cd "", who_asked=who_asked@entry=0x6029cd "")
    at config.c:3123
        db = "\001\000\000\000\000\000\000\000\364\027gJd\177\000\000\060V・\376\177\000\000`\221\330\240\376\177\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\312\033\260\000\000\000\000\310\037gJd\177\000\000`V・\376\177\000\000\340V・\376\177\000\000(o\300\002\000\000\000\000\300\221\330\240\376\177\000\000\360W・\376\177\000\000\340\017\000\000\000\000\000\000\000\020\000\000\000\000\000\000=", '\000' <repeats 22 times>, "\377sk\000-f\000-vvvg\000-c\000T", '\000' <repeats 25 times>, "\377", '\000' <repeats 22 times>...
        table = '\000' <repeats 64 times>, "\341\247,_\001\200\377\377\004\000\000\000\000\000\000\000\001", '\000' <repeats 15 times>, "\061\000\000\000[\000\000\000 X・\376\177", '\000' <repeats 18 times>, "n\000\000\000w", '\000' <repeats 11 times>, "\037X・\376\177\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\230\251\210Jd\177\000\000|\000\000\000\000\000\000\000\220Y\206Jd\177\000\000\340W・\376\177\000\000\000\000@"...
        loader = <optimized out>
        result = <optimized out>
        __PRETTY_FUNCTION__ = "ast_config_internal_load"
#3  0x00000000004daab9 in ast_config_load2 (filename=filename@entry=0x601b34 "/etc/asterisk/asterisk.conf", 
---Type <return> to continue, or q <return> to quit---
    who_asked=0x6029cd "", flags=...) at config.c:3144
        result = <optimized out>
#4  0x0000000000451707 in ast_readconfig () at asterisk.c:3543
        cfg = <optimized out>
        v = <optimized out>
        config = 0x601b34 "/etc/asterisk/asterisk.conf"
        hostname = '\000' <repeats 63 times>
        found = {dbdir = 0, keydir = 0}
        live_dangerously = 0
        __PRETTY_FUNCTION__ = "ast_readconfig"
#5  0x00000000004342bd in main (argc=<optimized out>, argv=0x7ffea0d36c38) at asterisk.c:4065
        c = <optimized out>
        xarg = 0x0
        x = 4
        isroot = 1
        rundir_exists = 0
        runuser = 0x0
        rungroup = 0x0
        remotesock = 0x0
        l = {rlim_cur = 140068723929424, rlim_max = 2288381081413}
        __PRETTY_FUNCTION__ = "main"
(gdb) frame 0
#0  0x00000000004d9abf in cfmtime_new (who_asked=0x6029cd "", 
    filename=0x7ffea0d32dc0 "/etc/asterisk/asterisk.conf") at config.c:1555
1555            cfmtime = ast_calloc(1,

I solved it by myself.
Here is what I did.

I added --disable BUILD_NATIVE option to “make menuselect”.
And I installed Asterisk again.
This resolved the problem.