Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL)
-
Debian GNU/Linux AMD64, clang-13 or clang-14 -march=native -mtune=native
Description
On my system, 3 unit tests for performance_schema failed with SIGSEGV, on MariaDB Server 10.9. The reason turned out to be that the SIMD instruction MOVAPS was executed in create_thread() on a pointer that was only aligned to 128 bits (16 bytes), not the required 256 or 512 bits.
The reason turned out to be that the mocked up pfs_malloc() failed to return properly aligned memory (64 bytes or 512 bits in the case of AMD64):
diff --git a/storage/perfschema/unittest/stub_pfs_global.h b/storage/perfschema/unittest/stub_pfs_global.h
|
index 8a1f9216ba2..3d7d818cc51 100644
|
--- a/storage/perfschema/unittest/stub_pfs_global.h
|
+++ b/storage/perfschema/unittest/stub_pfs_global.h
|
@@ -24,6 +24,9 @@
|
#include <my_sys.h>
|
#include <pfs_global.h>
|
#include <string.h>
|
+#ifdef HAVE_MEMALIGN
|
+# include <malloc.h>
|
+#endif
|
|
bool pfs_initialized= false;
|
|
@@ -43,7 +46,15 @@ void *pfs_malloc(size_t size, myf)
|
if (--stub_alloc_fails_after_count <= 0)
|
return NULL;
|
|
+#ifndef PFS_ALIGNEMENT
|
void *ptr= malloc(size);
|
+#elif defined HAVE_MEMALIGN
|
+ void *ptr= memalign(PFS_ALIGNEMENT, size);
|
+#elif defined HAVE_ALIGNED_MALLOC
|
+ void *ptr= _aligned_malloc(size, PFS_ALIGNEMENT);
|
+#else
|
+# error "Missing implementation"
|
+#endif
|
if (ptr != NULL)
|
memset(ptr, 0, size);
|
return ptr; |
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
issue.field.resolutiondate | 2022-03-16 10:23:43.0 | 2022-03-16 10:23:43.068 |
Fix Version/s | 10.2.44 [ 27514 ] | |
Fix Version/s | 10.3.35 [ 27512 ] | |
Fix Version/s | 10.4.25 [ 27510 ] | |
Fix Version/s | 10.5.16 [ 27508 ] | |
Fix Version/s | 10.6.8 [ 27506 ] | |
Fix Version/s | 10.7.4 [ 27504 ] | |
Fix Version/s | 10.8.3 [ 27502 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.7 [ 24805 ] | |
Fix Version/s | 10.8 [ 26121 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
I had missed another pfs_malloc() unit test stub.