Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5, 10.6, 10.11, 11.4
-
GNU/Linux on Ice Lake Xeon, clang 19, -O2 -march=native
Description
MariaDB Server would crash for me on bootstrap because of an alignment violation. The following patch highlights the problem and fixes the issue for me, but obviously it is not an acceptable fix:
diff --git a/tpool/tpool_generic.cc b/tpool/tpool_generic.cc
|
index 9ed832dd1ed..23064581307 100644
|
--- a/tpool/tpool_generic.cc
|
+++ b/tpool/tpool_generic.cc
|
@@ -129,7 +129,7 @@ enum worker_wake_reason
|
|
|
/* A per-worker thread structure.*/
|
-struct alignas(CPU_LEVEL1_DCACHE_LINESIZE) worker_data
|
+struct worker_data
|
{
|
/** Condition variable to wakeup this worker.*/
|
std::condition_variable m_cv;
|
@@ -179,16 +179,6 @@ struct alignas(CPU_LEVEL1_DCACHE_LINESIZE) worker_data
|
m_state(NONE),
|
m_task_start_time()
|
{}
|
-
|
- /*Define custom new/delete because of overaligned structure. */
|
- static void *operator new(size_t size)
|
- {
|
- return aligned_malloc(size, CPU_LEVEL1_DCACHE_LINESIZE);
|
- }
|
- static void operator delete(void* p)
|
- {
|
- aligned_free(p);
|
- }
|
};
|
|
I also tried to define similar alignment and allocation operators for class thread_pool_generic, but that did not fix the problem.
The misalignment tripped a 256-bit store on a 128-bit aligned address, apparently related to the initialization of cache<worker_data>::m_cv and possibly some neighboring data member, invoking the movaps instruction on an ymm register.
Attachments
Issue Links
- is caused by
-
MDEV-16264 Implement a common work queue for InnoDB background tasks
- Closed