[MDEV-6450] MariaDB crash on Power8 when built with advance tool chain Created: 2014-07-16 Updated: 2014-08-29 Resolved: 2014-08-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.12 |
| Fix Version/s: | 10.0.13 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Axel Schwenke | Assignee: | Sergey Vojtovich |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Power8 RH6.5 (big endian) |
||
| Issue Links: |
|
||||||||||||||||||||
| Description |
| Comments |
| Comment by Axel Schwenke [ 2014-07-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
after looking at | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Axel Schwenke [ 2014-07-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
A crash happens immediately for a debug build. When the rw_lock_debug_mutex is released, it turns out the thread didn't own it. Huh? Errorlog:
Stack:
CFLAGS:
binaries in ~/mariadb-install-/mariadb-10.0.12-atc-debug | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Axel Schwenke [ 2014-07-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
OK, I guess I found the source of the issue: the gcc atomix builtins are broken with ATC. I tested this by disabling them in the source code. This however works only for InnoDB but not for XtraDB. Code change:
In order to use stock InnoDB instead of XtraDB, one has to add this to my.cnf:
Right now I'm running an extensive benchmark with this build to check if the workaround is good. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Daniel Bartholomew [ 2014-07-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
svoj is knee-deep in fixing this, so here's a quick update for those that were not on the IBM call this morning. First, there's this from an email svoj sent:
svoj and axel are now working with IBM to verify that the fix is correct and running tests. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergey Vojtovich [ 2014-07-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Another comment regarding buggy __sync_lock_release: http://bugs.mysql.com/bug.php?id=34175 (see [6 Feb 2008 19:21] Larry Zhou). It still doesn't give meaningful answer what's wrong with this function. OTOH it says "GCC 4.1.1 with 64-bit opteron" and "There were AMD hardware bug, and GCC bug reported by Boehm". Probably we can assume it is fixed now. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergey Vojtovich [ 2014-07-18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sergei please review fix for this bug. The patch has been pushed to 10.0.13:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2014-07-23 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If this fix is correct, it should be merged also to 5.5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2014-07-30 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
svoj, the patch looks good, thanks. But perhaps, you should do a similar change for Windows? InterlockedExchange is a full memory barrier. Windows has intrinsics with acquire and release semantics. For example, os_atomic_test_and_set_byte could be InterlockedExchangeAcquire, while os_atomic_lock_release_byte could be InterlockedAndRelease. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergey Vojtovich [ 2014-07-31 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sergei, please review addition to the original patch. It implements your suggestion. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2014-07-31 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
thanks, ok to push! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergey Vojtovich [ 2014-08-04 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Pushed additional patch to 10.0.13:
|