[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#13537: split: memory exhausted when putting at most T/P/E bytes of l
From: |
Pádraig Brady |
Subject: |
bug#13537: split: memory exhausted when putting at most T/P/E bytes of lines per output file |
Date: |
Thu, 25 Apr 2013 02:34:41 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 01/23/2013 11:58 PM, Lei Zhang wrote:
> Hi All,
>
> In the `split' program of coreutils 8.20, we found a bug which is similar
> to the bug reported in bug#13530:
>
> Invoking `split -C T' or `split -C P' or `split -C E' will cause memory
> exhaustion.
>
> However, smaller units (e.g., K, M, G) work fine; bigger units (e.g., Z, Y)
> fail properly (by outputing "invalid number of bytes").
>
> A bit dig reveals that the bug is introduced at line 1412 of split.c
> (coreutils 8.20):
>
> 1400: switch (split_type)
> 1401: {
> ...
> 1411: case type_byteslines:
> 1412: line_bytes_split (n_units); /* this function calls
> xmalloc(n_bytes), which fails. */
> 1413: break;
> ...
> 1434: }
>
> `n_units' before that statement can be very large. In the case of `split -C
> T', it is 1099511627776.
>
> We think this is a bug similar to the one reported in bug#13530, so we
> bring this issue to your attention. Thanks!
I intend to push the attached soon to fix this.
thanks,
Pádraig.
split-C-mem.patch
Description: Text Data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug#13537: split: memory exhausted when putting at most T/P/E bytes of lines per output file,
Pádraig Brady <=