{"action":"created","issue":{"url":"https://api.github.com/repos/frida/frida-python/issues/16","labels_url":"https://api.github.com/repos/frida/frida-python/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/frida/frida-python/issues/16/comments","events_url":"https://api.github.com/repos/frida/frida-python/issues/16/events","html_url":"https://github.com/frida/frida-python/issues/16","id":52624120,"number":16,"title":"Process closes as soon Stalker is attached","user":{"login":"chaudhryfaisal","id":9321772,"avatar_url":"https://avatars.githubusercontent.com/u/9321772?v=3","gravatar_id":"","url":"https://api.github.com/users/chaudhryfaisal","html_url":"https://github.com/chaudhryfaisal","followers_url":"https://api.github.com/users/chaudhryfaisal/followers","following_url":"https://api.github.com/users/chaudhryfaisal/following{/other_user}","gists_url":"https://api.github.com/users/chaudhryfaisal/gists{/gist_id}","starred_url":"https://api.github.com/users/chaudhryfaisal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chaudhryfaisal/subscriptions","organizations_url":"https://api.github.com/users/chaudhryfaisal/orgs","repos_url":"https://api.github.com/users/chaudhryfaisal/repos","events_url":"https://api.github.com/users/chaudhryfaisal/events{/privacy}","received_events_url":"https://api.github.com/users/chaudhryfaisal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-12-22T06:41:13Z","updated_at":"2015-01-06T13:01:09Z","closed_at":null,"body":"Running on Windows 7 x64, Python 3.4.2\r\nI  did a build from latest code from git following the instructions on the site using Visual Studio 2013 Express Edition \r\n\r\nI tried few examples from http://www.frida.re/docs/functions/ and I only had success using \"Calling Functions\" script. \r\n\r\nmy program \r\n```cpp\r\n// ConsoleApplication1.cpp : Defines the entry point for the console application.\r\n//\r\n\r\n#include \"stdafx.h\"\r\n#include <windows.h>\r\n\r\nvoid\r\nf(int n)\r\n{\r\n\tprintf(\"Number: %d\\n\", n);\r\n}\r\n\r\nint _tmain(int argc, _TCHAR* argv[])\r\n{\r\n\r\n\tint i = 0;\r\n\r\n\tprintf(\"f() is at %p\\n\", f);\r\n\r\n\twhile (1)\r\n\t{\r\n\t\tf(i++);\r\n\t\tSleep(1000);\r\n\t}\r\n}\r\n\r\n \r\n```\r\nwhen I run the following script\r\n```python\r\nimport frida\r\n\r\nprocess = frida.attach(\"ConsoleApplication1.exe\")\r\nprint([x.name for x in process.enumerate_modules()])\r\nscript = process.session.create_script(\"\"\"\r\nStalker.follow(Process.getCurrentThreadId(), {\r\n  events: {\r\n    call: true, // CALL instructions: yes please\r\n    ret: false, // RET instructions: no thanks\r\n    exec: false // all instructions: no thanks\r\n  },\r\n  onReceive: function onReceive(events) {\r\n    // Called with `events` containing a binary blob which is one or more\r\n    // GumEvent structs.  See `gumevent.h` for the format. This is obviously a\r\n    // terrible API that is subject to change once a better trade-off between\r\n    // ease-of-use and performance has been found.\r\n  },\r\n  onCallSummary: function onCallSummary(summary) {\r\n    // Called with `summary` being a key-value mapping of call target to number\r\n    // of calls, in the current time window. You would typically implement this\r\n    // instead of `onReceive` for efficiency.\r\n  }\r\n});\r\n\"\"\")\r\nscript.load()\r\n```\r\nI get \r\n```console\r\n['ConsoleApplication1.exe', 'ntdll.dll', 'kernel32.dll', 'KERNELBASE.dll', 'MSVCR120.dll', 'frida-agent-32.dll', 'DNSAPI.dll', 'msvcrt.dll', 'WS2_32.dll', 'RPCRT4.dll', 'SspiCli.dll', 'CRYPTBASE.dll', 'sechost.dll', 'NSI.dll', 'ole32.dll', 'GDI32.dll', 'USER32.dll', 'ADVAPI32.dll', 'LPK.dll', 'USP10.dll', 'WINMM.dll', 'SHELL32.dll', 'SHLWAPI.dll', 'PSAPI.DLL', 'IMM32.DLL', 'MSCTF.dll', 'ntmarta.dll', 'WLDAP32.dll']\r\nTraceback (most recent call last):\r\n  File \"D:/_ETC/Frida/frida-python-master/src/example.py\", line 26, in <module>\r\n    script.load()\r\nSystemError: The connection is closed````\r\n\r\nand my application terminates"},"comment":{"url":"https://api.github.com/repos/frida/frida-python/issues/comments/68862144","html_url":"https://github.com/frida/frida-python/issues/16#issuecomment-68862144","issue_url":"https://api.github.com/repos/frida/frida-python/issues/16","id":68862144,"user":{"login":"oleavr","id":735197,"avatar_url":"https://avatars.githubusercontent.com/u/735197?v=3","gravatar_id":"","url":"https://api.github.com/users/oleavr","html_url":"https://github.com/oleavr","followers_url":"https://api.github.com/users/oleavr/followers","following_url":"https://api.github.com/users/oleavr/following{/other_user}","gists_url":"https://api.github.com/users/oleavr/gists{/gist_id}","starred_url":"https://api.github.com/users/oleavr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleavr/subscriptions","organizations_url":"https://api.github.com/users/oleavr/orgs","repos_url":"https://api.github.com/users/oleavr/repos","events_url":"https://api.github.com/users/oleavr/events{/privacy}","received_events_url":"https://api.github.com/users/oleavr/received_events","type":"User","site_admin":false},"created_at":"2015-01-06T13:01:09Z","updated_at":"2015-01-06T13:01:09Z","body":"This looks like a regression introduced by a recent Frida update. Does the same thing happen if you remove the `onReceive` callback?"}}