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

Malformed view created by ntuple on master #34206

Closed
mwarusz opened this issue Dec 28, 2019 · 1 comment · Fixed by #34243
Closed

Malformed view created by ntuple on master #34206

mwarusz opened this issue Dec 28, 2019 · 1 comment · Fixed by #34243
Labels
bug Indicates an unexpected problem or unintended behavior compiler:codegen Generation of LLVM IR and native code regression Regression in behavior compared to a previous version
Milestone

Comments

@mwarusz
Copy link

mwarusz commented Dec 28, 2019

function mre()
  a = [44]
  b = ntuple(_ -> view(a, :), 1)[1]
  @assert pointer(a) == pointer(b)
end

The assertion in the above function fails on

julia> versioninfo()
Julia Version 1.4.0-DEV.667
Commit acb7bd93fb* (2019-12-27 21:20 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)

Works fine on 1.3 and it seems like this issue was introduced by the recent layout changes.

@mwarusz mwarusz changed the title Malformed view created by ntuple Malformed view created by ntuple on master Dec 28, 2019
@JeffBezanson JeffBezanson added this to the 1.4 milestone Dec 28, 2019
@JeffBezanson JeffBezanson added the regression Regression in behavior compared to a previous version label Dec 28, 2019
@JeffBezanson
Copy link
Member

Further reduced:

julia> function mre(a)
         b = ntuple(_ -> view(a, :), 1)[1]
         b.offset1
       end

julia> mre([44])
139733040981712

Keno added a commit that referenced this issue Dec 28, 2019
This fastpath wasn't checking whether or not the element type
was inline allocated or not.

Fixes #34206
Fixes #34207
Keno added a commit that referenced this issue Dec 28, 2019
This fastpath wasn't checking whether or not the element type
was inline allocated or not.

Fixes #34206
Fixes #34207
@Keno Keno added bug Indicates an unexpected problem or unintended behavior compiler:codegen Generation of LLVM IR and native code labels Dec 28, 2019
KristofferC pushed a commit that referenced this issue Jan 8, 2020
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 compiler:codegen Generation of LLVM IR and native code regression Regression in behavior compared to a previous version
Projects
None yet
3 participants