Skip to content

Commit

Permalink
BUG#22608616 SEVERAL CRASHES ON ARM64 WITH MYSQL 5.7 AND LATER
Browse files Browse the repository at this point in the history
It's a memory order issue. Use __ATOMIC_SEQ_CST solves the issue
on ARM64 and POWER8.

Reviewed-by: Sunny Bains <sunny.bains@oracle.com>
RB: 12159
  • Loading branch information
Shaohua Wang committed Mar 24, 2016
1 parent b3cc89a commit 8870f82
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion storage/innobase/include/os0atomic.ic
@@ -1,6 +1,6 @@
/*****************************************************************************

Copyright (c) 2013, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -152,7 +152,11 @@ os_atomic_test_and_set(
/* Silence a compiler warning about unused ptr. */
(void) ptr;

#if defined(__powerpc__) || defined(__aarch64__)
__atomic_exchange(ptr, &new_val, &ret, __ATOMIC_SEQ_CST);
#else
__atomic_exchange(ptr, &new_val, &ret, __ATOMIC_RELEASE);
#endif

return(ret);
}
Expand All @@ -172,8 +176,13 @@ os_atomic_val_compare_and_swap(
/* Silence a compiler warning about unused ptr. */
(void) ptr;

#if defined(__powerpc__) || defined(__aarch64__)
__atomic_compare_exchange(ptr, &old_val, &new_val, false,
__ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
#else
__atomic_compare_exchange(ptr, &old_val, &new_val, false,
__ATOMIC_RELEASE, __ATOMIC_ACQUIRE);
#endif

return(old_val);
}
Expand Down

0 comments on commit 8870f82

Please sign in to comment.