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

make inference of _apply match the implementation more closely #30483

Merged
merged 1 commit into from
Jan 2, 2019

Conversation

JeffBezanson
Copy link
Member

This fixes the crash in #30470.

@JeffBezanson JeffBezanson added bugfix This change fixes an existing bug compiler:inference Type inference backport pending 1.0 labels Dec 21, 2018
@JeffBezanson
Copy link
Member Author

JeffBezanson commented Dec 21, 2018

Interesting failure on travis 32-bit:

      From worker 5:	julia: /home/travis/build/JuliaLang/julia/src/julia.h:764: jl_value_t* jl_svecref(void*, size_t): Assertion `(((jl_value_t*)(((jl_taggedvalue_t*)((char*)(t) - sizeof(jl_taggedvalue_t)))->header & ~(uintptr_t)15))==(jl_value_t*)(jl_simplevector_type))' failed.
      From worker 5:	
      From worker 5:	signal (6): Aborted
      From worker 5:	in expression starting at /tmp/julia/share/julia/test/subarray.jl:315
      From worker 5:	__kernel_vsyscall at  (unknown line)
      From worker 5:	gsignal at /lib/i386-linux-gnu/libc.so.6 (unknown line)
      From worker 5:	abort at /lib/i386-linux-gnu/libc.so.6 (unknown line)
      From worker 5:	unknown function (ip: 0xf727c7c6)
      From worker 5:	__assert_fail at /lib/i386-linux-gnu/libc.so.6 (unknown line)
      From worker 4:	running testset intrinsics...
      From worker 5:	jl_svecref at /home/travis/build/JuliaLang/julia/src/julia.h:764
      From worker 5:	jl_svecref at /home/travis/build/JuliaLang/julia/src/julia.h:767
      From worker 5:	is_tupletype_homogeneous at /home/travis/build/JuliaLang/julia/src/cgutils.cpp:696
      From worker 5:	emit_builtin_call at /home/travis/build/JuliaLang/julia/src/codegen.cpp:2741
      From worker 5:	emit_call at /home/travis/build/JuliaLang/julia/src/codegen.cpp:3200

Maybe there's a type that's not rooted during codegen?

@martinholters
Copy link
Member

Ref. #27434 (comment)

@JeffBezanson
Copy link
Member Author

I think what's happening is that Core.Compiler only splats types with special built-in support: tuple, array, and simplevector. But inference abstractly calls iterate on them, and Base.iterate doesn't have methods defined in the inference world, so it thinks iteration is a method error. So a possible alternate fix is to add inference special cases for all of those types, to match the implementation of _apply.

@JeffBezanson
Copy link
Member Author

Ok I switched to that alternate approach.

@JeffBezanson JeffBezanson changed the title look for iterate relative to calling module in inference make inference of _apply match the implementation more closely Dec 22, 2018
This was referenced Dec 27, 2018
@JeffBezanson JeffBezanson merged commit 3e6f607 into master Jan 2, 2019
@JeffBezanson JeffBezanson deleted the jb/abstractiter branch January 2, 2019 20:00
KristofferC pushed a commit that referenced this pull request Jan 5, 2019
@KristofferC KristofferC mentioned this pull request Jan 5, 2019
15 tasks
@StefanKarpinski StefanKarpinski added triage This should be discussed on a triage call backport 1.0 and removed backport 1.0 triage This should be discussed on a triage call labels Jan 31, 2019
@StefanKarpinski StefanKarpinski added backport 1.0 triage This should be discussed on a triage call and removed triage This should be discussed on a triage call labels Jan 31, 2019
@JeffBezanson JeffBezanson removed triage This should be discussed on a triage call triage backport pending 1.0 labels Jan 31, 2019
@KristofferC KristofferC mentioned this pull request Feb 4, 2019
39 tasks
@KristofferC
Copy link
Member

This doesn't backport cleanly. Please push a commit to #30954.

@KristofferC
Copy link
Member

Removing from backport since backport hasn't been done in 2 months.

@henriquebecker91
Copy link
Contributor

I have stumbled over this bug again (after having a 'Unreachable Reached' error, I did a git bisect and it is the commit 41c0c2f that solved the problem for me). I am using Julia 1.0.5 exactly because it is a long term support version (I am making the code of my PhD reproducible in the long term). I have posted in the Discourse for help first. It is impossible to backport? I really shouldn't take much time of my PhD but if it was question of one or two days maybe I could give it a try.

@KristofferC
Copy link
Member

(I am making the code of my PhD reproducible in the long term)

Your PhD code is just as reproducible with e.g. Julia 1.4 as with Julia 1.0.5?

The LTS is for people with extremely conservative requirements on Julia upgrades (such as running old code in production). The vast majority of users should use the latest release.

@henriquebecker91
Copy link
Contributor

Ok, seems I misunderstood what was the purpose of the LTS version. I consider my requirements somewhat conservative (this is, I want a version that will be easy for someone to obtain in 5~20 years in the future), but I can take some extra steps and keep a repository of the source code and prebuilt binaries for this intermediary version just in case. I have no qualms with finding some critical errors if they are clearly at language fault (and I can work around them) and are not undefined behavior that may give me some wrong value that will end up in my paper.

@oscardssmith
Copy link
Member

The purpose of a LTS release is if you need things like security that mean that you need updates that won't break code. For something like this, what you need is to tell people to just use 1 particular version of the language. They don't need it to be an updated and patched version which is what the 1.0.x branch provides.

@StefanKarpinski
Copy link
Member

Right. It's not like we're going to delete Julia 1.3.1 at some point in the future and hunt down ever copy that's ever existed. We just aren't going to keep patching it forever. So for reproducibility, using the LTS is not really relevant—just document which Julia version you used. Note that 1.0 is not going to be the LTS version forever, it's very likely that 1.5 or 1.6 will be the new LTS later this year, at which point we will stop making 1.0.x releases. But that doesn't reduce the reproducibility of those versions at all—they will still be available and will still continue to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug compiler:inference Type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants