Using EdgeList on a once empty Graph crashes the kernel

Note: this is fixed in version 9.

Calling EdgeList on a non-empty graph which was previously empty causes the math kernel to crash.

For example,

EdgeList[
Graph[{}],
{x, y}],
DirectedEdge[x, y]
]
]


and

EdgeList[
VertexDelete[
Graph[{DirectedEdge[x,y]}],
{x, y}],
{x, y}],
DirectedEdge[x, y]
]
]


both will crash the kernel.

I've recently posted this issue to the Mathematica Bug List but haven't received any response. Is this the correct place to report bugs, or should I use the contact page for WRI instead.

Can other people reproduce this? Also, how could WRI possibly mess this up / not notice this?

Edit: fixed second example.

-
Yes, I can reproduce this on 8.04 on OSX –  The Toad Aug 22 '12 at 5:08
I can reproduce it on 8.0.4 on win7 x64 –  Silvia Aug 22 '12 at 6:52
@Silvia, do both issues crash on win7 x64, or just the first one? –  user21 Aug 22 '12 at 15:08
@ruebenko Sorry for my preconception that two examples were essentially the same. So I tested them both, the first crashed while the second prompted errors about excess arguments only and stopped normally. –  Silvia Aug 22 '12 at 15:24
@Silvia, thanks that's what I see too. –  user21 Aug 22 '12 at 15:33

The first is a crash and it's already fixed in the development version. I nevertheless filed it is as a bug against V8.0.4. The second issue you mention does not crash my Linux-86-64 V8.0.4; it returns unevaluated.

Edit The updated second example is also reported. End Edit

If you find a crash it's a good idea to report this to the support support@wolfram.com. Reporting (also other bugs than crashes) allows to determine if the issue reported is a bug in the first place, if it is known and has been fixed and if not the proper developer is contacted. Possibly a workaround can be suggested.

Concerning your question, how "how could WRI possibly mess this up / not notice this" consider this: Mathematica is a huge software project for multiple platforms, several million lines of code. It's not only very hard to write a bug free code on this scale, it is impossible. Knowing this WRI puts a lot of effort in creating a large test suite to check that all things work as expected but it is impossible and unpractical to write tests for every input conceivable. So, some issues fly under the radar and are not noticed. And this is more likely with newer functionality then more established one.

-
+1 for the last paragraph. –  Guess who it is. Aug 22 '12 at 15:28
@J.M. Seconded. I think WRI makes a great product. I've seen several software suites with only a fraction of Mma's complexity behaving much less reliable. –  stevenvh Aug 22 '12 at 16:24
Sorry, I apologize for the implication of any incompetence on WRI's part. I meant to only express wonder at the strangeness of this bug in what seems like it ought to be a simple function. –  jnhnum1 Aug 22 '12 at 17:53
@jnhnum1, no problem, I just wanted to point out that this is not as easy as it may seem on a first glance. –  user21 Aug 22 '12 at 22:08