{"action":"opened","issue":{"url":"https://api.github.com/repos/rstudio/reticulate/issues/342","repository_url":"https://api.github.com/repos/rstudio/reticulate","labels_url":"https://api.github.com/repos/rstudio/reticulate/issues/342/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/reticulate/issues/342/comments","events_url":"https://api.github.com/repos/rstudio/reticulate/issues/342/events","html_url":"https://github.com/rstudio/reticulate/issues/342","id":352567663,"node_id":"MDU6SXNzdWUzNTI1Njc2NjM=","number":342,"title":"Crash when executing function which filters numpy array","user":{"login":"Sgrego","id":40870991,"node_id":"MDQ6VXNlcjQwODcwOTkx","avatar_url":"https://avatars1.githubusercontent.com/u/40870991?v=4","gravatar_id":"","url":"https://api.github.com/users/Sgrego","html_url":"https://github.com/Sgrego","followers_url":"https://api.github.com/users/Sgrego/followers","following_url":"https://api.github.com/users/Sgrego/following{/other_user}","gists_url":"https://api.github.com/users/Sgrego/gists{/gist_id}","starred_url":"https://api.github.com/users/Sgrego/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sgrego/subscriptions","organizations_url":"https://api.github.com/users/Sgrego/orgs","repos_url":"https://api.github.com/users/Sgrego/repos","events_url":"https://api.github.com/users/Sgrego/events{/privacy}","received_events_url":"https://api.github.com/users/Sgrego/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-21T14:28:05Z","updated_at":"2018-08-21T14:28:05Z","closed_at":null,"author_association":"NONE","body":"Using\r\n```R\r\nlibrary(reticulate)\r\nsource_python(pythonfile.py)\r\n```\r\nto source `pythonfile.py` wit the content\r\n\r\n```Python\r\nimport numpy as np\r\n\r\ndef testfun(idx):\r\n    idx = int(idx)\r\n    # Some MT numbers and corresponding TALYS file names #\r\n    mts = np.array([1, 2, 3])\r\n    mt2name = np.array(['a', 'b', 'c'])\r\n    if idx in mts:\r\n        ret = mt2name[idx == mts][0]\r\n        return ret\r\n    return 'undefined'\r\n```\r\nand then running from R\r\n```R\r\ntestfun(1L)\r\n```\r\nleads to a crash of R with the error message\r\n\r\n> *** caught segfault ***\r\naddress 0x8, cause 'memory not mapped'\r\n\r\nAdditional information:\r\nR version 3.4.4 (2018-03-15) -- \"Someone to Lean On\"\r\nPython 2.7.15 |Anaconda, Inc.| (default, May  1 2018, 23:32:55) \r\n\r\nUsing the function `testfun(1)` directly from the python shell works without problems.\r\n"}}
{"actor":{"display_login":"Sgrego"}}