Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 365589

Summary: dev-db/mysql: Doesn't starting.
Product: Gentoo Linux Reporter: Michał Ochociński <michalo1990>
Component: HardenedAssignee: The Gentoo Linux Hardened Team <hardened>
Status: RESOLVED NEEDINFO    
Severity: major    
Priority: Normal    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Michał Ochociński 2011-05-01 16:28:13 UTC
I have compiled dev-db/mysql-5.1.33 and i can't start this. I have configured package with default settings, only root password has been created. I have disabled Pax on mysql's binaries and libraries. I've seen this in dmesg:

[5779293.565168] grsec: From 192.168.70.6: Illegal instruction occurred at 08357eec in /usr/sbin/mysqld[mysqld:21719] uid/euid:60/60 gid/egid:60/60, parent /usr/bin/mysqld_safe[mysqld_safe:21570] uid/euid:0/0 gid/egid:0/0
[5779611.761328] grsec: From 192.168.70.6: Illegal instruction occurred at 08357eec in /usr/sbin/mysqld[mysqld:21871] uid/euid:60/60 gid/egid:60/60, parent /sbin/init[init:1] uid/euid:0/0 gid/egid:0/0
[5779619.825859] grsec: From 192.168.70.6: Illegal instruction occurred at 08357eec in /usr/sbin/mysqld[mysqld:21921] uid/euid:60/60 gid/egid:60/60, parent /sbin/init[init:1] uid/euid:0/0 gid/egid:0/0

shelly ~ # /etc/init.d/mysql start
 * Starting  ...
 * Starting  (/etc/mysql/my.cnf)
 * MySQL NOT started (0)                                                                                       [ !! ]
 * ERROR: mysql failed to start




Reproducible: Always

Steps to Reproduce:
1. Copile mysql 
2. Try to start daemon
3.


Expected Results:  
Mysql's starting well.
Comment 1 Michał Ochociński 2011-05-01 16:29:40 UTC
Portage 2.2.2 (default/linux/x86/2008.0/server, gcc-4.4.5, glibc-2.11.2-r2, 2.6.32-hardened-r31 i686)
=================================================================
System uname: Linux-2.6.32-hardened-r31-i686-VIA_Nehemiah-with-gentoo-2.1.8
Portage Tree: /usr/portage
Portage HEAD: fa42fa44c19e82b098a89ae6cf9656e07d3a7ee7 /usr/portage/.git/refs/heads/funtoo.org
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11-r1
dev-lang/python:     2.6.5-r3
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 2.1.8-r2
sys-apps/openrc:     0.6.5-r1
sys-apps/sandbox:    2.3-r1
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.10.3, 1.11.1
sys-devel/binutils:  2.20.1
sys-devel/gcc:       4.4.5
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.32 (sys-kernel/linux-headers)
Repositories: gentoo Overlay-lokalny
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="*"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=c3 -mtune=generic -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/openvpn/easy-rsa"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=c3 -mtune=generic -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages mini-manifest news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="pl_PL.UTF-8"
LC_ALL="pl_PL.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
LINGUAS="pl"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/root/OVERLAY"
SYNC="git://github.com/funtoo/portage-mini-2010.git"
SYNC_USER="root"
USE="acl alac alsa berkdb bzip2 cdr cli cracklib crypt cups cxx dri dvd dvdr dvdread encode flac fortran gdbm gif gpm hardened iconv ipv6 jpeg lame mad modules mp3 mpeg mudflap ncurses nls nptl nptlonly ogg openmp pam pcre png pppd readline session snmp ssl sysfs tcpd tiff truetype unicode vorbis wavpack win32codecs x86 xml xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="pl" PHP_TARGETS="php5-3" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="openchrome" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, MAKEOPTS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, SYNC_UMASK
Comment 2 Francisco Blas Izquierdo Riera gentoo-dev 2011-05-02 19:17:11 UTC
Is this only happening on hardened? Can you post the uses you are using with mysql? Can you try 5.1.56? Thanks.
Comment 3 Michał Ochociński 2011-05-04 22:22:07 UTC
Yes, i have tried mysql 5.1.56. Here is my use flags:

[ebuild   R   ] dev-db/mysql-5.1.56  USE="community ssl -big-tables -cluster -debug -embedded -extraengine -latin1 -max-idx-128 -minimal -pbxt -perl -profiling (-selinux) -static -test -xtradb" 0 kB
Comment 4 Michał Ochociński 2011-05-04 22:23:34 UTC
This occur only on hardened. Mysql working well on vanilla-sources.
Comment 5 Francisco Blas Izquierdo Riera gentoo-dev 2011-05-06 05:12:58 UTC
Just in case, can you try setting CFLAGS="" for mysql? Maybe the march option is generating instructions your processor won't understand.
Comment 6 Anthony Basile gentoo-dev 2011-05-06 10:23:12 UTC
(In reply to comment #5)
> Just in case, can you try setting CFLAGS="" for mysql? Maybe the march option
> is generating instructions your processor won't understand.

I'm not sure why your getting the illegal instruction.  To catch that you'll probably have to dive into gdb and get a back trace.
Comment 7 Michał Ochociński 2011-05-09 17:13:47 UTC
I have compiled this with CFLAGS="-O0 -march=i686 -pipe", and mysql started well.
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-02-02 03:06:50 UTC
Is that a C3 without the CMOV instruction?