{"action":"closed","issue":{"url":"https://api.github.com/repos/chrsmithdemos/codesearch/issues/1","labels_url":"https://api.github.com/repos/chrsmithdemos/codesearch/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/chrsmithdemos/codesearch/issues/1/comments","events_url":"https://api.github.com/repos/chrsmithdemos/codesearch/issues/1/events","html_url":"https://github.com/chrsmithdemos/codesearch/issues/1","id":58990658,"number":1,"title":"cindex fails on the first run: mmap() returns EINVAL","user":{"login":"GoogleCodeExporter","id":9614759,"avatar_url":"https://avatars.githubusercontent.com/u/9614759?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCodeExporter","html_url":"https://github.com/GoogleCodeExporter","followers_url":"https://api.github.com/users/GoogleCodeExporter/followers","following_url":"https://api.github.com/users/GoogleCodeExporter/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCodeExporter/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCodeExporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCodeExporter/subscriptions","organizations_url":"https://api.github.com/users/GoogleCodeExporter/orgs","repos_url":"https://api.github.com/users/GoogleCodeExporter/repos","events_url":"https://api.github.com/users/GoogleCodeExporter/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCodeExporter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chrsmithdemos/codesearch/labels/auto-migrated","name":"auto-migrated","color":"ededed"},{"url":"https://api.github.com/repos/chrsmithdemos/codesearch/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/chrsmithdemos/codesearch/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-25T23:55:55Z","updated_at":"2015-02-25T23:55:56Z","closed_at":"2015-02-25T23:55:55Z","body":"```\nWhat steps will reproduce the problem?\n1. build all utils (or download binaries from this site)\n2. be sure that there is no .csearchindex (or it has zero size)\n3. run `cindex /usr/include` or any other path\n\n`cindex` fails, because mmap returns error with EINVAL code.\nThis happens inside mmap_linux.go, on line 24.\nThat function (mmapFile) calls mmap with zero size, which fails.\nI had manually copy ~/.csearchindex\\~ to ~/.csearchindex.\nThat fixed the issue.\n\nI expected cindex to work right out of the box, even with no .csearchindex.\n\nI'm using:\nGentoo Base System release 2.0.3, Linux 3.1.6, amd64.\nGo repository is the newest (built a few minutes ago from head).\n```\n\n-----\nOriginal issue reported on code.google.com by `zaitsev....@gmail.com` on 19 Jan 2012 at 8:10"}}