Bug #48132 | Misaligned Signal variable leads to ndbd crash on some architectures | ||
---|---|---|---|
Submitted: | 17 Oct 2009 21:05 | Modified: | 9 Mar 2016 16:16 |
Reporter: | [ name withheld ] | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Cluster: Cluster (NDB) storage engine | Severity: | S1 (Critical) |
Version: | mysql-5.1 | OS: | Any (recent gcc needed) |
Assigned to: | CPU Architecture: | Any | |
Tags: | 5.1.39, Contribution |
[17 Oct 2009 21:05]
[ name withheld ]
[19 Oct 2009 9:00]
Gustaf Thorslund
Since awhile back now the cluster source lives in it's own tree and isn't merged into the main server tree. Looking at the source in the MySQL Cluster 7.0 tree it's been changed some since the version you're looking at and the patch you're suggesting wouldn't even apply.
[9 Mar 2016 15:41]
Gustaf Thorslund
Posted by developer: If looking in right tree, this was fixed awhile ago. --> commit 9b995aa2699f8b14e483f960a694269b1c89edab Author: jonas@perch.ndb.mysql.com <> Date: Sun Dec 23 13:52:25 2007 +0100 ndb - change long signal interface (in blocks) so that 1) sections are never forwarded, but need to be explicitly handled 2) unhandled section(s) will give ndbassert-ion failure (in post execXXX-handling) diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp index 54d3a97..47431bd 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp @@ -2185,8 +2185,9 @@ Dbtup::read_pseudo(const Uint32 * inBuffer, Uint32 inPos, Uint32* outBuffer = outBuf + ((outPos - 1) >> 2); Uint32 sz; - Uint32 tmp[sizeof(SignalHeader)+25]; - Signal * signal = (Signal*)&tmp; + SignalT<4> signalT; + Signal * signal = (Signal*)&signalT; + bzero(signal, sizeof(signalT)); switch(attrId){ case AttributeHeader::READ_PACKED: case AttributeHeader::READ_ALL: --> And some reorganisation --> commit 3b94736a6c6acb11d205e97fd48ac0af801f80ad Author: stewart@flamingspork.com[stewart] <> Date: Thu Nov 15 11:30:00 2007 +1100 [PATCH] Cleanup AsyncFile, make modular and nice to read Move all platform specific AsyncFile functionality out into sep classes. Generic functionality in AsyncFile, POSIX specific in PosixAsyncFile. In future, will have azioAsyncFile (maybe a mysysAsyncFile) and can have specific numbers of each instantiated in kernel. Then, NDBFS can decide which AsyncFile should be used for that file - e.g. we can keep the number of azioAsyncFiles to a minimum. --> Then fixed in PosixAsyncFile. --> commit 20a2d59eb480d83ebeb6ada58fe1149574d2c92d Author: Jonas Oreland <jonas@mysql.com> Date: Tue Aug 17 11:43:19 2010 +0200 ndb - fix strict aliasing problems diff --git a/storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.cpp b/storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.cpp index 3f888ed..74a97ce 100644 --- a/storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.cpp +++ b/storage/ndb/src/kernel/blocks/ndbfs/PosixAsyncFile.cpp @@ -312,7 +312,7 @@ no_odirect: off_t off = 0; const off_t sz = request->par.open.file_size; SignalT<25> tmp; - Signal * signal = (Signal*)(&tmp); + Signal * signal = new (&tmp) Signal(0); bzero(signal, sizeof(tmp)); FsReadWriteReq* req = (FsReadWriteReq*)signal->getDataPtrSend(); --> /Gustaf