{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/12122","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/12122/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/12122/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/12122/events","html_url":"https://github.com/JuliaLang/julia/issues/12122","id":94521087,"number":12122,"title":"ccall test races with GC","user":{"login":"JeffBezanson","id":744556,"avatar_url":"https://avatars.githubusercontent.com/u/744556?v=3","gravatar_id":"","url":"https://api.github.com/users/JeffBezanson","html_url":"https://github.com/JeffBezanson","followers_url":"https://api.github.com/users/JeffBezanson/followers","following_url":"https://api.github.com/users/JeffBezanson/following{/other_user}","gists_url":"https://api.github.com/users/JeffBezanson/gists{/gist_id}","starred_url":"https://api.github.com/users/JeffBezanson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeffBezanson/subscriptions","organizations_url":"https://api.github.com/users/JeffBezanson/orgs","repos_url":"https://api.github.com/users/JeffBezanson/repos","events_url":"https://api.github.com/users/JeffBezanson/events{/privacy}","received_events_url":"https://api.github.com/users/JeffBezanson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/test","name":"test","color":"e102d8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-12T01:02:39Z","updated_at":"2015-07-16T19:37:12Z","closed_at":null,"body":"I once saw this in MEMDEBUG mode. It depends on precise timing but it's pretty clear what's going on:\r\n\r\n```\r\n     * ccall               exception on 1: ERROR: LoadError: test failed: -4919131752989213765 is 881\r\n in expression: unsafe_load(ccall_echo_func(IntLike(881),Ptr{IntLike},Ref{IntLike})).x === 881\r\n in error at ./error.jl:21\r\n in default_handler at test.jl:29\r\n in do_test at test.jl:52\r\n in include at ./boot.jl:254\r\n in runtests at /home/jeff/src/julia/test/testdefs.jl:197\r\n in anonymous at multi.jl:629\r\n in run_work_thunk at multi.jl:590\r\n in remotecall_fetch at multi.jl:663\r\n in remotecall_fetch at multi.jl:678\r\n in anonymous at task.jl:1401\r\nwhile loading /home/jeff/src/julia/test/ccall.jl, in expression starting on line 20\r\nERROR: LoadError: LoadError: test failed: -4919131752989213765 is 881\r\n in expression: unsafe_load(ccall_echo_func(IntLike(881),Ptr{IntLike},Ref{IntLike})).x === 881\r\n in error at ./error.jl:21\r\n in default_handler at test.jl:29\r\n in do_test at test.jl:52\r\n in include at ./boot.jl:254\r\n in runtests at /home/jeff/src/julia/test/testdefs.jl:197\r\n in anonymous at multi.jl:629\r\n in run_work_thunk at multi.jl:590\r\n in remotecall_fetch at multi.jl:663\r\n in remotecall_fetch at multi.jl:678\r\n in anonymous at task.jl:1401\r\nwhile loading /home/jeff/src/julia/test/ccall.jl, in expression starting on line 20\r\nwhile loading /home/jeff/src/julia/test/runtests.jl, in expression starting on line 5\r\n```\r\n\r\n`-4919131752989213765` is `0xbbbbbbbbbbbbbbbb`, so the `IntLike` value must have been freed before its contents could be loaded."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/122063557","html_url":"https://github.com/JuliaLang/julia/issues/12122#issuecomment-122063557","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/12122","id":122063557,"user":{"login":"carnaval","id":5307791,"avatar_url":"https://avatars.githubusercontent.com/u/5307791?v=3","gravatar_id":"","url":"https://api.github.com/users/carnaval","html_url":"https://github.com/carnaval","followers_url":"https://api.github.com/users/carnaval/followers","following_url":"https://api.github.com/users/carnaval/following{/other_user}","gists_url":"https://api.github.com/users/carnaval/gists{/gist_id}","starred_url":"https://api.github.com/users/carnaval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carnaval/subscriptions","organizations_url":"https://api.github.com/users/carnaval/orgs","repos_url":"https://api.github.com/users/carnaval/repos","events_url":"https://api.github.com/users/carnaval/events{/privacy}","received_events_url":"https://api.github.com/users/carnaval/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T19:37:12Z","updated_at":"2015-07-16T19:37:12Z","body":"Well, if I read the ccall test correctly this is supposed to happen right ? Couldn't we just manually root the IntLike instance by hoisting it into a variable ?"}}