[Issue 5786] New: std.algorithm.sort does not work with std.container.Array: Range violation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 27 01:19:42 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5786

           Summary: std.algorithm.sort does not work with
                    std.container.Array: Range violation
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: jmdavisProg at gmx.com


--- Comment #0 from Jonathan M Davis <jmdavisProg at gmx.com> 2011-03-27 01:16:18 PDT ---
This program

import std.algorithm;
import std.container;

void main()
{
    Array!int arr;
    arr.insert([1, 7, 2, 8, 3]);
    sort(arr[]);
}

throws this AssertError when it runs:

core.exception.RangeError at std.container(1709): Range violation
----------------
./test(onRangeError+0x28) [0x80b3ec8]
./test(_d_array_bounds+0x16) [0x80acc96]
./test(_D3std9container7__arrayZ+0x12) [0x80aec26]
./test(_D3std9container12__T5ArrayTiZ5Array5Range6moveAtMFkZi+0x95) [0x80a33a1]
./test(_D3std5range53__T6moveAtTS3std9container12__T5ArrayTiZ5Array5RangeZ6moveAtFS3std9container12__T5ArrayTiZ5Array5RangekZi+0x12)
[0x80a8f06]
./test(_D3std9algorithm53__T6swapAtTS3std9container12__T5ArrayTiZ5Array5RangeZ6swapAtFS3std9container12__T5ArrayTiZ5Array5RangekkZv+0x3e)
[0x80a8e9e]
./test(_D3std9algorithm168__T8sortImplS793std10functional54__T13binaryFunImplVAyaa5_61203c2062VAyaa1_61VAyaa1_62Z6resultVE3std9algorithm12SwapStrategy0TS3std9container12__T5ArrayTiZ5Array5RangeZ8sortImplFS3std9container12__T5ArrayTiZ5Array5RangeZv+0x61)
[0x80a8ca9]
./test(_D3std9algorithm99__T4sortVAyaa5_61203c2062VE3std9algorithm12SwapStrategy0TS3std9container12__T5ArrayTiZ5Array5RangeZ4sortFS3std9container12__T5ArrayTiZ5Array5RangeZS3std5range76__T11SortedRangeTS3std9container12__T5ArrayTiZ5Array5RangeVAyaa5_61203c2062Z11SortedRange+0x28)
[0x80a8718]
./test(_Dmain+0x56) [0x80a2aaa]
./test(_D2rt6dmain24mainUiPPaZi7runMainMFZv+0x1a) [0x80acdf6]
./test(_D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv+0x20) [0x80acd88]
./test(_D2rt6dmain24mainUiPPaZi6runAllMFZv+0x32) [0x80ace3a]
./test(_D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv+0x20) [0x80acd88]
./test(main+0x94) [0x80acd34]
/usr/lib32/libc.so.6(__libc_start_main+0xe6) [0xf758bdb6]
./test() [0x80a29a1]

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list