{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/6342","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/6342/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/6342/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/6342/events","html_url":"https://github.com/facebook/hhvm/issues/6342","id":110121008,"number":6342,"title":"hh_server --convert chokes on certain multiline strings","user":{"login":"jazzdan","id":452453,"avatar_url":"https://avatars.githubusercontent.com/u/452453?v=3","gravatar_id":"","url":"https://api.github.com/users/jazzdan","html_url":"https://github.com/jazzdan","followers_url":"https://api.github.com/users/jazzdan/followers","following_url":"https://api.github.com/users/jazzdan/following{/other_user}","gists_url":"https://api.github.com/users/jazzdan/gists{/gist_id}","starred_url":"https://api.github.com/users/jazzdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jazzdan/subscriptions","organizations_url":"https://api.github.com/users/jazzdan/orgs","repos_url":"https://api.github.com/users/jazzdan/repos","events_url":"https://api.github.com/users/jazzdan/events{/privacy}","received_events_url":"https://api.github.com/users/jazzdan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/hhvm/labels/hack","name":"hack","color":"fe8700"}],"state":"open","locked":false,"assignee":{"login":"jwatzman","id":575697,"avatar_url":"https://avatars.githubusercontent.com/u/575697?v=3","gravatar_id":"","url":"https://api.github.com/users/jwatzman","html_url":"https://github.com/jwatzman","followers_url":"https://api.github.com/users/jwatzman/followers","following_url":"https://api.github.com/users/jwatzman/following{/other_user}","gists_url":"https://api.github.com/users/jwatzman/gists{/gist_id}","starred_url":"https://api.github.com/users/jwatzman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwatzman/subscriptions","organizations_url":"https://api.github.com/users/jwatzman/orgs","repos_url":"https://api.github.com/users/jwatzman/repos","events_url":"https://api.github.com/users/jwatzman/events{/privacy}","received_events_url":"https://api.github.com/users/jwatzman/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-10-06T23:14:49Z","updated_at":"2015-10-19T22:59:40Z","closed_at":null,"body":"While running hh_server --convert on 3.9.1 today I noticed that certain files would exhibit really weird failures on function signatures. I would get an error like this:\r\n\r\n```\r\nFatal error: exception Failure(\"Could not find member $value on line 524\")\r\n```\r\n\r\nBut $value isn't even on line 524, in many cases it's 1-5 lines above that. At first I thought the problem was certain default values, then multiline function signatures. I then noticed that all of these files, somewhere, had multiline strings of a certain format. For example, this works fine\r\n\r\n```hack\r\n<?hh\r\n\r\nclass MyClass {\r\n    public function bar() {\r\n        $query = $this->foo(\r\n            \"SELECT\r\n            BLAH\r\n            END\"\r\n         );\r\n\r\n        return $query;\r\n    }\r\n\r\n    public function foo($query) {\r\n        return $query;\r\n    }\r\n}\r\n```\r\n\r\nBut this\r\n\r\n```hack\r\n<?hh\r\n\r\nclass MyClass {\r\n    public function bar() {\r\n        $query = $this->foo(\"\r\n            SELECT\r\n            BLAH\r\n            END\r\n            \");\r\n\r\n        return $query;\r\n    }\r\n\r\n    public function foo($query) {\r\n        return $query;\r\n    }\r\n}\r\n```\r\n\r\nFails. When I run hh_server --convert I get really weird output. It's trying to apply a patch that is completely invalid.\r\n\r\n```\r\n[~/development/test]> hh_server --convert . .\r\n[2015-10-06 23:08:44] Heap size: 2129024\r\n[2015-10-06 23:08:44] Parsing: 0.194744\r\n[2015-10-06 23:08:44] Updating deps: 0.001410\r\n[2015-10-06 23:08:44] Naming: 0.009873\r\n[2015-10-06 23:08:44] Heap size: 5341504\r\n[2015-10-06 23:08:44] Type-decl: 0.038555\r\n[2015-10-06 23:08:44] Type-check: 0.031525\r\n[2015-10-06 23:08:44] Dependency table load factor: 1633 / 131072 (0.01)\r\n[2015-10-06 23:08:44] Hashtable load factor: 9973 / 262144 (0.04)\r\nNo errors!\r\nPatching /home/dmiller/development/test/MyClass.php:\r\n-        return $query;\r\n+        return @string $query;\r\n******************************************\r\n[2015-10-06 23:08:44] Files to recompute: 1\r\n[2015-10-06 23:08:44] Parsing: 0.005717\r\n[2015-10-06 23:08:44] Updating deps: 0.000039\r\n[2015-10-06 23:08:44] Parsing Hook: 0.000025\r\n[2015-10-06 23:08:44] Naming: 0.000069\r\n[2015-10-06 23:08:44] Determining changes: 0.000323\r\n[2015-10-06 23:08:44] Type-decl: 0.000295\r\n[2015-10-06 23:08:44] Type-check: 0.000619\r\n[2015-10-06 23:08:44] Total: 0.007087\r\n\r\nFailed\r\n******************************************\r\n[2015-10-06 23:08:44] Files to recompute: 1\r\n[2015-10-06 23:08:44] Parsing: 0.004882\r\n[2015-10-06 23:08:44] Updating deps: 0.000036\r\n[2015-10-06 23:08:44] Parsing Hook: 0.000030\r\n[2015-10-06 23:08:44] Naming: 0.000054\r\n[2015-10-06 23:08:44] Determining changes: 0.000364\r\n[2015-10-06 23:08:44] Type-decl: 0.000338\r\n[2015-10-06 23:08:44] Type-check: 0.000310\r\n[2015-10-06 23:08:44] Total: 0.006014\r\n```\r\n\r\nThis seems like a big enough issue on its own, but I'll keep trying to reproduce the exact failure I'm seeing in the meantime."},"comment":{"url":"https://api.github.com/repos/facebook/hhvm/issues/comments/149371106","html_url":"https://github.com/facebook/hhvm/issues/6342#issuecomment-149371106","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/6342","id":149371106,"user":{"login":"dabek","id":1625880,"avatar_url":"https://avatars.githubusercontent.com/u/1625880?v=3","gravatar_id":"","url":"https://api.github.com/users/dabek","html_url":"https://github.com/dabek","followers_url":"https://api.github.com/users/dabek/followers","following_url":"https://api.github.com/users/dabek/following{/other_user}","gists_url":"https://api.github.com/users/dabek/gists{/gist_id}","starred_url":"https://api.github.com/users/dabek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dabek/subscriptions","organizations_url":"https://api.github.com/users/dabek/orgs","repos_url":"https://api.github.com/users/dabek/repos","events_url":"https://api.github.com/users/dabek/events{/privacy}","received_events_url":"https://api.github.com/users/dabek/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T22:59:39Z","updated_at":"2015-10-19T22:59:39Z","body":"This is probably parsing stuff that was changed in https://github.com/facebook/hhvm/commit/32fb806addd3d87f0a7111725b1daae441e0843a by @msullivan\r\n \r\nWe tried to patch it in places where we noticed incorrect line numbers - \r\n@int3 fixed one in https://github.com/facebook/hhvm/commit/34c93e7b01edbe903bde5a4881de8e9d76a36b26, and I fixed one in https://github.com/facebook/hhvm/commit/47f5d71f0fdb76c4bc82fd09610f2e318ef742ea \r\n\r\nIf you are rebased past those diffs, there are probably some that we've missed :/."}}