Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
    
Yes, I can reproduce this on 8.04 on OSX –  rm -rf 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
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 Aug 22 '12 at 15:24
    
@Silvia, thanks that's what I see too. –  user21 Aug 22 '12 at 15:33
show 3 more comments

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer
3  
+1 for the last paragraph. –  J. M. 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.