Skip to content
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

self-referential Dict-key crashes Julia #7217

Closed
mauro3 opened this issue Jun 11, 2014 · 4 comments
Closed

self-referential Dict-key crashes Julia #7217

mauro3 opened this issue Jun 11, 2014 · 4 comments

Comments

@mauro3
Copy link
Contributor

mauro3 commented Jun 11, 2014

a=Dict();
a[a]=5;
a[a]=6; # stack overflow

Note, this works with ObjectIdDict. The stack overflow still happens after the fix #3066. This issue is somewhat related to #3847.

@JeffBezanson
Copy link
Member

I'm not sure this is a real issue. Simply mutating values used as dict keys already causes problems. As for reference cycles, I suspect it is not worth the trouble and overhead to require all == and hash methods to handle them.

@kmsquire
Copy link
Member

Does Julia actually crash?

On Wednesday, June 11, 2014, Jeff Bezanson [email protected] wrote:

I'm not sure this is a real issue. Simply mutating values used as dict
keys already causes problems. As for reference cycles, I suspect it is not
worth the trouble and overhead to require all == and hash methods to handle
them.


Reply to this email directly or view it on GitHub
#7217 (comment).

@mauro3
Copy link
Contributor Author

mauro3 commented Jun 11, 2014

You can close this, I don't need a fix, just something I stumbled upon.

How would something similar show up with ==?

And no, no crash, just a stack overflow. (I just copied the title from #3847...)

@JeffBezanson
Copy link
Member

== would have to be able to compare objects with reference cycles; that's required for table lookup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants