GCC emits 3DNow!-specific instruction for __builtin_prefetch
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | gcc |
Invalid
|
Medium
|
||
| | gcc-4.1 (Ubuntu) |
Undecided
|
Unassigned | ||
| | Edgy |
Undecided
|
Unassigned | ||
| | mysql-dfsg-5.0 (Ubuntu) |
Undecided
|
Matthias Klose | ||
| | Edgy |
High
|
Matthias Klose | ||
Bug Description
Binary package hint: mysql-server-5.0
[update for SRU / mysql part:
The mysql server in the package fails to run on EMT64 hardware due to a misconfiguration in GCC generating a amd64 specific instruction. Work around this in the mysql package by explicitely building for generic x86_64.
debdiff of the proposed fix is attached to this report.
]
I upgraded from Dapper Drake ( amd64) to the Edgy Eft for testing on an SMP Intel Xeon ( em64t ). During the course of the upgrade the mysql package could not successfully configure itself. Whenever the installation scripts tried launching mysqld, it would die immedietly. If I removed the contents of /var/lib/mysql, the daemon would come up and initiliaze itself, but it would always fail to start up if /var/lib/mysql was populated.
The following error was printed to the system logs:
Oct 17 14:31:27 tinman mysqld_safe[30035]: started
Oct 17 14:31:27 tinman mysqld[30038]: mysqld got signal 4;
Oct 17 14:31:27 tinman mysqld[30038]: This could be because you hit a bug. It is also possible that this binary
Oct 17 14:31:27 tinman mysqld[30038]: or one of the libraries it was linked against is corrupt, improperly built,
Oct 17 14:31:27 tinman mysqld[30038]: or misconfigured. This error can also be caused by malfunctioning hardware.
Oct 17 14:31:27 tinman mysqld[30038]: We will try our best to scrape up some info that will hopefully help diagnose
Oct 17 14:31:27 tinman mysqld[30038]: the problem, but since we have already crashed, something is definitely wrong
Oct 17 14:31:27 tinman mysqld[30038]: and this may fail.
Oct 17 14:31:27 tinman mysqld[30038]:
Oct 17 14:31:27 tinman mysqld[30038]: key_buffer_size=0
Oct 17 14:31:27 tinman mysqld[30038]: read_buffer_
Oct 17 14:31:27 tinman mysqld[30038]: max_used_
Oct 17 14:31:27 tinman mysqld[30038]: max_connections=100
Oct 17 14:31:27 tinman mysqld[30038]: threads_connected=0
Oct 17 14:31:27 tinman mysqld[30038]: It is possible that mysqld could use up to
Oct 17 14:31:27 tinman mysqld[30038]: key_buffer_size + (read_buffer_size + sort_buffer_
Oct 17 14:31:27 tinman mysqld[30038]: bytes of memory
Oct 17 14:31:27 tinman mysqld[30038]: Hope that's ok; if not, decrease some variables in the equation.
Oct 17 14:31:27 tinman mysqld[30038]:
Oct 17 14:31:27 tinman mysqld_safe[30045]: ended
Oct 17 14:31:41 tinman /etc/init.
Oct 17 14:31:41 tinman /etc/init.
Oct 17 14:31:41 tinman /etc/init.
Oct 17 14:31:41 tinman /etc/init.
Oct 17 14:31:41 tinman /etc/init.
Oct 17 14:31:41 tinman /etc/init.
I've since downgraded the mysql-server-5.0 package to the -5.0_5.
| Greg Gilbert (greg-treke) wrote : | #1 |
| Greg Gilbert (greg-treke) wrote : | #2 |
A gdb backtrace with debugging information:
Program received signal SIGILL, Illegal instruction.
[Switching to Thread 47143187332656 (LWP 27473)]
rec_copy_
1139 UNIV_PREFETCH_
Current language: auto; currently c
(gdb) bt
#0 rec_copy_
at rem0rec.c:1139
#1 0x000000000071dd80 in dict_tree_
buf=
#2 0x00000000007774fd in btr_pcur_
#3 0x0000000000729f32 in dict_check_
#4 0x000000000071501b in innobase_
#5 0x0000000000676d05 in innobase_init () at ha_innodb.cc:1417
#6 0x000000000066b5d7 in ha_init () at handler.cc:485
#7 0x00000000005a6679 in init_server_
#8 0x00000000005aa187 in main (argc=<value optimized out>, argv=<value optimized out>) at mysqld.cc:3425
| Richard Brooklyn (ribs) wrote : | #3 |
I can confirm this bug. I've been tearing my hair out for a little while trying to figure out why a reboot screwed up the mysql server.
It does indeed work on the inital run, but fails after that. This is on amd64.
| joostvdl (joost-trisum) wrote : | #4 |
Same problem here after an upgrade from 6.04 to 6.10. Also on AMD64 install.
There are more people with this problem:
http://
| gabi.braga (gabi-braga) wrote : | #5 |
I have the same problem on IBM server 2x XEON - kernel-amd64 . Temporary I forced version from dapper to work Mysql .
| Greg Gilbert (greg-treke) wrote : | #6 |
I'm wondering, are all of you who are having problems using an intel chip or are some of you using AMD? MySQL works just fine on my home and work machines which are Athlon 64s running Ubuntu AMD64. My Intel based server is the only one having the problem.
| Brian Levinsen (Eldaria) (eldaria) wrote : | #7 |
I am not using the AMD, but Intel Pentium D.
| joostvdl (joost-trisum) wrote : | #8 |
Als Intel Pentium
| codelad (codelad) wrote : | #9 |
Same issue - with Intel Pentium 4.
| bhuvan (d-bhuvan) wrote : | #10 |
I have the same issue too. I recently upgraded from dapper to edgy and mysql refused to start. I too have intel 64 bit processor. It seems that the problem is a architecture dependent one.
| Tim Brom (timbrom) wrote : | #11 |
Not to post a me too or anything, but I am having the exact same issue, also on an intel 64 bit processor.
| Changed in mysql-dfsg-5.0: | |
| status: | Unconfirmed → Confirmed |
| bhuvan (bhuvankris) wrote : Re: mysql-server-5.0 5.0.24a-9 receives signal 4 on startup when installed on intel 64 bit platform | #12 |
well if its about the problem i think i said what i know to strengthen the topic. If its about the language i correct the mistake.
| Seppe vanden Broucke (macuyiko) wrote : | #13 |
I can confirm this bug, also using an IBM Xeon server.
| usemodj (usemodj) wrote : | #14 |
I have same issue
on Dell Intel Xeon IA64 (dual CPU) + Ubuntu 6.10 Edgy Eft
=== /var/log/daemon.log ======
Nov 15 21:20:57 ubuntu-dell mysqld_safe[3540]: started
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: mysqld got signal 4;
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: This could be because you hit a bug. It is also possible that this binary
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: or one of the libraries it was linked against is corrupt, improperly built,
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: or misconfigured. This error can also be caused by malfunctioning hardware.
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: We will try our best to scrape up some info that will hopefully help diagnose
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: the problem, but since we have already crashed, something is definitely wrong
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: and this may fail.
Nov 15 21:20:57 ubuntu-dell mysqld[3543]:
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: key_buffer_size=0
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: read_buffer_
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: max_used_
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: max_connections=100
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: threads_connected=0
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: It is possible that mysqld could use up to
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: key_buffer_size + (read_buffer_size + sort_buffer_
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: bytes of memory
Nov 15 21:20:57 ubuntu-dell mysqld[3543]: Hope that's ok; if not, decrease some variables in the equation.
Nov 15 21:20:57 ubuntu-dell mysqld[3543]:
Nov 15 21:20:57 ubuntu-dell mysqld_safe[3549]: ended
Nov 15 21:20:57 ubuntu-dell ntpdate[2957]: step time server 82.211.81.145 offset -0.823444 sec
Nov 15 21:21:10 ubuntu-dell /etc/init.
Nov 15 21:21:10 ubuntu-dell /etc/init.
Nov 15 21:21:10 ubuntu-dell /etc/init.
Nov 15 21:21:10 ubuntu-dell /etc/init.
| Dagfinn Ilmari Mannsåker (ilmari) wrote : | #15 |
This is a GCC bug, it emits the 3DNow! instruction prefetchw instead of the generic prefetcht0 for __builtin_prefetch.
See http://
| Changed in gcc: | |
| status: | Unknown → Rejected |
| myles carrick (mylescarrick) wrote : | #16 |
I'm getting the same on the same hardware...
dual Xeons...
installs without error, but even an immediate restart spits the above error to daemon.log
| Lucas Nussbaum (lucas) wrote : | #17 |
Hi,
Using this simple test program:
int
main (int argc, char *argv[])
{
int i;
int test[8];
__builtin_
for (i = 0; i < 8; i++)
{
test[i] = i;
}
return 0;
}
And compiling using gcc -S test.c, the generated .s file includes the following assembly code:
.LCFI1:
movl %edi, -52(%rbp)
movq %rsi, -64(%rbp)
leaq -48(%rbp), %rax
prefetchw (%rax)
movl $0, -4(%rbp)
jmp .L2
.L3:
prefetchw is a 3Dnow! instruction, not available on EMT64.
| Greg Gilbert (greg-treke) wrote : | #18 |
Thanks for the test case Lucas. Although it's probably obvious, I just verified that your test application generates an illegal instruction error on the original machine I reported the bug for.
| Rob Moore (roborative) wrote : | #19 |
Can anyone provide some details on the status of this bug? Is it just a matter of rebuilding the package with a different switch (which seems like a simple fix) or is it really dependent on an upstream package change? Thanks!
| Matthias Klose (doko) wrote : | #20 |
fixed in 4.1.1-21ubuntu1
| Changed in gcc-4.1: | |
| status: | Confirmed → Fix Released |
| Florian Zschocke (zschocke) wrote : | #21 |
4.1.1-21ubuntu1 is only available in feisty so far. This is a fundamental flaw, so when will this be fixed in edgy?
What other packages were compiled with the buggy compiler? How can I be sure that other packages don't start crashing on me because of that?
| Greg Gilbert (greg-treke) wrote : | #22 |
Is there a special process we need to go through to request a backport for this? MySQL as packaged in the repository is still nonfunctional on Intel's xeon cpus.
| LGB [Gábor Lénárt] (lgb) wrote : | #23 |
I've also got problem with MySQL on EMT64, I've reported it as #76858
Also the mentioned test program generates on SIGILL on that machine, but not on AMD64. I think it's a fatal bug, since it renders "edgy server" unusable on EMT64 (well at least if you want to use MySQL). Also, other packages may be affected as well compiled with this gcc in the distributin, I think ...
| Dean Sas (dsas) wrote : | #24 |
Greg: The backport process is here: https:/
| Matthias Klose (doko) wrote : | #25 |
Proposing a SRU for edgy (mysql server doesn't run on EMT64 hardware), fixed on feisty with a mysql rebuild with a fixed compiler. Choosing for edgy a minimal fix to just rebuild the mysql package.
mysql-dfsg-5.0 (5.0.24a-9ubuntu1) edgy-proposed; urgency=low
* On amd64, build using -march=x86-64, avoiding 3Dnow! instructions.
Ubuntu #66702.
-- Matthias Klose <email address hidden> Thu, 15 Feb 2007 17:25:22 +0000
packages for amd64 can be found at
http://
validated that the amd64 specific instruction is not generated.
| description: | updated |
| Martin Pitt (pitti) wrote : | #26 |
Matthias, this looks fine. Please go ahead and upload to edgy-proposed.
Does this affect mysql in Feisty? Please update the feisty task status accordingly.
Do we need to fix gcc-4.1 in edgy? Please update the task status.
Thanks!
| Changed in mysql-dfsg-5.0: | |
| status: | Unconfirmed → In Progress |
| assignee: | nobody → doko |
| Matthias Klose (doko) wrote : | #27 |
mysql-dfsg-5.0 fixed in feisty.
| Changed in mysql-dfsg-5.0: | |
| assignee: | nobody → doko |
| status: | Unconfirmed → Fix Released |
| Changed in gcc-4.1: | |
| status: | Unconfirmed → Confirmed |
| Matthias Klose (doko) wrote : | #28 |
Martin, in Oslo the SRU team decided not to upload gcc-4.1 to edgy.
| Martin Pitt (pitti) wrote : | #29 |
Accepted mysql edgy-proposed upload, please go ahead with QA testing.
| Changed in mysql-dfsg-5.0: | |
| status: | In Progress → Fix Committed |
| Martin Pitt (pitti) wrote : | #30 |
Closing gcc-4.1/edgy task as per Matthias' comment.
| Changed in gcc-4.1: | |
| status: | Confirmed → Rejected |
| Matthias Klose (doko) wrote : | #31 |
The package is now available in edgy-proposed. QA-Team notified via sflaw; I don't own EMT64 hardware, so I cannot test it myself.
| Greg Gilbert (greg-treke) wrote : | #32 |
I installed the package from edgy-proposed and it has addressed the original problem of Mysql not starting. So far mysqld is running smoothly. Thank you all very much for getting this fixed.
| alxjvr (alxjvr) wrote : | #33 |
yes! works for me now too! thanks a lot
| Matthias Klose (doko) wrote : | #34 |
ubuntu-sru, please lets update that for edgy-updates
| Changed in mysql-dfsg-5.0: | |
| importance: | Undecided → High |
| Martin Pitt (pitti) wrote : | #35 |
Matthias, patch looks fine. Please go ahead and upload.
| Matthias Klose (doko) wrote : | #36 |
uploaded; keeping this report still open, until #100083 is commented.
| Martin Pitt (pitti) wrote : | #37 |
Accepted into edgy-updates, thank you!
| Changed in mysql-dfsg-5.0: | |
| status: | Fix Committed → Fix Released |
| Changed in gcc: | |
| importance: | Unknown → Medium |


I'm currently trying to build with debugging symbols to see if it might make things a bit more obvious, but mysqld is actually crashing in rec_copy_ prefix_ to_buf( ).
Just for fun I tried running Debian's binary, since it's being built from what appears to be the same codebase with the same patch applied, and it didn't crash.