[MDEV-10770] Inserted values were corrupt while using InnoDB storage engine on arm architecture Created: 2016-09-08 Updated: 2018-03-14 Resolved: 2018-03-14 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Compiling, Storage Engine - InnoDB |
| Affects Version/s: | 5.5.51 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Dorothy Tsai | Assignee: | Marko Mäkelä |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | innodb | ||
| Environment: |
Arm-marvell. |
||
| Attachments: |
|
| Description |
|
I was using InnoDB on arm marvell environment. Here's the snippet of my toolchain file: And here are my reproduce steps:
3. Insert data:
4. Select data from table 'foo':
The data shown in the console was garbled text, please refer to the attached snapshot. Is there any incorrect variable in my toolchain file? Or does InnoDB cannot work well on arm-marvell environment? |
| Comments |
| Comment by Elena Stepanova [ 2016-09-19 ] | |||||||||||||||||||
|
Please paste or attach your cnf file(s). When you were copying ibd and frm files for the table, did you follow the rules for InnoDB tablespace backup? (https://dev.mysql.com/doc/refman/5.6/en/innodb-migration.html):
| |||||||||||||||||||
| Comment by Dorothy Tsai [ 2016-09-21 ] | |||||||||||||||||||
|
Dear Elena Stepanova, I've attached my cnf file and the other files. Thanks a lot. | |||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2016-10-28 ] | |||||||||||||||||||
|
Hi, is your terminal in correct locale ? | |||||||||||||||||||
| Comment by Dorothy Tsai [ 2016-10-28 ] | |||||||||||||||||||
|
Yes. My locale are as below: | |||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2016-10-28 ] | |||||||||||||||||||
|
Hi, yes data on provided foo.ibd and test.sql is garbled not sure why. | |||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-10-23 ] | |||||||||||||||||||
|
The test.sql inside the data.tgz
The foo.ibd seems to be in ROW_FORMAT=COMPACT or later format.
The first user record starts at infimum + 0x1d, that is, 0xc080 (byte 0x80 on page 3). However, the record header does not really seem to match the table definitions. Let us take a look at these 8 bytes before the start of the record, immediately after the word 'supremum':
The last 2 bytes (0x11a) say that the next record starts at 0xc080+0x11a. This looks plausible. Then we have the record heap number and some flags. Before the 5-byte fixed-size header, we have the bytes 0xf5 0x00 0x00. The last two are the NULL flags (no columns are NULL) and the lengths of the variable-size fields: LENGTH(text)=0', LENGTH(name)=0xf5=245. What is not OK is that we do not seem to have the value of `type` anywhere. That is, the string 'goog' of 'google.com' will be interpreted as INT (signed), that is, -412127385. The test.sql dump seems to match the foo.ibd file contents. I do not see anything obviously wrong in the InnoDB code. All persistent data structures use the big-endian word order, and files generally are portable between 32-bit, 64-bit, big-endian and little-endian environments. (innodb_checksum_algorithm=crc32 was broken outside x86, though.) MariaDB has fixes for some of the InnoDB synchronization primitives, but I do not think that this bug is due to that kind of trouble. Dorothy Tsai, can you transfer a data set from to the ARM environment to x86, or vice versa? Does it work then? Note that you must transfer the InnoDB system tablespace and log files (ibdata1, ib_logfile*) along with the .ibd and .frm files. Also, how exactly was the data inserted? Has a "garbage in, garbage out" problem been ruled out? Can you repeat this problem within mysql-test-run on that platform? Do any tests pass? | |||||||||||||||||||
| Comment by Dorothy Tsai [ 2017-11-02 ] | |||||||||||||||||||
|
Hi, Marko Mäkelä, | |||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-11-06 ] | |||||||||||||||||||
|
Hi Dorothy Tsai, I would suggest compiling a debug version of the server and running the tests.
It looks like something is terribly broken with the build system. A debug build should display problems earlier, possibly already during the server bootstrap. I see that the "uname -a" says that the processor uses the ARMv5 microarchitecture. I do not know how much the ISA and the available build tools differ from ARMv6 and later, but for what it is worth, MariaDB is available in Raspbian (ARMv6, to be compatible with the original Raspberry 1) and Debian (ARMv7 and ARMv8). | |||||||||||||||||||
| Comment by Dorothy Tsai [ 2017-11-10 ] | |||||||||||||||||||
|
Hi, Marko Mäkelä, Thanks for your suggestion.
The inserted data was garbled. | |||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-11-30 ] | |||||||||||||||||||
|
Dorothy Tsai, I guess all InnoDB tests failed for the release build?
so that you will get some debugging symbols. Unfortunately it looks like you must do some more debugging to narrow down the problem. It could be a compiler bug, or something in the source code that wrongly relies on implementation-defined behaviour. Perhaps you can find some inspiration in the presentation You could also try to tweak the optimization flags in CMAKE_C_FLAGS. And last but not least, try a recent version of GCC or clang. |