New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
segfault on Graph().connected_component_containing_vertex('') #11942
Comments
This comment has been minimized.
This comment has been minimized.
Author: Nathann Cohen |
comment:1
Right ! This comes from an unchecked operation at the beginning of BFS/DFS. Fixed in the following patch Nathann |
Reviewer: Keshav Kini |
comment:2
Wow, that was fast! :D I have a couple of questions, though. Also, your exception is a
|
comment:3
Hellooooooo !
Oh ? That's a pity, I really use it a lot I immediately update the patch to return a KeyError Nathann |
comment:4
Oh, |
comment:5
Argggggg !!! Patch reverted to the former one Nathann |
comment:6
Attachment: trac_11942.patch.gz ... but... even though Anyway don't worry about it, I'll do that in another patch later :) Sorry, didn't get much time to look at this earlier this week. |
comment:7
Replying to @kini:
Arggggggggggg !!!
Good !! THaaaaanks ! Nathann |
Milestone sage-4.7.3 deleted |
Changed reviewer from Keshav Kini to Keshav Kini, David Coudert |
comment:9
I don't understand why you have both stopped the discussion without concluding on the status of this patch. I have no problem when installing the patch and building the documentation. For me the patch is correct, so I give a positive review. Best, |
comment:10
Please read the comments. The ValueError needs to be changed to KeyError, and also I wanted to understand the following before giving it a positive review, as possibly the fix could be improved (multiple code paths for a single purpose is bad design):
Sorry for neglecting this ticket for so long. |
Changed keywords from none to segfault cython |
comment:11
Well, I'm still not sure about the multiple code paths. But here is a patch to use better exceptions throughout the file in question, though that's sort of tangential to the original purpose of the ticket. This ticket has been sitting around too long for me to delay it any further just because of my ignorance of the Cython graphs code, especially since it fixes a segfault, so I will give a positive review to Nathann's part. Maybe someone can review my exceptions patch? It passes |
Changed reviewer from Keshav Kini, David Coudert to Keshav Kini, David Coudert, Nathann Cohen |
comment:20
Hurrah! Thanks for the review (and the original patch)! BTW, I botched that 2001 quote above... it should be "I'm sorry, Dave, I'm afraid I can't do that", of course |
comment:21
No harm done, we both watched the french version of it |
Use LookupError instead of ValueError or KeyError |
Changed author from Nathann Cohen, Keshav Kini to Nathann Cohen, Keshav Kini, Jeroen Demeyer |
comment:23
Attachment: trac_11942-exceptions.2.patch.gz Since |
This comment has been minimized.
This comment has been minimized.
comment:25
Oh, I was under the impression that those base classes shouldn't be instantiated, but that seems to be unfounded after reading the docs. Looks good to me! Lines 855-856 of |
comment:26
Whoops, didn't mean to change the milestone. |
comment:27
Well, these lines are contained in the NetworkX backend, so it may mean that they define their own Exceptions in the NetworkX project. I do not think this class is still used in Sage anyway. Nathann |
comment:28
But didn't Sage developers write that NetworkX backend wrapper? Well, never mind, if it's not used in Sage anymore. |
comment:29
Well yes, and that's most probably this class. But if you run some code made for NetworkX on a Sage graph with our own exception it may break the NetworkX code. I guess this was the point of importing exceptions. Thank you for the patch Jeroen ! Nathann |
comment:30
Replying to @nathanncohen:
Aha, now I get it. And yes, thanks Jeroen :) |
Merged: sage-5.0.beta0 |
As title.
Apply:
Component: graph theory
Keywords: segfault cython
Author: Nathann Cohen, Keshav Kini, Jeroen Demeyer
Reviewer: Keshav Kini, David Coudert, Nathann Cohen
Merged: sage-5.0.beta0
Issue created by migration from https://trac.sagemath.org/ticket/11942
The text was updated successfully, but these errors were encountered: