[MDEV-4186] Test case main.myisampack fails on ppc32 (only) Created: 2013-02-19 Updated: 2013-03-13 Resolved: 2013-03-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.29 |
| Fix Version/s: | 5.5.30 |
| Type: | Bug | Priority: | Major |
| Reporter: | Honza Horak | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Linux, ppc32 |
||
| Description |
|
The test main.myisampack is failing with message: It works fine on all other arches I tested: s390 (32 and 64), i686, x86_64 or ppc64. Even though I don't have direct access to any ppc32 I was able to put some outputs into the code and run it on a building machine. It really seems like buffer limit (sortbuff_size variable) is 0 when entering function _create_index_by_sort() at mariadb-5.5.29/storage/myisam/sort.c:104 I suspect some bad work with memory, especially with variable sizes. Particularly sort_buffer_size defined at mariadb-5.5.29/storage/myisam/ha_myisam.cc:77 seems to be ULONGLONG but the minimum value is casted to (long). Similar situation is in mariadb-5.5.29/storage/myisam/myisamchk.c:295 where myisam_sort_buffer_size uses casting to long but after then we use it as ulonglong. This is probably all the info I can provide right now, but I'll be happy to test a potential patch. |
| Comments |
| Comment by Honza Horak [ 2013-02-27 ] | |||||||||||||||||||
|
I believe I've found the issue (compared myisam and aria files) and the following patch fixes the issue (test will pass on all arches):
| |||||||||||||||||||
| Comment by Sergei Golubchik [ 2013-03-07 ] | |||||||||||||||||||
|
Honza, I think the problem comes from the fact that check_param.sort_buffer_length is of size_t type, but because of GET_ULL, my_getopt does (ulonglong)ptr= value; I've fixed that by declaring check_param.sort_buffer_length to be ulonglong. Can you check if this patch fixes the issue: === modified file 'include/myisamchk.h'
| |||||||||||||||||||
| Comment by Honza Horak [ 2013-03-13 ] | |||||||||||||||||||
|
Sergei, I've tested your patch and can confirm that the test case passes on ppc32, so the patch seems to be fine. Thanks. |