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

Segfault in complex array comprehensions #14786

Closed
ahonkela opened this issue Jan 25, 2016 · 9 comments
Closed

Segfault in complex array comprehensions #14786

ahonkela opened this issue Jan 25, 2016 · 9 comments
Labels
bug Indicates an unexpected problem or unintended behavior needs tests Unit tests are required for this change types and dispatch Types, subtyping and method dispatch

Comments

@ahonkela
Copy link

The below code snippet segfaults Julia 0.4.x, both on Mac (0.4.2 from Homebrew) and on Linux (self-built release-0.4 branch):

N = 51

function f(repeats)
    return zeros(repeats, N)
end

results = [((x, y), f(100)) for x in 1:2, y in 1:2]

Backtrace and full version info are at:
https://gist.github.com/ahonkela/516a7e6b530795c4ade1

Antti

@pfitzseb
Copy link
Member

Interestingly enough, declaring N as const N = 51 works fine.

@mauro3
Copy link
Contributor

mauro3 commented Jan 25, 2016

Crashes my 0.4.3 as well (although with different backtrace). Works fine on 0.3.12

@yuyichao yuyichao added the bug Indicates an unexpected problem or unintended behavior label Jan 25, 2016
@yuyichao
Copy link
Contributor

Somehow the type of results is not a concrete type ....

(gdb) p jl_(jl_typeof(args[0]))
Array{Tuple{Tuple{Int64, Int64}, Array{#T<:Any, N<:Any}}, 2}

Probably related to #7258

@yuyichao yuyichao added the types and dispatch Types, subtyping and method dispatch label Jan 25, 2016
@yuyichao
Copy link
Contributor

This case seems to be fixed now due to improvement in type inference.

@tkelman
Copy link
Contributor

tkelman commented May 18, 2016

add the test to close then?

@ahonkela
Copy link
Author

Just to verify: works for me too now on current master.

I did not check current 0.4 series. If not, it would be great if the fix can be backported there too.

@yuyichao
Copy link
Contributor

The issue is hidden due to unrelated changes (either type inference or definition of zeros, neither is likely backportable). The real bug is still not fixed (i.e. #16420).

@JeffBezanson JeffBezanson added the needs tests Unit tests are required for this change label Jun 27, 2016
@vtjnash
Copy link
Member

vtjnash commented Jul 20, 2016

rendered irrelevant by jb/comprehensions

@vtjnash vtjnash closed this as completed Jul 20, 2016
@tkelman
Copy link
Contributor

tkelman commented Jul 20, 2016

still may as well add that test?

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 needs tests Unit tests are required for this change types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

7 participants