Thread overview
[Issue 9852] New: Empty associative array crashes program
Apr 01, 2013
Luís Marques
Apr 01, 2013
Luís Marques
Apr 02, 2013
Maxim Fomin
April 01, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9852

           Summary: Empty associative array crashes program
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: luismarques@gmail.com


--- Comment #0 from Luís Marques <luismarques@gmail.com> 2013-04-01 13:15:55 PDT ---
#!/usr/local/bin/rdmd

@safe:

void main()
{
    int[string] a;
    a["foo"] = 0;
    a.remove("foo");
    assert(a != null);
}

---

$ ./test.d Segmentation fault: 11

--

System:
DMD64 D Compiler v2.062
Darwin feynman 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan  6 22:37:10 PST
2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 01, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9852


Luís Marques <luismarques@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


--- Comment #1 from Luís Marques <luismarques@gmail.com> 2013-04-01 16:52:41 PDT ---
Not a bug. Oops, sorry, I was dense today (and forgotten about D).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 02, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9852


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |bearophile_hugs@eml.cc
         Resolution|INVALID                     |


--- Comment #2 from bearophile_hugs@eml.cc 2013-04-01 17:07:13 PDT ---
Reopened, because Steven Schveighoffer has said:

> The equals operator should check for null before comparing the contents.  It is a valid bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 02, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9852


Maxim Fomin <maxim@maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim@maxim-fomin.ru
         OS/Version|Mac OS X                    |All
           Severity|normal                      |critical


--- Comment #3 from Maxim Fomin <maxim@maxim-fomin.ru> 2013-04-01 22:06:54 PDT ---
It can be reproduced on linux, removing os specific tag, raising importance.

I think this is a druntime bug rather than dmd.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 03, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9852


Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|DMD                         |druntime


--- Comment #4 from Steven Schveighoffer <schveiguy@yahoo.com> 2013-04-03 09:44:30 PDT ---
(In reply to comment #3)
> I think this is a druntime bug rather than dmd.

You are correct.  Updating.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 08, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9852



--- Comment #5 from hsteoh@quickfur.ath.cx 2013-07-08 15:01:17 PDT ---
https://github.com/D-Programming-Language/druntime/pull/541

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 09, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9852



--- Comment #6 from github-bugzilla@puremagic.com 2013-07-08 17:03:17 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/druntime

https://github.com/D-Programming-Language/druntime/commit/64679623a321f69ef28feb482711fd5a85cb1d39 Fix issue 9852.

_aaEqual should not dereference null when given a null AA.

https://github.com/D-Programming-Language/druntime/commit/33b1c818cbde36e5c6d721faf791beeacaee9fb1 Merge pull request #541 from quickfur/issue9852

Fix issue 9852.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 09, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9852


hsteoh@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


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