After emerging dev-db/mysql with Gentoo's Safe CFLAGS for HPPA 2.0 enabled in /etc/make.conf the mysqld daemon crashes on startup (signal 11, segmentation fault). After removing the HPPA 2.0 specific CFLAGS -mschedule=8000 and -march=2.0 and rebuilding dev-db/mysql the mysqld daemon starts without segmentation fault. I testet this with several mysql-4.1.xx and mysql-5.0.xx ebuilds. The result was always the same. Reproducible: Always Steps to Reproduce: 1. Use HPPA 2.0 Safe CFLAGS in /etc/make.conf 2. emerge dev-db/mysql 3. emerge --config dev-db/mysql Actual Results: dev-db/mysql gets compiled with -mschedule=8000 and -march=2.0. Mysqld daemon crashes with segmentation fault. Expected Results: Modify dev-db/mysql ebuild or mysqld.eclass to filter the HPPA 2.0 CFLAGS -mschedule=8000 and -march=2.0 so that dev-db/mysql gets compiled without these CFLAGS
Created attachment 169540 [details] emerge --info Here is my emerge --info. The line in question is CFLAGS="-O2 -mschedule=8000 -march=2.0 -fomit-frame-pointer -pipe" After removing -mschedule=8000 and -march=2.0 and rebuilding dev-db/mysql the mysql daemon starts up fine.
Assigning to mysql, but hppa@g.o may have some input to share here?
hppa team: if you have actual insights as to why this is, go for it, but HPPA hardware is out of testing ability. René Petzold: I strongly suggest that you start generating debug backtraces etc that actually show where it's segfaulting.
Created attachment 169694 [details] GDB mysqld backtrace I followed http://www.gentoo.org/doc/en/bugzilla-howto.xml#doc_chap2 to generate a debug backtrace of the segfaulting mysqld. I rebuilt dev-db/mysql with additional -ggdb c(xx)flag before running gdb. Hope this helps. Don't know, if this is right. Never really used gdb before.
I see this: "--datadir=/srv/mysql" Could you please repeat with a totally stock mysql configuration under Gentoo? move all your databases and /etc/mysql/my.cnf custom stuff out the way, then do: emerge mysql && emerge --config mysql && /etc/init.d/mysql start
Thanks for your effort to narrow down the problem, however this is probably yet another gcc bug. I'll dig further into this during the weekend. I'm quite sure it's easily reproducible.
(In reply to comment #5) > I see this: "--datadir=/srv/mysql" > Could you please repeat with a totally stock mysql configuration under Gentoo? > move all your databases and /etc/mysql/my.cnf custom stuff out the way, then > do: > emerge mysql && emerge --config mysql && /etc/init.d/mysql start > Same result: mysqld is segfaulting. I tried this before. Running mysqld in gdb with all the additional options was to try to mimic the init script startup.
Hey Rene, I've tried to repro but I wasn't successful. I've compiled mysql with the same cflags and same gcc but I haven't had the problem. Looking at the code pointed out by your backtrace, it does seem like a possible gcc bug. I'm thinking you may be running into #203543. When did you compiled your GCC ? Can you recompile it again and see if you have a difference ? Cheers, Guy
I have tested and run (continuously) every mysql version I ever keyworded, and I haven't seen anything like this.
Hi Guy, br98p153 ~ # genlop sys-devel/gcc * sys-devel/gcc Mon Sep 22 14:51:43 2008 >>> sys-devel/gcc-4.1.2 Mon Sep 29 13:21:48 2008 >>> sys-devel/gcc-4.2.4 I compiled sys-devel/gcc 1 month ago. So the path for #203543 should be included. I will recompile it and maybe even try the old sys-devel/gcc-4.1.2 since I ran into problems with sys-devel/gcc-4.3.1.
I switched from gcc-4.2.4 back to gcc-4.1.2, recompiled dev-db/mysql-5.0.60-r1 with Safe CFLAGS and now it works. The mysqld daemon starts up fine. No segmentation faults.
I can confirm this and also did some tests: dev-db/mysql-5.0.60-r1 on HPPA with glibc-2.7-r2 gcc-4.1.2 CFLAGS = CXXFLAGS = "-O2 -march=2.0" --> works gcc-4.2.4 CFLAGS = CXXFLAGS = "-O2 -march=2.0" --> segfaults gcc-4.2.4 CFLAGS="-O2 -march=2.0" CXXFLAGS="-O2 -march=1.1" --> works gcc-4.2.4 CFLAGS="-O2 -march=2.0" CXXFLAGS="-O1 -march=2.0" --> works summary: gcc-4.1.2 isn't affected, gcc-4.2.4 is. CFLAGS doesn't affect the problem. CXXFLAGS need optimization lower than -O2 *OR* -march lower than 2.0 to build a working mysql. (seems just like bug #228287)
(In reply to comment #9) > I have tested and run (continuously) every mysql version I ever keyworded, and > I haven't seen anything like this. The difference being that I haven't seriously put gcc-4.2.4 to the test. I am rather doubting 4.2.4 will ever go stable for HPPA. Maybe it's better to focus on getting 4.3.2 working.
Ok, so it's a GCC issue, not a mysql one. Removing mysql-bugs from the tracking
Also confirmed the same issue with dev-db/mysql-5.0.70 on HPPA
(In reply to comment #13) > Maybe it's better to focus on getting 4.3.2 working. dev-db/mysql-5.0.60-r1 on HPPA with glibc-2.7-r2 gcc-4.3.2 CFLAGS = CXXFLAGS = "-O2 -march=2.0" --> works gcc-4.3.2 CFLAGS="-O2 -march=2.0" CXXFLAGS="-O2 -march=1.1" --> works gcc-4.3.2 CFLAGS="-O2 -march=2.0" CXXFLAGS="-O1 -march=2.0" --> works seems like we have the very same issue in gcc-4.2 and 4.3
sorry for the typo. with CFLAGS = CXXFLAGS = "-O2 -march=2.0" it segfaults.
This is most probably the same issue than #228287. Patch is on it's way to the tree.
So now we need to wait until gcc-4.3.2-r3 appears in the portage tree.
This has been added to 4.2.4-r1. We're currently in the process of testing it and we'll mark it stable ASAP. 4.3 isn't ready yet to be stable. Please let us know if you encounter problems with 4.2.4-r1.
Used the same flags that failed above, but upgraded mysql to 5.0.70-r1 and gcc to 4.2.4-r1. It's happily crunching queries right now. Thanks :) CFLAGS=CXXFLAGS="-pipe -O2 -march=2.0" dev-db/mysql-5.0.70-r1 USE="perl ssl -berkdb -big-tables -cluster -debug -embedded -extraengine -latin1 -max-idx-128 -minimal (-selinux) -static"
Mysql tests working as well for me. emerge --info attached otherwise JeR will complain again :) Portage 2.1.6.4 (default/linux/hppa/2008.0, gcc-4.2.4, glibc-2.7-r2, 2.6.28 parisc) ================================================================= System uname: Linux-2.6.28-parisc-PA8600_-PCX-W+-with-glibc2.2 Timestamp of tree: Unknown app-shells/bash: 3.2_p39 dev-lang/python: 2.4.4-r13, 2.5.2-r7 dev-python/pycrypto: 2.0.1-r6 dev-util/cmake: 2.4.6-r1 sys-apps/baselayout: 1.12.11.1 sys-apps/sandbox: 1.2.18.1-r2 sys-devel/autoconf: 2.13, 2.63 sys-devel/automake: 1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2 sys-devel/binutils: 2.18-r3 sys-devel/gcc-config: 1.4.0-r4 sys-devel/libtool: 1.5.26 virtual/os-headers: 2.6.27-r2 ACCEPT_KEYWORDS="hppa" CBUILD="hppa2.0-unknown-linux-gnu" CFLAGS="-O2 -pipe -march=2.0" CHOST="hppa2.0-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/share/X11/xkb" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d" CXXFLAGS="-O2 -pipe -march=2.0" DISTDIR="/usr/portage/distfiles" FEATURES="distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://ftp.snt.utwente.nl/pub/os/linux/gentoo" LDFLAGS="-Wl,-O1" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="X apache2 berkdb bzip2 cli cracklib crypt cups firefox foomaticdb gdbm gpm gtk hppa iconv imlib ipv6 isdnlog jpeg libwww midi mudflap ncurses nls nptl nptlonly openmp pam pcre pcsc-lite perl pic postgres pppd python readline reflection server session smartcard spell spl ssl sysfs tcpd unicode usb xml2 xmlrpc xorg xulrunner zlib" 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 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
With sys-devel/gcc-4.2.4-r1 it's OK...
Same here. mysql-5.0.72-r1 runs fine compiled with gcc-4.2.4-r1 and CFLAGS=CXXFLAGS="-O2 -mschedule=8000 -march=2.0 -fomit-frame-pointer -pipe"
Works with sys-devel/gcc-4.2.4-r1