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 on tuple-type return type declaration #21271

Closed
cstjean opened this issue Apr 4, 2017 · 0 comments
Closed

Segfault on tuple-type return type declaration #21271

cstjean opened this issue Apr 4, 2017 · 0 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@cstjean
Copy link
Contributor

cstjean commented Apr 4, 2017

This code didn't segfault on 0.5. (I know --- this isn't correct Julia; #11535, #10947)

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.6.0-pre.beta.15 (2017-04-04 12:08 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 18e864b828 (0 days old master)
|__/                   |  x86_64-apple-darwin13.4.0

julia> foo()::Tuple{Type{Int}, Type{Float64}} = (Int, Float64)
foo (generic function with 1 method)

julia> foo()

signal (4): Illegal instruction: 4
while loading no file, in expression starting on line 0
foo at ./<missing>:0
unknown function (ip: 0x31ab5970f)
do_call at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:75
eval at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:242
jl_interpret_toplevel_expr at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/interpreter.c:34
jl_toplevel_eval_flex at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/toplevel.c:577
jl_toplevel_eval_in at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/builtins.c:484
eval at ./boot.jl:235
jlcall_eval_18129 at /Applications/Julia-0.6.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
eval_user_input at ./REPL.jl:66
unknown function (ip: 0x31ab55976)
macro expansion at ./REPL.jl:97 [inlined]
#1 at ./event.jl:73
unknown function (ip: 0x31ab5074f)
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia.h:1416 [inlined]
start_task at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/task.c:261
Allocations: 1432893 (Pool: 1431447; Big: 1446); GC: 0
Illegal instruction: 4

It might be because convert returns a value of the "wrong" type; T = Tuple{Type{Int}}; convert(T, (Int,))::T is an error.

@JeffBezanson JeffBezanson self-assigned this Apr 4, 2017
@JeffBezanson JeffBezanson added the bug Indicates an unexpected problem or unintended behavior label Apr 4, 2017
vtjnash added a commit that referenced this issue Apr 4, 2017
we were assuming that `type <: typeof(x)` implies that `x isa type`
but this is false if `type` is not constructible

fix #21271
@JeffBezanson JeffBezanson added this to the 0.6.x milestone Apr 4, 2017
@vtjnash vtjnash closed this as completed in d6c5c67 Apr 5, 2017
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