Bug #50133 sorting big table : 'segmentation fault' - 'sort aborted' 'Unexpected eof found
Submitted: 7 Jan 2010 10:58 Modified: 10 Mar 2010 1:09
Reporter: Olivier Delrieu Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Errors Severity:S2 (Serious)
Version:5.1.41 OS:Linux
Assigned to: CPU Architecture:Any
Tags: big table, Memory Engine, order by

[7 Jan 2010 10:58] Olivier Delrieu
Description:
Hi All,

Mysql server crashes every time I do the following:

INSERT INTO tblfinal_sorted (var_id, sub_id, data)
SELECT var_id, sub_id, data FROM tblfinal
ORDER BY var_id
;

The table is quite big: 10GB and 1.3 billion rows. Both have FIXED rows length and are in MEMORY engine. I have 70GB RAM available (enough for both tables and the sort buffer).

If I increase sort_buffer_size, to 32GB, mysql server crashes with a 'segmentation fault'

If I lower sort_buffer_size, so that temporary files are used for sorting, the query crashes with: 'sort aborted' (code 1028) and 'Unexpected eof found when reading file' (code 9)
(I have enough space on disk; same error if tmpdir is placed in a tmpfs ramdisk)

I have same issues with ALTER TABLE ... ORDER BY statement with various myisam_sort_buffer_size. 

How to repeat:
Generate large MEMORY engine tables and try sort them.
[9 Jan 2010 13:20] Valeriy Kravchuk
Please, upload the entire error log, my.cnf file content and the results of:

uname -a
free

Linux commands.
[10 Feb 2010 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[11 Mar 2010 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".