Jump to page: 1 2 3
Thread overview
[Issue 929] New: Resizing array of associative arrays (uint[char[]][]) causes infinite loop / hang
Feb 04, 2007
d-bugmail
Feb 04, 2007
d-bugmail
Feb 04, 2007
d-bugmail
Feb 04, 2007
d-bugmail
Feb 04, 2007
d-bugmail
Apr 05, 2007
d-bugmail
May 24, 2007
d-bugmail
May 28, 2007
d-bugmail
Jul 07, 2007
d-bugmail
Jul 07, 2007
d-bugmail
Sep 08, 2007
d-bugmail
Sep 08, 2007
d-bugmail
Feb 03, 2008
d-bugmail
Jun 05, 2008
d-bugmail
Jul 29, 2008
d-bugmail
Oct 03, 2008
d-bugmail
Oct 21, 2008
d-bugmail
Nov 15, 2008
d-bugmail
Nov 20, 2008
d-bugmail
Nov 20, 2008
d-bugmail
Dec 02, 2008
d-bugmail
Dec 13, 2008
d-bugmail
February 04, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=929

           Summary: Resizing array of associative arrays (uint[char[]][])
                    causes infinite loop / hang
           Product: D
           Version: 1.004
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: nick.atamas@gmail.com


The following code produces an infinite loop. When executed "before" is printed but "after" is never reached.

import std.stdio;
int main()
{
        uint[char[]][] fractal;
        writefln("before");
        fractal.length = 10;
        writefln("after");

        return 0;
}


-- 

February 04, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=929


fvbommel@wxs.nl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid




------- Comment #1 from fvbommel@wxs.nl  2007-02-04 04:41 -------
http://www.digitalmars.com/d/arrays.html#associative (under "Properties"): .length         Returns number of values in the associative array. Unlike for dynamic arrays, it is read-only.

So this shouldn't even compile...


-- 

February 04, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=929


torhu@yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |torhu@yahoo.com
           Keywords|accepts-invalid             |




------- Comment #2 from torhu@yahoo.com  2007-02-04 08:11 -------
(In reply to comment #1)
> http://www.digitalmars.com/d/arrays.html#associative (under "Properties"): .length         Returns number of values in the associative array. Unlike for dynamic arrays, it is read-only.
> 
> So this shouldn't even compile...
> 

uint[char[]][] fractal;

fractal is a dynamic array, so length is not read-only.


-- 

February 04, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=929





------- Comment #3 from fvbommel@wxs.nl  2007-02-04 08:20 -------
(In reply to comment #2)
> uint[char[]][] fractal;
> 
> fractal is a dynamic array, so length is not read-only.

Ah, I missed the last brackets. Sorry about that.


-- 

February 04, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=929





------- Comment #4 from nick.atamas@gmail.com  2007-02-04 11:35 -------
This worked just fine in DMD1.0. It was broken recently.

I am currently using a workaround - encapsulating uint[char[]] into a class and making an array of those.


-- 

April 05, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=929


thomas-dloop@kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All




------- Comment #5 from thomas-dloop@kuehne.cn  2007-04-05 11:33 -------
Added to DStress as http://dstress.kuehne.cn/run/l/length_11_A.d http://dstress.kuehne.cn/run/l/length_11_B.d


-- 

May 24, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=929


svv1999@hotmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |critical
           Priority|P2                          |P1
            Version|1.004                       |1.001




------- Comment #6 from svv1999@hotmail.com  2007-05-24 13:23 -------
Just stumbled on this when recompiling an older project.
To me dynamic and associative arrays are key features of D.
The bug was introduced with version 1.001.
Therefore increased priority as well as severity and set Version to 1.001.

The bug shows up on upsizing only. Downsizing by assigning to length is possible.

The type `int[int][]' is sufficient to show the bug.


-- 

May 28, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=929





------- Comment #7 from wbaxter@gmail.com  2007-05-28 02:28 -------
Ouch.  This one just bit me too.
So throw in my "vote" or whatever.
This needs a-fixin' pronto.

Thanks for the workaround suggestion, Nick.


-- 

July 07, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=929


deewiant@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |regression




-- 

July 07, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=929


deewiant@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |d0ccrazy@web.de




------- Comment #8 from deewiant@gmail.com  2007-07-07 09:43 -------
*** Bug 1321 has been marked as a duplicate of this bug. ***


-- 

« First   ‹ Prev
1 2 3