{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/10848","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/10848/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/10848/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/10848/events","html_url":"https://github.com/JuliaLang/julia/issues/10848","id":68898357,"number":10848,"title":"Segfault due to `size(A, 0)` call in untaken branch","user":{"login":"timholy","id":1525481,"avatar_url":"https://avatars.githubusercontent.com/u/1525481?v=3","gravatar_id":"","url":"https://api.github.com/users/timholy","html_url":"https://github.com/timholy","followers_url":"https://api.github.com/users/timholy/followers","following_url":"https://api.github.com/users/timholy/following{/other_user}","gists_url":"https://api.github.com/users/timholy/gists{/gist_id}","starred_url":"https://api.github.com/users/timholy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timholy/subscriptions","organizations_url":"https://api.github.com/users/timholy/orgs","repos_url":"https://api.github.com/users/timholy/repos","events_url":"https://api.github.com/users/timholy/events{/privacy}","received_events_url":"https://api.github.com/users/timholy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-04-16T10:52:35Z","updated_at":"2015-04-19T13:32:13Z","closed_at":"2015-04-17T03:29:16Z","body":"```julia\r\njulia> versioninfo()\r\nJulia Version 0.4.0-dev+4287\r\nCommit bd748b9* (2015-04-16 09:12 UTC)\r\nPlatform Info:\r\n  System: Linux (x86_64-linux-gnu)\r\n  CPU: Intel(R) Core(TM) i7 CPU       L 640  @ 2.13GHz\r\n  WORD_SIZE: 64\r\n  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)\r\n  LAPACK: libopenblas\r\n  LIBM: libopenlibm\r\n  LLVM: libLLVM-3.3\r\n\r\njulia> timedim(::AbstractVector) = 0\r\ntimedim (generic function with 1 method)\r\n\r\njulia> function nimages(img)\r\n           sd = timedim(img)\r\n           if sd > 0\r\n               return size(img, sd)\r\n           end\r\n           1\r\n       end\r\nnimages (generic function with 1 method)\r\n\r\njulia> nimages(1:5)\r\n\r\nsignal (11): Segmentation fault\r\nunknown function (ip: 1297435371)\r\nunknown function (ip: 1297502692)\r\nunknown function (ip: 1297473824)\r\nunknown function (ip: 1297511175)\r\nunknown function (ip: 1297476908)\r\nunknown function (ip: 1297548337)\r\nunknown function (ip: 1297557404)\r\nunknown function (ip: 1297557692)\r\njl_trampoline at /home/tim/src/julia/usr/bin/../lib/libjulia.so (unknown line)\r\njl_apply_generic at /home/tim/src/julia/usr/bin/../lib/libjulia.so (unknown line)\r\nunknown function (ip: 1297639195)\r\nunknown function (ip: 1297636354)\r\nunknown function (ip: 1297716179)\r\njl_toplevel_eval_in at /home/tim/src/julia/usr/bin/../lib/libjulia.so (unknown line)\r\neval_user_input at REPL.jl:60\r\njlcall_eval_user_input_160255 at  (unknown line)\r\njl_apply_generic at /home/tim/src/julia/usr/bin/../lib/libjulia.so (unknown line)\r\nanonymous at task.jl:89\r\nunknown function (ip: 1297665696)\r\nunknown function (ip: 0)\r\nSegmentation fault (core dumped)\r\n```\r\nIt looks like the problem stems from the call to `size`; if I replace `size(img, sd)` with `size(img, sd+1)`, then I don't get the segfault. Is this failure caused by branch prediction gone awry? \r\n"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/94277269","html_url":"https://github.com/JuliaLang/julia/issues/10848#issuecomment-94277269","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/10848","id":94277269,"user":{"login":"timholy","id":1525481,"avatar_url":"https://avatars.githubusercontent.com/u/1525481?v=3","gravatar_id":"","url":"https://api.github.com/users/timholy","html_url":"https://github.com/timholy","followers_url":"https://api.github.com/users/timholy/followers","following_url":"https://api.github.com/users/timholy/following{/other_user}","gists_url":"https://api.github.com/users/timholy/gists{/gist_id}","starred_url":"https://api.github.com/users/timholy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timholy/subscriptions","organizations_url":"https://api.github.com/users/timholy/orgs","repos_url":"https://api.github.com/users/timholy/repos","events_url":"https://api.github.com/users/timholy/events{/privacy}","received_events_url":"https://api.github.com/users/timholy/received_events","type":"User","site_admin":false},"created_at":"2015-04-19T13:32:13Z","updated_at":"2015-04-19T13:32:13Z","body":"Verified as fixed on current master."}}