{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/23230","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/23230/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/23230/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/23230/events","html_url":"https://github.com/JuliaLang/julia/issues/23230","id":249820808,"number":23230,"title":"Reproducible ReadOnlyMemoryError() or segfault","user":{"login":"drewrobson","id":1786568,"avatar_url":"https://avatars2.githubusercontent.com/u/1786568?v=4","gravatar_id":"","url":"https://api.github.com/users/drewrobson","html_url":"https://github.com/drewrobson","followers_url":"https://api.github.com/users/drewrobson/followers","following_url":"https://api.github.com/users/drewrobson/following{/other_user}","gists_url":"https://api.github.com/users/drewrobson/gists{/gist_id}","starred_url":"https://api.github.com/users/drewrobson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewrobson/subscriptions","organizations_url":"https://api.github.com/users/drewrobson/orgs","repos_url":"https://api.github.com/users/drewrobson/repos","events_url":"https://api.github.com/users/drewrobson/events{/privacy}","received_events_url":"https://api.github.com/users/drewrobson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-08-12T16:11:33Z","updated_at":"2017-08-13T18:30:11Z","closed_at":null,"body":"I've been running into a ReadOnlyMemoryError() in a large internal codebase. It is reproducible but fragile.\r\n\r\nI managed to reduce it to [this](https://gist.github.com/drewrobson/40cf301102213ba9780b95b7b4bbe098). With minor code changes, I can generate a ReadOnlyMemoryError() or cause Julia to segfault. The version provided here reproducibly segfaults Julia when it is executed in a Jupyter notebook, but not when Julia is run in a terminal (so fragile!).\r\n\r\nI know this reduced code looks pretty funny, but any attempt to reduce it further made the problem go away (commenting any line or removing any unused package from the using statement makes the segfault/ReadOnlyMemoryError go away).\r\n\r\nI modified Jupyter's kernel.json so I could automatically attach gdb and get a [backtrace](https://gist.github.com/drewrobson/f50cc67364db1c51f95fb99648af95c5).\r\n\r\nI have tested this on 0.6.0 (built on Ubuntu 16.04 with and without debug, as well as official Julia binaries) on multiple machines. I have not tested on Julia master because some of these packages don't yet work there.\r\n\r\nJulia Version 0.6.0\r\nCommit 9036443 (2017-06-19 13:05 UTC)\r\nDEBUG build\r\nPlatform Info:\r\n  OS: Linux (x86_64-linux-gnu)\r\n  CPU: Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz\r\n  WORD_SIZE: 64\r\n  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)\r\n  LAPACK: libopenblas64_\r\n  LIBM: libopenlibm\r\n  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)\r\n\r\nIt is unfortunate that this example needs to run in a Jupyter notebook to reproduce. I can provide private access to my Jupyter server if this would simplify matters."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/322058587","html_url":"https://github.com/JuliaLang/julia/issues/23230#issuecomment-322058587","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/23230","id":322058587,"user":{"login":"drewrobson","id":1786568,"avatar_url":"https://avatars2.githubusercontent.com/u/1786568?v=4","gravatar_id":"","url":"https://api.github.com/users/drewrobson","html_url":"https://github.com/drewrobson","followers_url":"https://api.github.com/users/drewrobson/followers","following_url":"https://api.github.com/users/drewrobson/following{/other_user}","gists_url":"https://api.github.com/users/drewrobson/gists{/gist_id}","starred_url":"https://api.github.com/users/drewrobson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewrobson/subscriptions","organizations_url":"https://api.github.com/users/drewrobson/orgs","repos_url":"https://api.github.com/users/drewrobson/repos","events_url":"https://api.github.com/users/drewrobson/events{/privacy}","received_events_url":"https://api.github.com/users/drewrobson/received_events","type":"User","site_admin":false},"created_at":"2017-08-13T18:30:11Z","updated_at":"2017-08-13T18:30:11Z","body":"The breaking change was this:\r\n```\r\n -    if istopfunction(tm, f, :promote_type) || istopfunction(tm, f, :typejoin)\r\n -        return Type\r\n +    if istopfunction(tm, f, :typejoin) || f === return_type\r\n +        return Type # don't try to infer these function edges directly -- it won't actually come up with anything useful\r\n```\r\n(this is part of what was cherry picked from commit 76a30fb4968dccab2adcdc3bb5eee00184df0eba)\r\n\r\nApplying just this change to the last good commit, I get the segfault. Conversely, I can revert just this change on v0.6.0 final and eliminate the segfault.\r\n\r\nThis is probably as far as I can go with this. I will defer to the experts about what it means and how it should be fixed. Thanks!"}}
{"actor":{"display_login":"drewrobson"}}