Using EdgeList on a once empty Graph crashes the kernel

2

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[
  EdgeAdd[
    VertexAdd[
      Graph[{}],
      {x, y}],
    DirectedEdge[x, y]
  ]
]

and

EdgeList[
  EdgeAdd[
    VertexAdd[
      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.

jnhnum1

Posted 2012-08-22T05:00:07.023

Reputation: 145

Yes, I can reproduce this on 8.04 on OSX – rm -rf – 2012-08-22T05:08:08.370

I can reproduce it on 8.0.4 on win7 x64 – Silvia – 2012-08-22T06:52:02.397

@Silvia, do both issues crash on win7 x64, or just the first one? – None – 2012-08-22T15:08:34.550

1@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 – 2012-08-22T15:24:41.793

@Silvia, thanks that's what I see too. – None – 2012-08-22T15:33:59.113

@ruebenko, sorry, I messed up typing the second example. Previously it didn't crash on my machine either - now it is updated to what I meant to put, and does. – jnhnum1 – 2012-08-22T17:51:32.893

I made the same observations as Silvia. With the fixed second example both crash the kernel in version 8 on XP Pro SP3. – stevenvh – 2012-08-22T18:00:48.393

Thanks, if have added that to the same bug report. – None – 2012-08-22T22:06:42.810

Answers

6

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.

user21

Posted 2012-08-22T05:00:07.023

Reputation:

@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 – 2012-08-22T16:24:16.307

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 – 2012-08-22T17:53:30.940

@jnhnum1, no problem, I just wanted to point out that this is not as easy as it may seem on a first glance. – None – 2012-08-22T22:08:15.380