{"action":"created","issue":{"url":"https://api.github.com/repos/object88/langd/issues/29","repository_url":"https://api.github.com/repos/object88/langd","labels_url":"https://api.github.com/repos/object88/langd/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/object88/langd/issues/29/comments","events_url":"https://api.github.com/repos/object88/langd/issues/29/events","html_url":"https://github.com/object88/langd/issues/29","id":294445779,"number":29,"title":"Use workspace locks in requests","user":{"login":"object88","id":11822106,"avatar_url":"https://avatars0.githubusercontent.com/u/11822106?v=4","gravatar_id":"","url":"https://api.github.com/users/object88","html_url":"https://github.com/object88","followers_url":"https://api.github.com/users/object88/followers","following_url":"https://api.github.com/users/object88/following{/other_user}","gists_url":"https://api.github.com/users/object88/gists{/gist_id}","starred_url":"https://api.github.com/users/object88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/object88/subscriptions","organizations_url":"https://api.github.com/users/object88/orgs","repos_url":"https://api.github.com/users/object88/repos","events_url":"https://api.github.com/users/object88/events{/privacy}","received_events_url":"https://api.github.com/users/object88/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-05T16:02:13Z","updated_at":"2018-02-05T19:00:34Z","closed_at":null,"author_association":"OWNER","body":"The request implementations do not currently take advantage of the locks that the workspace provides, which can allow runtime errors.\r\n"},"comment":{"url":"https://api.github.com/repos/object88/langd/issues/comments/363186347","html_url":"https://github.com/object88/langd/issues/29#issuecomment-363186347","issue_url":"https://api.github.com/repos/object88/langd/issues/29","id":363186347,"user":{"login":"object88","id":11822106,"avatar_url":"https://avatars0.githubusercontent.com/u/11822106?v=4","gravatar_id":"","url":"https://api.github.com/users/object88","html_url":"https://github.com/object88","followers_url":"https://api.github.com/users/object88/followers","following_url":"https://api.github.com/users/object88/following{/other_user}","gists_url":"https://api.github.com/users/object88/gists{/gist_id}","starred_url":"https://api.github.com/users/object88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/object88/subscriptions","organizations_url":"https://api.github.com/users/object88/orgs","repos_url":"https://api.github.com/users/object88/repos","events_url":"https://api.github.com/users/object88/events{/privacy}","received_events_url":"https://api.github.com/users/object88/received_events","type":"User","site_admin":false},"created_at":"2018-02-05T19:00:34Z","updated_at":"2018-02-05T19:00:34Z","author_association":"OWNER","body":"Example steps to show problem:\r\n\r\n- Load a very large workspace (i.e., Hugo)\r\n- Before the project has finished loading, try to get the definition of an ident\r\n\r\nError log looks something like:\r\n```\r\npanic: runtime error: invalid memory address or nil pointer dereference\r\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x14aba3c]\r\n\r\ngoroutine 1872 [running]:\r\ngithub.com/object88/langd.(*Workspace).LocateDeclaration.func1(0x1904ba0, 0xc42092f920, 0x12698)\r\n\t/Users/bropa18/work/src/github.com/object88/langd/workspace.go:183 +0x36c\r\ngo/ast.inspector.Visit(0xc43df39e20, 0x1904ba0, 0xc42092f920, 0x23, 0xc420db9770)\r\n\t/usr/local/Cellar/go/1.9.3/libexec/src/go/ast/walk.go:373 +0x3a\r\ngo/ast.Walk(0x1901be0, 0xc43df39e20, 0x1904ba0, 0xc42092f920)\r\n\t/usr/local/Cellar/go/1.9.3/libexec/src/go/ast/walk.go:52 +0x66\r\ngo/ast.Walk(0x1901be0, 0xc43df39e20, 0x19042e0, 0xc4209e1480)\r\n\t/usr/local/Cellar/go/1.9.3/libexec/src/go/ast/walk.go:136 +0x1041\r\ngo/ast.walkExprList(0x1901be0, 0xc43df39e20, 0xc420a6fcf0, 0x1, 0x1)\r\n\t/usr/local/Cellar/go/1.9.3/libexec/src/go/ast/walk.go:26 +0x81\r\ngo/ast.Walk(0x1901be0, 0xc43df39e20, 0x19040e0, 0xc4209e14c0)\r\n\t/usr/local/Cellar/go/1.9.3/libexec/src/go/ast/walk.go:207 +0x2122\r\ngo/ast.walkStmtList(0x1901be0, 0xc43df39e20, 0xc420eb5300, 0x8, 0x8)\r\n\t/usr/local/Cellar/go/1.9.3/libexec/src/go/ast/walk.go:32 +0x81\r\ngo/ast.Walk(0x1901be0, 0xc43df39e20, 0x1904260, 0xc420975530)\r\n\t/usr/local/Cellar/go/1.9.3/libexec/src/go/ast/walk.go:224 +0x1b7a\r\ngo/ast.Walk(0x1901be0, 0xc43df39e20, 0x19046e0, 0xc420975560)\r\n\t/usr/local/Cellar/go/1.9.3/libexec/src/go/ast/walk.go:344 +0xd83\r\ngo/ast.walkDeclList(0x1901be0, 0xc43df39e20, 0xc420cf0a00, 0x9, 0x10)\r\n\t/usr/local/Cellar/go/1.9.3/libexec/src/go/ast/walk.go:38 +0x81\r\ngo/ast.Walk(0x1901be0, 0xc43df39e20, 0x1904660, 0xc420eb5380)\r\n\t/usr/local/Cellar/go/1.9.3/libexec/src/go/ast/walk.go:353 +0x2672\r\ngo/ast.Inspect(0x1904660, 0xc420eb5380, 0xc43df39e20)\r\n\t/usr/local/Cellar/go/1.9.3/libexec/src/go/ast/walk.go:385 +0x4b\r\ngithub.com/object88/langd.(*Workspace).LocateDeclaration(0xc420170450, 0xc440c8ea50, 0xc42092f900, 0x0, 0x0)\r\n\t/Users/bropa18/work/src/github.com/object88/langd/workspace.go:160 +0x277\r\ngithub.com/object88/langd/requests.(*definitionHandler).work(0xc42a85ed40, 0x756ea1054a2a01, 0xc43aad67c0)\r\n\t/Users/bropa18/work/src/github.com/object88/langd/requests/definition.go:72 +0x7c\r\ngithub.com/object88/langd/requests.(*Handler).finishProcessing(0xc42008f860, 0x190d140, 0xc42a85ed40)\r\n\t/Users/bropa18/work/src/github.com/object88/langd/requests/handler.go:197 +0x35\r\ncreated by github.com/object88/langd/requests.(*Handler).startProcessing\r\n\t/Users/bropa18/work/src/github.com/object88/langd/requests/handler.go:193 +0x109\r\n```\r\n\r\nProblem is suspected to be that once the project is opened, we handle the `didOpen` request, which will cause the package to _reload_.  We immediately then run `definition`, but the reload hasn't finished, so we get a nil package pointer.  This is bad, m'key?\r\n"}}
{"actor":{"display_login":"object88"}}