{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/8011","repository_url":"https://api.github.com/repos/facebook/hhvm","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/8011/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/8011/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/8011/events","html_url":"https://github.com/facebook/hhvm/issues/8011","id":261382613,"number":8011,"title":"array_unique crashes on refcounted strings","user":{"login":"ivyhjk","id":12478859,"avatar_url":"https://avatars1.githubusercontent.com/u/12478859?v=4","gravatar_id":"","url":"https://api.github.com/users/ivyhjk","html_url":"https://github.com/ivyhjk","followers_url":"https://api.github.com/users/ivyhjk/followers","following_url":"https://api.github.com/users/ivyhjk/following{/other_user}","gists_url":"https://api.github.com/users/ivyhjk/gists{/gist_id}","starred_url":"https://api.github.com/users/ivyhjk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivyhjk/subscriptions","organizations_url":"https://api.github.com/users/ivyhjk/orgs","repos_url":"https://api.github.com/users/ivyhjk/repos","events_url":"https://api.github.com/users/ivyhjk/events{/privacy}","received_events_url":"https://api.github.com/users/ivyhjk/received_events","type":"User","site_admin":false},"labels":[{"id":34419,"url":"https://api.github.com/repos/facebook/hhvm/labels/crash","name":"crash","color":"e63737","default":false},{"id":583361458,"url":"https://api.github.com/repos/facebook/hhvm/labels/regression","name":"regression","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":37,"created_at":"2017-09-28T16:30:07Z","updated_at":"2017-12-20T21:58:00Z","closed_at":null,"author_association":"NONE","body":"### HHVM Version\r\n```\r\n$ hhvm --version\r\nHipHop VM 3.22.0 (rel)\r\nCompiler: tags/HHVM-3.22.0-0-g4965441b640cb003a7185e78b18df72118763b59\r\nRepo schema: abc6330f02a0c02cba7114040d5e1bf6b3f37fb9\r\n```\r\n\r\n### Standalone code, or other way to reproduce the problem\r\n```php\r\n<?php\r\n\r\n// Error!\r\nclass Test\r\n{\r\n    public function foo()\r\n    {\r\n        $file = '/tmp/bar';\r\n\r\n        touch($file);\r\n\r\n        $files = [\r\n            realpath($file)\r\n        ];\r\n\r\n        return array_unique($files);\r\n    }\r\n}\r\n\r\nvar_dump((new Test())->foo());\r\n```\r\n\r\n### Expected result\r\n```\r\n$ hhvm test.php \r\narray(1) {\r\n  [0]=>\r\n  string(8) \"/tmp/bar\"\r\n}\r\n```\r\n\r\n### Actual result\r\n```\r\n$ hhvm test.php \r\narray(1) {\r\n  [0]=>\r\n  string(8) \"\u0001\t\u0002\"\r\n}\r\nCore dumped: Segmentation fault\r\n    #0 var_dump(), called at [/tmp/test.php:20]\r\nStack trace in /tmp/stacktrace.32234.log\r\n    #0 var_dump(), called at [/tmp/test.php:20]\r\nSegmentation fault\r\n```\r\n\r\n#### Additional comments\r\n\r\nIf you remove ```realpath``` or ```array_unique```, all works correctly.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/hhvm/issues/comments/353194316","html_url":"https://github.com/facebook/hhvm/issues/8011#issuecomment-353194316","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/8011","id":353194316,"user":{"login":"fredemmott","id":360927,"avatar_url":"https://avatars2.githubusercontent.com/u/360927?v=4","gravatar_id":"","url":"https://api.github.com/users/fredemmott","html_url":"https://github.com/fredemmott","followers_url":"https://api.github.com/users/fredemmott/followers","following_url":"https://api.github.com/users/fredemmott/following{/other_user}","gists_url":"https://api.github.com/users/fredemmott/gists{/gist_id}","starred_url":"https://api.github.com/users/fredemmott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fredemmott/subscriptions","organizations_url":"https://api.github.com/users/fredemmott/orgs","repos_url":"https://api.github.com/users/fredemmott/repos","events_url":"https://api.github.com/users/fredemmott/events{/privacy}","received_events_url":"https://api.github.com/users/fredemmott/received_events","type":"User","site_admin":false},"created_at":"2017-12-20T21:58:00Z","updated_at":"2017-12-20T21:58:00Z","author_association":"CONTRIBUTOR","body":"Okay, I'm confused:\r\n - all the O1 flags without -O1 doesn't crash\r\n - g++ $(flags) -Q --help=optimizers shows no difference between all the flags and just -O1"}}
{"actor":{"display_login":"fredemmott"}}