{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/14354","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/14354/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/14354/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/14354/events","html_url":"https://github.com/JuliaLang/julia/issues/14354","id":121543773,"number":14354,"title":"flisp is not thread safe","user":{"login":"yuyichao","id":712232,"avatar_url":"https://avatars.githubusercontent.com/u/712232?v=3","gravatar_id":"","url":"https://api.github.com/users/yuyichao","html_url":"https://github.com/yuyichao","followers_url":"https://api.github.com/users/yuyichao/followers","following_url":"https://api.github.com/users/yuyichao/following{/other_user}","gists_url":"https://api.github.com/users/yuyichao/gists{/gist_id}","starred_url":"https://api.github.com/users/yuyichao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuyichao/subscriptions","organizations_url":"https://api.github.com/users/yuyichao/orgs","repos_url":"https://api.github.com/users/yuyichao/repos","events_url":"https://api.github.com/users/yuyichao/events{/privacy}","received_events_url":"https://api.github.com/users/yuyichao/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/multi-threading","name":"multi-threading","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-10T18:00:14Z","updated_at":"2015-12-10T21:46:58Z","closed_at":null,"body":"I'm pretty sure people already know this but I'm just looking for new ways to crash julia with threading and I couldn't find this problem mentioned in any open issues (https://github.com/JuliaLang/julia/issues/10421 or https://github.com/JuliaLang/julia/issues/1790).\r\n\r\nThe following code easily causes a segfault in flisp\r\n```jl\r\n@threads for i in 1:10000\r\n    parse(\"1\")\r\nend\r\n```\r\n\r\nGarding `parse(\"1\")` with a lock makes the SegFault go away. However, I'm not sure adding a `flisp` lock is the right solution here. We call back to arbitrary julia code/runtime in `macroexpand` and doing that while holding a lock doesn't sound like a particularly good idea. (We also don't hold any lock when instantiating a stage function....)\r\n\r\nWhat's the right solution here? Can we release the `flisp` lock when evaluating julia code? (can flisp handle that?) Or can flisp be made more thread safe?\r\n\r\n@JeffBezanson \r\n"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/163758812","html_url":"https://github.com/JuliaLang/julia/issues/14354#issuecomment-163758812","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/14354","id":163758812,"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},"created_at":"2015-12-10T21:46:58Z","updated_at":"2015-12-10T21:46:58Z","body":"It would be nice to have an escape hatch, e.g. make printing to stderr synchronous."}}