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

Objects referencing self/each other produce infinite output #4698

Closed
ingmarschuster opened this issue Oct 31, 2013 · 3 comments
Closed

Objects referencing self/each other produce infinite output #4698

ingmarschuster opened this issue Oct 31, 2013 · 3 comments

Comments

@ingmarschuster
Copy link

Objects containing refs to each other (or just self-referential objects) produce infinite output/stack overflows. Consider the following example.

type SelfRef
    sr::SelfRef

    function SelfRef()
        a = new()
        a.sr = a
        return a
    end
end

The bug gets exposed by

a = SelfRef()

The problem here seems to be mainly that printing the value does not check for cycles.

@ivarne
Copy link
Sponsor Member

ivarne commented Oct 31, 2013

This issue has been raised multiple times before #3066, #25, #1139. I think this is a reminder that someone should read through the discussions implement a solution that is good enough to get merged.

@ingmarschuster
Copy link
Author

Thanks a lot for pointing this out, indeed I havent searched for previous reports.

@pao
Copy link
Member

pao commented Oct 31, 2013

Closing in favor of existing issues.

@pao pao closed this as completed Oct 31, 2013
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

3 participants