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

Iterating over a non-iterable object causes a stack overflow #28392

Closed
rdeits opened this issue Aug 1, 2018 · 1 comment
Closed

Iterating over a non-iterable object causes a stack overflow #28392

rdeits opened this issue Aug 1, 2018 · 1 comment
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@rdeits
Copy link
Contributor

rdeits commented Aug 1, 2018

I think this is the reason Julia is essentially hanging in JuliaMath/SpecialFunctions.jl#107 and JuliaPackaging/CMakeWrapper.jl#14 because some other issue is causing us to try to iterate over a Symbol.

Here's a simple reproduction:

julia> struct Foo; end

julia> iterate(Foo())
┌ Warning: The start/next/done iteration protocol is deprecated. Use `iterate` instead.
│   caller = iterate(::Foo) at essentials.jl:853
└ @ Base ./essentials.jl:853

That warning prints once and then Julia hangs for a very long time (I haven't the patience to find out how long). Interrupting it with ctrl+C shows the stack overflow:

^CERROR: InterruptException:
Stacktrace:
 ... (the last 2 lines are repeated 10917 more times)
 [21842] backtrace() at ./stacktraces.jl:167
 [21842] macro expansion at ./deprecated.jl:72 [inlined]
 [21842] macro expansion at ./logging.jl:311 [inlined]
 [21842] depwarn(::String, ::Symbol) at ./deprecated.jl:68
 [21842] start(::Foo) at ./essentials.jl:879
 [21842] iterate(::Foo) at ./essentials.jl:853
 [21842] start(::Foo) at ./essentials.jl:880
 [21842] iterate(::Foo) at ./essentials.jl:853

it looks like the fallback start() is calling iterate() and the fallback iterate() is calling start().

@rdeits
Copy link
Contributor Author

rdeits commented Aug 1, 2018

Looks like this is probably fixed by #28391

@JeffBezanson JeffBezanson added the bug Indicates an unexpected problem or unintended behavior label Aug 1, 2018
Keno added a commit that referenced this issue Aug 1, 2018
Keno added a commit that referenced this issue Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants