Revision f3d17d3d8e6df78e7b872c6f43da186148892406 authored by Keno Fischer on 22 April 2019, 00:52:27 UTC, committed by Keno Fischer on 26 April 2019, 22:01:56 UTC
After fixing #30118, the behavior of #31649 changed. Instead of crashing
immediately upon attempting to print `spvec`, the first time would fail
with the correct ambiguity. However, any subsequent attempts to print
the same value would yet again result in a crash. Upon investigation,
the series of events leading to this crash are as follows:

1. Showing the first error message attempts to put `convert(::Type{Any}, ::Nothing)` into
   the cache (matching the previous `convert(::Type{Any}, x::Any)` method).

2. jl_compilation_sig widens this to `convert(::DataType, x::Any)`. No guard signatures are allocated,
   because `ml_matches` does not return `convert(::Any, ::sparse_t)` because it is uncallable due to
   the ambiguity.

3. Upon the next call, we find `convert(::DataType, x::Any)` in the cache and use it. The subsequent
   successful return conflicts with type inference's result that this call will not return (i.e. is
   inferred to Union{}).

To fix this change the `ml_matches` call in step 2 to include ambiguous matches, thus allocating
guard entries for these signatures and preventing the cache match. That works for this issue, but
I should note that I have seen additional crashes along similar lines while working on this fix,
so there may be additional issues in the vicinity.

Fixes #31649
1 parent a030b0a
History
File Mode Size
.github
base
contrib
deps
doc
etc
src
stdlib
test
ui
.appveyor.yml -rw-r--r-- 2.6 KB
.gitattributes -rw-r--r-- 67 bytes
.gitignore -rw-r--r-- 257 bytes
.mailmap -rw-r--r-- 11.0 KB
.travis.yml -rw-r--r-- 6.1 KB
CITATION.bib -rw-r--r-- 2.6 KB
CONTRIBUTING.md -rw-r--r-- 21.2 KB
HISTORY.md -rw-r--r-- 258.0 KB
LICENSE.md -rw-r--r-- 5.1 KB
Make.inc -rw-r--r-- 38.9 KB
Makefile -rw-r--r-- 28.1 KB
NEWS.md -rw-r--r-- 880 bytes
README.md -rw-r--r-- 28.0 KB
VERSION -rw-r--r-- 10 bytes
sysimage.mk -rw-r--r-- 3.7 KB

README.md

back to top