Bug #76301 | ClusterJ test crashes with a core dump in Java 1.7 on Solaris/OEL | ||
---|---|---|---|
Submitted: | 12 Mar 2015 17:21 | Modified: | 7 Jul 2015 14:42 |
Reporter: | Lakshmi Narayanan Sreethar | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Cluster: Cluster/J | Severity: | S3 (Non-critical) |
Version: | 7.4 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[12 Mar 2015 17:21]
Lakshmi Narayanan Sreethar
[13 May 2015 23:16]
Craig Russell
Posted by developer: Root cause is incorrect calculation of space needed for NdbRecord. In NdbDictionary::createRecord, the space for blob columns is calculated to include 16 byte blob header plus 256 byte inline size. But actually only sizeof(Blob*) is needed. When scanning tables that have blob columns, the method nextResultCopyOut (used only by clusterj scans) copies the incorrect number of bytes, and potentially overwrites data in memory immediately following the buffer. In java 6 and earlier, the buffers were allocated on page boundaries (typically 4K bytes) so it would be unlikely that the extra data would be a problem. But in java 7 and later, buffers are allocated one after the other so the extra data corrupts the following buffer. The solution is to check the size of the buffer that is calculated by NdbDictionary::createRecord and if that size is bigger than the internally calculated buffer size, use the larger size.
[7 Jul 2015 14:42]
Daniel So
Posted by developer: Added the following entry to the MySQL Cluster 7.4.7 and 7.3.10 changelogs: "When used with Java 1.7 or higher, ClusterJ might cause the Java VM to crash when querying tables with BLOB columns, because NdbDictionary::createRecord calculates the wrong size needed for the record. Subsequently, when ClusterJ called NdbScanOperation::nextRecordCopyOut, the data overran the allocated buffer space. With this fix, ClusterJ checks the size calculated by NdbDictionary::createRecord and uses the value for the buffer size, if it is larger than the value ClusterJ itself calculates."