{"action":"created","issue":{"url":"https://api.github.com/repos/rubinius/rubinius/issues/3268","labels_url":"https://api.github.com/repos/rubinius/rubinius/issues/3268/labels{/name}","comments_url":"https://api.github.com/repos/rubinius/rubinius/issues/3268/comments","events_url":"https://api.github.com/repos/rubinius/rubinius/issues/3268/events","html_url":"https://github.com/rubinius/rubinius/issues/3268","id":53333148,"number":3268,"title":"Incompatible implementation of Process::Status","user":{"login":"sodabrew","id":39406,"avatar_url":"https://avatars.githubusercontent.com/u/39406?v=3","gravatar_id":"","url":"https://api.github.com/users/sodabrew","html_url":"https://github.com/sodabrew","followers_url":"https://api.github.com/users/sodabrew/followers","following_url":"https://api.github.com/users/sodabrew/following{/other_user}","gists_url":"https://api.github.com/users/sodabrew/gists{/gist_id}","starred_url":"https://api.github.com/users/sodabrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sodabrew/subscriptions","organizations_url":"https://api.github.com/users/sodabrew/orgs","repos_url":"https://api.github.com/users/sodabrew/repos","events_url":"https://api.github.com/users/sodabrew/events{/privacy}","received_events_url":"https://api.github.com/users/sodabrew/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-01-04T11:01:58Z","updated_at":"2015-01-07T22:08:10Z","closed_at":null,"body":"This is a spin-off from eventmachine/eventmachine#551 wherein I am trying to get unit tests running clean for all Rubies that Eventmachine supports, including Rubinius.\r\n\r\nRuby MRI has a C implementation of Process::Status and jams instance values into the class.\r\nhttp://rxr.whitequark.org/mri/ident?i=rb_last_status_set\r\n``` C\r\n  rb_last_status_set(int status, rb_pid_t pid)\r\n  {\r\n      rb_thread_t *th = GET_THREAD();\r\n      th->last_status = rb_obj_alloc(rb_cProcessStatus);\r\n      rb_iv_set(th->last_status, \"status\", INT2FIX(status));\r\n      rb_iv_set(th->last_status, \"pid\", PIDT2NUM(pid));\r\n  }\r\n```\r\n\r\nEventmachine uses similar code to construct the Process::Status result for EM.system and EM.popen, which does not work with the Rubinius Process::Status https://github.com/rubinius/rubinius/blob/master/kernel/common/process.rb#L523-584\r\n\r\nI hacked up my Eventmachine locally and got it working with this adjustment, but it fails on MRI because the (nonexistent)initialize for Process::Status wants 0 arguments.\r\n\r\n``` C\r\n static VALUE t_get_subprocess_status (VALUE self, VALUE signature)\r\n {\r\n        VALUE proc_status = Qnil;\r\n\r\n        int status;\r\n        pid_t pid;\r\n\r\n        if (evma_get_subprocess_status (NUM2ULONG (signature), &status)) {\r\n                if (evma_get_subprocess_pid (NUM2ULONG (signature), &pid)) {\r\n                        proc_status = rb_obj_alloc(rb_cProcStatus);\r\n+                       VALUE argv[2];\r\n+                       argv[0] = INT2FIX(pid);\r\n+                       argv[1] = INT2FIX(status);\r\n+                       rb_obj_call_init(proc_status, 2, argv);\r\n                        rb_iv_set(proc_status, \"status\", INT2FIX(status));\r\n                        rb_iv_set(proc_status, \"pid\", INT2FIX(pid));\r\n                }\r\n        }\r\n\r\n        return proc_status;\r\n }\r\n```\r\n\r\nOpen question: should Rubinius change its definition of Process::Status to match the way MRI does it, or should Eventmachine test its Ruby engine and construct Process::Status accordingly?"},"comment":{"url":"https://api.github.com/repos/rubinius/rubinius/issues/comments/69101272","html_url":"https://github.com/rubinius/rubinius/issues/3268#issuecomment-69101272","issue_url":"https://api.github.com/repos/rubinius/rubinius/issues/3268","id":69101272,"user":{"login":"brixen","id":85,"avatar_url":"https://avatars.githubusercontent.com/u/85?v=3","gravatar_id":"","url":"https://api.github.com/users/brixen","html_url":"https://github.com/brixen","followers_url":"https://api.github.com/users/brixen/followers","following_url":"https://api.github.com/users/brixen/following{/other_user}","gists_url":"https://api.github.com/users/brixen/gists{/gist_id}","starred_url":"https://api.github.com/users/brixen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brixen/subscriptions","organizations_url":"https://api.github.com/users/brixen/orgs","repos_url":"https://api.github.com/users/brixen/repos","events_url":"https://api.github.com/users/brixen/events{/privacy}","received_events_url":"https://api.github.com/users/brixen/received_events","type":"User","site_admin":false},"created_at":"2015-01-07T22:08:10Z","updated_at":"2015-01-07T22:08:10Z","body":"Can we confirm that this is fixed on master?"}}