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 when constructing type #7564

Closed
anj1 opened this issue Jul 11, 2014 · 5 comments
Closed

Segfault when constructing type #7564

anj1 opened this issue Jul 11, 2014 · 5 comments

Comments

@anj1
Copy link

anj1 commented Jul 11, 2014

The following code:

type MyType{T,S}
   a::S
   b::S
end

MyType{1,Rational{Integer}}(1,1)

Segfaults. On the other hand, this doesn't:

MyType{2,Rational{Int64}}(1,1)    
@quinnj
Copy link
Member

quinnj commented Jul 11, 2014

What's the output of versioninfo() for your setup?

@anj1
Copy link
Author

anj1 commented Jul 11, 2014

julia> versioninfo()
Julia Version 0.3.0-prerelease+4134
Commit d42b141* (2014-07-11 00:01 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM)2 Duo CPU     T9550  @ 2.66GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Penryn)
  LAPACK: libopenblas
  LIBM: libopenlibm

@anj1
Copy link
Author

anj1 commented Jul 11, 2014

Btw I was on an earlier prerelease when I discovered the error; I upgraded to the newest github repo but still got the same error.

@quinnj
Copy link
Member

quinnj commented Jul 11, 2014

This smells oddly familiar to #6387 and @JeffBezanson's discussion in the fix.

@anj1
Copy link
Author

anj1 commented Jul 13, 2014

Nice one!

sjkelly pushed a commit to sjkelly/julia that referenced this issue Jul 14, 2014
this is a combination of convert(Rational{T},x) not returning the
correct type, and the lack of a type check in codegen for new().
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