{"action":"closed","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/5158","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/5158/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/5158/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/5158/events","html_url":"https://github.com/facebook/hhvm/issues/5158","id":67817037,"number":5158,"title":"Array to string conversion causing seg fault","user":{"login":"acasanova","id":2922800,"avatar_url":"https://avatars.githubusercontent.com/u/2922800?v=3","gravatar_id":"","url":"https://api.github.com/users/acasanova","html_url":"https://github.com/acasanova","followers_url":"https://api.github.com/users/acasanova/followers","following_url":"https://api.github.com/users/acasanova/following{/other_user}","gists_url":"https://api.github.com/users/acasanova/gists{/gist_id}","starred_url":"https://api.github.com/users/acasanova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acasanova/subscriptions","organizations_url":"https://api.github.com/users/acasanova/orgs","repos_url":"https://api.github.com/users/acasanova/repos","events_url":"https://api.github.com/users/acasanova/events{/privacy}","received_events_url":"https://api.github.com/users/acasanova/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/hhvm/labels/crash","name":"crash","color":"e63737"}],"state":"closed","locked":false,"assignee":{"login":"oyamauchi","id":107014,"avatar_url":"https://avatars.githubusercontent.com/u/107014?v=3","gravatar_id":"","url":"https://api.github.com/users/oyamauchi","html_url":"https://github.com/oyamauchi","followers_url":"https://api.github.com/users/oyamauchi/followers","following_url":"https://api.github.com/users/oyamauchi/following{/other_user}","gists_url":"https://api.github.com/users/oyamauchi/gists{/gist_id}","starred_url":"https://api.github.com/users/oyamauchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oyamauchi/subscriptions","organizations_url":"https://api.github.com/users/oyamauchi/orgs","repos_url":"https://api.github.com/users/oyamauchi/repos","events_url":"https://api.github.com/users/oyamauchi/events{/privacy}","received_events_url":"https://api.github.com/users/oyamauchi/received_events","type":"User","site_admin":false},"milestone":null,"comments":9,"created_at":"2015-04-11T18:35:21Z","updated_at":"2015-04-15T16:40:51Z","closed_at":"2015-04-15T16:40:51Z","body":"I'm receiving `Array to string conversion` error causing a segmentation fault. The code in question is from this project. https://github.com/danielmewes/php-rql/blob/1.15.0/src/rdb/function.php#L79.\r\n\r\nHere is the piece of code that interacts with the php-rql library  \r\n````\r\n\tpublic static function getCancelledUserCount($conn){\r\n\t\t//Get All Cancelled Sites\r\n\t\t$cancelledUserCount = r\\db('accounts_archive')\t\t\t\r\n\t\t\t->table('cancelled_accounts')\r\n\t\t\t->filter(function($row){\r\n\t\t\t\t$r = $row->pluck(array('site'=>'has_purchased'))->coerceTo('string')->match(\"1\");\r\n\t\t\t\treturn $r;\t\t\t\r\n\t\t\t})\r\n\t\t\t->count()\r\n\t\t\t->run($conn)->toNative();\r\n\t\t\r\n\t\treturn $cancelledUserCount;\r\n\t}\r\n````\r\n\r\nBelow is the stacktrace \r\n````\r\nHost: cf730457dee6\r\nProcessID: 6\r\nThreadID: 7f47fc9ff700\r\nThreadPID: 71\r\nName: unknown program\r\nType: Aborted\r\nRuntime: hhvm\r\nVersion: heads/master-0-g6bec157aad74985e64d3d9fe928ad5cc490f5876\r\nDebuggerCount: 0\r\n\r\nServer: api.server.com\r\nThreadType: Web Request\r\nServer_SERVER_NAME: api.server.com\r\nURL: /api/reports/allregistrations\r\n\r\n# 0  bt_handler at /tmp/tmp.fuMVCGlLXN/hphp/runtime/base/crash-reporter.cpp:82\r\n# 1  gsignal at /lib/x86_64-linux-gnu/libc.so.6:0\r\n# 2  abort at /lib/x86_64-linux-gnu/libc.so.6:0\r\n# 3  uselocale at /lib/x86_64-linux-gnu/libc.so.6:0\r\n# 4  __assert_fail at /lib/x86_64-linux-gnu/libc.so.6:0\r\n# 5  HPHP::init_closure(HPHP::ActRec*, HPHP::TypedValue*) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/ext/ext_closure.h:78\r\n# 6  prepareFuncEntry at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/bytecode.cpp:1913\r\n# 7  enterVMAtFunc at /tmp/tmp.fuMVCGlLXN/hphp/util/trace.h:244\r\n# 8  enterVM at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/bytecode.cpp:2061\r\n# 9  HPHP::ExecutionContext::invokeFunc(HPHP::TypedValue*, HPHP::Func const*, HPHP::Variant const&, HPHP::ObjectData*, HPHP::Class*, HPHP::VarEnv*, HPHP::StringData*, HPHP::ExecutionContext::InvokeFlags) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/vm-regs.h:73\r\n# 10 HPHP::ObjectData::o_invoke(HPHP::String const&, HPHP::Variant const&, bool) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/base/execution-context-inl.h:197\r\n# 11 HPHP::f_hphp_invoke_method(HPHP::Variant const&, HPHP::String const&, HPHP::String const&, HPHP::Variant const&) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/ext/reflection/ext_reflection.cpp:364\r\n# 12 enterTCHelper at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/jit/back-end-x64.cpp:111\r\n# 13 HPHP::jit::MCGenerator::enterTC(unsigned char*, HPHP::ActRec*) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/jit/mc-generator.cpp:1036\r\n# 14 enterVMAtCurPC at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/jit/mc-generator.h:212\r\n# 15 enterVM at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/bytecode.cpp:2066\r\n# 16 HPHP::ExecutionContext::invokeFunc(HPHP::TypedValue*, HPHP::Func const*, HPHP::Variant const&, HPHP::ObjectData*, HPHP::Class*, HPHP::VarEnv*, HPHP::StringData*, HPHP::ExecutionContext::InvokeFlags) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/vm-regs.h:73\r\n# 17 HPHP::vm_call_user_func(HPHP::Variant const&, HPHP::Variant const&, bool) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/base/builtin-functions.cpp:356\r\n# 18 HPHP::f_call_user_func_array(HPHP::Variant const&, HPHP::Array const&) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/ext/std/ext_std_function.cpp:142\r\n# 19 HPHP::Native::callFuncInt64Impl(HPHP::TypedValue* (*)(HPHP::ActRec*), long*, int, double*, int) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/native-func-caller.h:810\r\n# 20 void HPHP::Native::callFunc<false, false>(HPHP::Func const*, void*, HPHP::TypedValue*, HPHP::TypedValue&) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/native.cpp:178\r\n# 21 HPHP::TypedValue* HPHP::Native::functionWrapper<false, false>(HPHP::ActRec*) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/native.cpp:377\r\n# 22 enterTCHelper at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/jit/back-end-x64.cpp:111\r\n# 23 HPHP::jit::MCGenerator::enterTC(unsigned char*, HPHP::ActRec*) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/jit/mc-generator.cpp:1036\r\n# 24 HPHP::jit::MCGenerator::enterTCAfterPrologue(unsigned char*) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/jit/mc-generator.h:222\r\n# 25 enterVMAtFunc at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/bytecode.cpp:2002\r\n# 26 enterVM at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/bytecode.cpp:2061\r\n# 27 HPHP::ExecutionContext::invokeFunc(HPHP::TypedValue*, HPHP::Func const*, HPHP::Variant const&, HPHP::ObjectData*, HPHP::Class*, HPHP::VarEnv*, HPHP::StringData*, HPHP::ExecutionContext::InvokeFlags) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/vm-regs.h:73\r\n# 28 HPHP::vm_call_user_func(HPHP::Variant const&, HPHP::Variant const&, bool) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/base/builtin-functions.cpp:356\r\n# 29 HPHP::f_call_user_func_array(HPHP::Variant const&, HPHP::Array const&) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/ext/std/ext_std_function.cpp:142\r\n# 30 HPHP::Native::callFuncInt64Impl(HPHP::TypedValue* (*)(HPHP::ActRec*), long*, int, double*, int) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/native-func-caller.h:810\r\n# 31 void HPHP::Native::callFunc<false, false>(HPHP::Func const*, void*, HPHP::TypedValue*, HPHP::TypedValue&) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/native.cpp:178\r\n# 32 HPHP::TypedValue* HPHP::Native::functionWrapper<false, false>(HPHP::ActRec*) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/native.cpp:377\r\n# 33 enterTCHelper at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/jit/back-end-x64.cpp:111\r\n# 34 HPHP::jit::MCGenerator::enterTC(unsigned char*, HPHP::ActRec*) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/jit/mc-generator.cpp:1036\r\n# 35 HPHP::jit::MCGenerator::enterTCAfterPrologue(unsigned char*) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/jit/mc-generator.h:222\r\n# 36 enterVMAtFunc at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/bytecode.cpp:2002\r\n# 37 enterVM at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/bytecode.cpp:2061\r\n# 38 HPHP::ExecutionContext::invokeFunc(HPHP::TypedValue*, HPHP::Func const*, HPHP::Variant const&, HPHP::ObjectData*, HPHP::Class*, HPHP::VarEnv*, HPHP::StringData*, HPHP::ExecutionContext::InvokeFlags) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/vm-regs.h:73\r\n# 39 HPHP::ExecutionContext::invokeUnit(HPHP::TypedValue*, HPHP::Unit const*) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/vm/bytecode.cpp:2422\r\n# 40 invoke_file_impl at /tmp/tmp.fuMVCGlLXN/hphp/runtime/base/builtin-functions.cpp:705\r\n# 41 invoke_file at /tmp/tmp.fuMVCGlLXN/hphp/runtime/base/builtin-functions.cpp:716\r\n# 42 HPHP::include_impl_invoke(HPHP::String const&, bool, char const*) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/base/builtin-functions.cpp:727\r\n# 43 HPHP::hphp_invoke(HPHP::ExecutionContext*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, HPHP::Array const&, HPHP::VRefParamValue const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool, bool, bool) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/base/program-functions.cpp:1942\r\n# 44 HPHP::HttpRequestHandler::executePHPRequest(HPHP::Transport*, HPHP::RequestURI&, HPHP::SourceRootInfo&, bool) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/server/http-request-handler.cpp:475\r\n# 45 HPHP::HttpRequestHandler::handleRequest(HPHP::Transport*) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/server/http-request-handler.cpp:386\r\n# 46 HPHP::ServerWorker<std::shared_ptr<HPHP::FastCGIJob>, HPHP::FastCGITransportTraits>::doJobImpl(std::shared_ptr<HPHP::FastCGIJob>, bool) at /usr/include/c++/4.9/bits/basic_string.h:301\r\n# 47 HPHP::ServerWorker<std::shared_ptr<HPHP::FastCGIJob>, HPHP::FastCGITransportTraits>::doJob(std::shared_ptr<HPHP::FastCGIJob>) at /usr/include/c++/4.9/bits/shared_ptr_base.h:665\r\n# 48 HPHP::JobQueueWorker<std::shared_ptr<HPHP::FastCGIJob>, HPHP::Server*, true, false, HPHP::JobQueueDropVMStack>::start() at /usr/include/c++/4.9/bits/shared_ptr_base.h:665\r\n# 49 HPHP::AsyncFunc<HPHP::ServerWorker<std::shared_ptr<HPHP::FastCGIJob>, HPHP::FastCGITransportTraits> >::run_(void*) at /tmp/tmp.fuMVCGlLXN/hphp/util/async-func.h:214\r\n# 50 HPHP::AsyncFuncImpl::threadFuncImpl() at /tmp/tmp.fuMVCGlLXN/hphp/util/synchronizable.h:41\r\n# 51 HPHP::AsyncFuncImpl::ThreadFunc(void*) at /tmp/tmp.fuMVCGlLXN/hphp/util/async-func.cpp:53\r\n# 52 HPHP::start_routine_wrapper(void*) at /tmp/tmp.fuMVCGlLXN/hphp/runtime/base/thread-hooks.cpp:93\r\n# 53 start_thread at /lib/x86_64-linux-gnu/libpthread.so.0:0\r\n# 54 clone at /lib/x86_64-linux-gnu/libc.so.6:0\r\n\r\nPHP Stacktrace:\r\n\r\n#0  ReflectionFunction->invokeArgs(Array) called at [/var/www/server/application/libraries/php-rql/rdb/function.php:79]\r\n#1  r\\nativeToFunction() called at [/var/www/server/application/libraries/php-rql/rdb/function.php:103]\r\n#2  r\\nativeToDatumOrFunction() called at [/var/www/server/application/libraries/php-rql/rdb/queries/selecting.php:91]\r\n#3  r\\Filter->__construct(TABLE(DB('accounts_archive'), 'cancelled_accounts'), , ) called at [/var/www/server/application/libraries/php-rql/rdb/misc.php:170]\r\n#4  r\\ValuedQuery->filter() called at [/var/www/server/application/models/services/reporting.php:267]\r\n#5  Services\\Reporting::getArchivedUsers() called at [/var/www/server/application/models/services/reporting.php:124]\r\n#6  Services\\Reporting::getAllRegisteredAccounts() called at [/var/www/server/bundles/api/controllers/reports.php:42]\r\n#7  Closure$Api_Reports_Controller::post_allregistrations() called at [/var/www/server/laravel/helpers.php:490]\r\n#8  value() called at [/var/www/server/laravel/cache/drivers/driver.php:77]\r\n#9  Laravel\\Cache\\Drivers\\Driver->remember(getAllResellerAccounts, , 120)\r\n#10 call_user_func_array(Array, Array) called at [/var/www/server/laravel/cache.php:112]\r\n#11 Laravel\\Cache::__callStatic(remember, Array) called at [/var/www/server/bundles/api/controllers/reports.php:43]\r\n#12 Api_Reports_Controller->post_allregistrations()\r\n#13 call_user_func_array(Array, Array) called at [/var/www/server/laravel/routing/controller.php:322]\r\n#14 Laravel\\Routing\\Controller->response(allregistrations, Array) called at [/var/www/server/laravel/routing/controller.php:282]\r\n#15 Laravel\\Routing\\Controller->execute(allregistrations, Array) called at [/var/www/server/laravel/routing/controller.php:164]\r\n#16 Laravel\\Routing\\Controller::call(reports@allregistrations, Array) called at [/var/www/server/laravel/routing/route.php:153]\r\n#17 Laravel\\Routing\\Route->response() called at [/var/www/server/laravel/routing/route.php:124]\r\n#18 Laravel\\Routing\\Route->call() called at [/var/www/server/laravel/laravel.php:165]\r\n#19 include(/var/www/server/laravel/laravel.php) called at [/var/www/server/public/index.php:34]\r\n````\r\n\r\nI'm using a nightly build on ubuntu:14.10\r\n`Version: 2015.04.06~utopic`\r\n\r\n\r\nWhen i try to dump $args prior to the line of the error. I get the following\r\n````\r\narray(1) {\r\n  [0]=>\r\n  object(r\\RVar)#115 (5) {\r\n    [\"id\":\"r\\RVar\":private]=>\r\n    int(1)\r\n    [\"positionalArgs\":\"r\\Query\":private]=>\r\n    array(1) {\r\n      [0]=&gt;\r\n      object(r\\NumberDatum)#116 (4) {\r\n        [\"value\":\"r\\Datum\":private]=&gt;\r\n        int(1)\r\n        [\"positionalArgs\":\"r\\Query\":private]=>\r\n        array(0) {\r\n        }\r\n        [\"optionalArgs\":\"r\\Query\":private]=>\r\n        array(0) {\r\n        }\r\n        [\"unwrappedImplicitVar\":\"r\\Query\":private]=>\r\n        bool(false)\r\n      }\r\n    }\r\n    [\"optionalArgs\":\"r\\Query\":private]=>\r\n    array(0) {\r\n    }\r\n    [\"unwrappedImplicitVar\":\"r\\Query\":private]=>\r\n    bool(false)\r\n    [\"name\"]=>\r\n    string(3) \"row\"\r\n  }\r\n}\r\n````\r\n"}}