www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7115] New: sort function is broken with large arrays

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7115

           Summary: sort function is broken with large arrays
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: deadalnix gmail.com



See sample code :

module fail;

import std.algorithm;
import std.random;

void main() {
    Mt19937 gen;

    byte[] v;
    v.length = 65536 * 1024;

    foreach(ref byte t; v) {
        t = cast(byte) gen.front;
        gen.popFront;
    }

    v.sort;

    assert(isSorted(v));
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 15 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7115


timon.gehr gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr gmx.ch



This would be a great opportunity to finally deprecate that abomination.
Also, I think this only happens when the element type is byte?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 15 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7115





 This would be a great opportunity to finally deprecate that abomination.
 Also, I think this only happens when the element type is byte?
I did put byte for performances reasons, but it is true that it works with int and short (I just checked). Anyway, not sure it will nto fail for bigger values. BTW, phobos provide nice way to sort, so this feature is not really needed and can be deprecated. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 15 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7115


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au



Perhaps a duplicate of bug 2819?
(I think it may be overflowing the stack, and generating wrong results instead
of segfaulting).

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