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

Infinite recursion of == operation on mutable struct causes Bus error #32516

Closed
tk3369 opened this issue Jul 7, 2019 · 2 comments
Closed

Infinite recursion of == operation on mutable struct causes Bus error #32516

tk3369 opened this issue Jul 7, 2019 · 2 comments

Comments

@tk3369
Copy link
Contributor

tk3369 commented Jul 7, 2019

A minor error handling issue. I would expect a StackOverflowError but instead it crashed.

julia> mutable struct Bar end

julia> Base.:(==)(a::Bar, b::Bar) = a == b

julia> a = Bar(); b = Bar();

julia> a == b
Bus error: 10

It works fine for immutable struct:

julia> struct Foo end

julia> Base.:(==)(a::Foo, b::Foo) = a == b

julia> a = Foo(); b = Foo();

julia> a == b
ERROR: StackOverflowError:
Stacktrace:
 [1] ==(::Foo, ::Foo) at ./REPL[15]:1 (repeats 80000 times)
@yuyichao
Copy link
Contributor

yuyichao commented Jul 7, 2019

Likely dup of #17109

@yuyichao
Copy link
Contributor

yuyichao commented Dec 9, 2019

From the reporter's other post I assume this is on mac and therefore a dup. Feel free to comment if this isn't on a mac.

@yuyichao yuyichao closed this as completed Dec 9, 2019
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

2 participants