Bug #96982 error: prctl was not declared in this scope
Submitted: 24 Sep 2019 3:37 Modified: 26 Sep 2019 8:08
Reporter: George Ma Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.7.16 OS:Any
Assigned to: CPU Architecture:Any

[24 Sep 2019 3:37] George Ma
The mysqld process status file on /poc/[pid] can not be read, for example, the stat of io file is :

-r--------  1 root  root  0 Sep 11 15:43 io

which means only the owner can read it.

How to repeat:
Build on ARM: Oracle Linux Server release 7.4

Suggested fix:
The same issue has been fixed in in 8.0.12. (https://bugs.mysql.com/bug.php?id=90642)
[24 Sep 2019 11:59] MySQL Verification Team
Hi Mrs. show,

Thank you for your bug report.

I must admit that we do not have almost any info which is necessary in order to proceed further on this report.

First of all, are you using our binary or have you built your own. If it is the second option, then please try our own binary package first. Are you using a package that is downloaded from our site.

Second, I do not see any connection in the problem with the bug # 90642.

Next, please specify correctly the location of the .pid file. Are you reporting a problem with a PID file at all. That file does not look like PID file.

Next, you should specify a correct user under which our server will be running.

Last,  but not least, please use our latest releases. We shall not hunt the bugs in ancient releases !!!!
[24 Sep 2019 14:00] Terje Røsten

Thanks for your report.

Starting MySQL as root user with --user=mysql option
I can't see any difference between MySQL 5.7 and 8.0:

$ ls -l /proc/{10405,9734}/{exe,io}
lrwxrwxrwx 1 root root 0 sep.  24 15:48 /proc/10405/exe -> /export/home/my/server_release_commercial_8.0.18/bin/mysqld
-r-------- 1 root root 0 sep.  24 15:49 /proc/10405/io
lrwxrwxrwx 1 root root 0 sep.  24 15:43 /proc/9734/exe -> /export/home/my/server_release_commercial_5.7.28/bin/mysqld
-r-------- 1 root root 0 sep.  24 15:43 /proc/9734/io

$ ps u -p 10405,9734 
mysql     9734  0.0  1.1 1380744 187780 pts/0  Sl   15:43   0:00 /export/home/my/5.7/bin/mysqld --no-defaults ...
mysql    10405  0.5  2.4 2091452 394904 pts/0  Sl   15:48   0:02 /export/home/my/8.0/bin/mysqld --no-defaults ...

You mean /proc/$pid/io should be owned by mysql account in such case?
[26 Sep 2019 8:08] Terje Røsten
Verified by following script:

#! /bin/bash

for ver in 5.7 8.0 ; do    
    port=$(echo $ver | tr -d .)
    pushd $ver
    bin/mysqld --no-defaults --datadir=/tmp/$ver --user=mysql --basedir=$(pwd) --core-file --log-error=/tmp/$ver/error.log \
    bin/mysqld --no-defaults --datadir=/tmp/$ver --user=mysql --basedir=$(pwd) --core-file --log-error=/tmp/$ver/error.log \
	       --port=$port$port --socket=/tmp/$ver/m.sock --core-file &
    sleep 5
    ls -l /proc/$(cat /tmp/$ver/*.pid)/{io,exe}

Which has output like this:

lrwxrwxrwx 1 root root 0 sep.  26 10:01 /proc/12902/exe -> /my/server_release_commercial_5.7.28/bin/mysqld
-r-------- 1 root root 0 sep.  26 10:01 /proc/12902/io
lrwxrwxrwx 1 mysql mysql 0 sep.  26 10:01 /proc/12989/exe -> /my/server_release_commercial_8.0.18/bin/mysqld
-r-------- 1 mysql mysql 0 sep.  26 10:01 /proc/12989/io

Note: /proc/sys/fs/suid_dumpable must be set to 0:

$ cat /proc/sys/fs/suid_dumpable 

If 1 or 2 (with correct settings for core dumps), core dumps is enabled regardless.