Bug 225779 - SIGILL from _armv8_pmull_probe() when trying to start mysqld
Summary: SIGILL from _armv8_pmull_probe() when trying to start mysqld
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-arm (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-08 22:06 UTC by pru13allan
Modified: 2018-04-04 02:14 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pru13allan 2018-02-08 22:06:35 UTC
Cannot start mysqld with version r328961:
# service mysql-server start
Starting mysql.
limits: NO: No such file or directory
/usr/local/etc/rc.d/mysql-server: WARNING: failed to start mysql

It is fully working on r327173!

When debugging mysqld:
Reading symbols from /usr/local/libexec/mysqld...(no debugging symbols found)...done.
(gdb) run
Starting program: /usr/local/libexec/mysqld 

Program received signal SIGILL, Illegal instruction.
_armv8_pmull_probe () at /usr/src/crypto/openssl/crypto/arm64cpuid.S:43
43      /usr/src/crypto/openssl/crypto/arm64cpuid.S: No such file or directory.
(gdb) backtrace full
#0  _armv8_pmull_probe () at /usr/src/crypto/openssl/crypto/arm64cpuid.S:43
No locals.
#1  0x0000000040d7a1cc in OPENSSL_cpuid_setup () at /usr/src/crypto/openssl/crypto/armcap.c:142
        trigger = <error reading variable trigger (Cannot access memory at address 0xfffff96700000001)>
        e = <optimized out>
        ill_act = {__sigaction_u = {__sa_handler = 0x40d7a294 <ill_handler>, 
            __sa_sigaction = 0x40d7a294 <ill_handler>}, sa_flags = 0, sa_mask = {__bits = {
              4294965607, 4294967295, 4294967295, 4294967295}}}
        oset = {__bits = {0, 0, 0, 0}}
        ill_oact = {__sigaction_u = {__sa_handler = 0x0, __sa_sigaction = 0x0}, sa_flags = 0, 
          sa_mask = {__bits = {0, 0, 0, 0}}}
#2  0x0000000040a92a84 in objlist_call_init (list=<optimized out>, lockstate=<optimized out>)
    at /usr/src/libexec/rtld-elf/rtld.c:2688
        obj = <optimized out>
        elm = 0x40ad2880
        init_addr = 0x40e57038
        index = <error reading variable index (Cannot access memory at address 0x0)>
        saved_msg = <optimized out>
#3  0x0000000040a91abc in _rtld (sp=0xffffffffec10, exit_proc=<optimized out>, 
    objp=<optimized out>) at /usr/src/libexec/rtld-elf/rtld.c:767
        aux_info = {0x0, 0x0, 0x0, 0xffffffffeca0, 0xffffffffecb0, 0xffffffffecc0, 0xffffffffecd0, 
          0xffffffffed00, 0xffffffffece0, 0xffffffffecf0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xffffffffed20, 
          0xffffffffed40, 0xffffffffed50, 0xffffffffed30, 0xffffffffed60, 0xffffffffed70, 
          0xffffffffed80, 0xffffffffed90, 0xffffffffeda0, 0xffffffffed10, 0x0, 0x0}
        buf = '\000' <repeats 1023 times>
        argcp = <optimized out>
        argc = <optimized out>        i = <error reading variable i (Cannot access memory at address 0x0)>
        argv = 0xffffffffec10
        argv0 = <optimized out>
        env = 0xffffffffec20
        mib = <optimized out>
        len = <optimized out>
        fd = <optimized out>
        phdr = <optimized out>
        rtld_argc = <optimized out>
        st = <optimized out>
        dir_enable = <error reading variable dir_enable (Cannot access memory at address 0x0)>
        envp = <optimized out>
        library_path_rpath = <optimized out>
        phnum = <optimized out>
        obj = <optimized out>
        last_interposer = <optimized out>
        entry = <optimized out>
        aux = <optimized out>
        initlist = {stqh_first = 0x40ad2740, stqh_last = 0x40ad2a40}
        preload_tail = <optimized out>
        lockstate = {lockstate = 2, env = {{_sjb = {
                0x00000000000000000000000000000000 <repeats 32 times>}}}}
        kexecpath = <optimized out>
#4  0x0000000040a90018 in .rtld_start () at /usr/src/libexec/rtld-elf/aarch64/rtld_start.S:41
No locals.
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
Comment 1 Michal Meloun freebsd_committer freebsd_triage 2018-02-10 10:29:48 UTC
In short - the SIGILL on startup of OpenSSL library is part of standard operation 'sequence', not a bug.

Longer response - OpenSSL library tests presence of advanced cryptography instructions (PMULL in this case, see interrupted function name))  by this way, having SIGILL handler installed.

Simply skip these startup probes, by pressing 'c' in debugger, a real problem should be observed later if there.

But 'limits: NO: No such file or directory' probably indicates other problem...
Comment 2 pru13allan 2018-02-11 18:41:35 UTC
Thanks for the info on openssl startup behaviour.

My real problem was the new handling of 'limits' in '/etc/rc.subr'.
The mysql service startup program runs 'limits' internally so ${mysql_limits}
is set to YES or NO in config but '/etc/rc.subr' is now expecting ${mysql_limits}
to be arguments to the 'limits' command.
The YES or NO was now treated as the command to start the service and that
gave me the error.

So yes, my initial report is not a bug.