payload: {"action":"created","issue":{"url":"https://api.github.com/repos/pythonnet/pythonnet/issues/967","repository_url":"https://api.github.com/repos/pythonnet/pythonnet","labels_url":"https://api.github.com/repos/pythonnet/pythonnet/issues/967/labels{/name}","comments_url":"https://api.github.com/repos/pythonnet/pythonnet/issues/967/comments","events_url":"https://api.github.com/repos/pythonnet/pythonnet/issues/967/events","html_url":"https://github.com/pythonnet/pythonnet/issues/967","id":503365556,"node_id":"MDU6SXNzdWU1MDMzNjU1NTY=","number":967,"title":"Crashes on .NET Core 3 and 2 on Linux","user":{"login":"emilmuller","id":2487546,"node_id":"MDQ6VXNlcjI0ODc1NDY=","avatar_url":"https://avatars0.githubusercontent.com/u/2487546?v=4","gravatar_id":"","url":"https://api.github.com/users/emilmuller","html_url":"https://github.com/emilmuller","followers_url":"https://api.github.com/users/emilmuller/followers","following_url":"https://api.github.com/users/emilmuller/following{/other_user}","gists_url":"https://api.github.com/users/emilmuller/gists{/gist_id}","starred_url":"https://api.github.com/users/emilmuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emilmuller/subscriptions","organizations_url":"https://api.github.com/users/emilmuller/orgs","repos_url":"https://api.github.com/users/emilmuller/repos","events_url":"https://api.github.com/users/emilmuller/events{/privacy}","received_events_url":"https://api.github.com/users/emilmuller/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2019-10-07T10:32:27Z","updated_at":"2019-12-15T20:48:21Z","closed_at":"2019-10-10T07:03:48Z","author_association":"NONE","body":"Can't make this work on Linux Mint 19 (Ubuntu 18.04).\r\nCompiled ReleaseMonoPy3 with XPLAT;;PYTHON3;PYTHON37;UCS4;MONO_LINUX;PYTHON_WITH_PYMALLOC.\r\nIt seems to crash on Py.GIL():\r\n\r\n```\r\nusing (Py.GIL())\r\n{\r\n    dynamic np = Py.Import(\"numpy\");\r\n    Console.WriteLine(np.cos(np.pi * 2));\r\n\r\n    dynamic sin = np.sin;\r\n    Console.WriteLine(sin(5));\r\n\r\n    double c = np.cos(5) + sin(5);\r\n    Console.WriteLine(c);\r\n\r\n    dynamic a = np.array(new List<float> { 1, 2, 3 });\r\n    Console.WriteLine(a.dtype);\r\n\r\n    dynamic b = np.array(new List<float> { 6, 5, 4 }, dtype: np.int32);\r\n    Console.WriteLine(b.dtype);\r\n\r\n    Console.WriteLine(a * b);\r\n    Console.ReadKey();\r\n}\r\n```\r\n\r\nUpon further investigation, it seems to crash in InitializePlatformData(), as\r\n\r\n`IntPtr platformModule = PyImport_ImportModule(\"platform\"); // Becomes NULL pointer`\r\n\r\nRunning this line immediately after setting `platformModule = ... `\r\n\r\n`Console.WriteLine(new PythonException().Message);`\r\n\r\nyields:\r\n\r\n**ModuleNotFoundError : No module named '_posixsubprocess'**\r\n\r\nI also tried making sure the python home and path variables are correctly set:\r\n\r\n```\r\nPythonEngine.PythonHome = @\"/usr/local/bin/python3.7\";\r\nPythonEngine.PythonPath = @\"/usr/local/lib/python3.7\";\r\n```\r\n\r\nI have no problem importing _posixsubprocess module when running the python3.7 binary from the terminal."},"comment":{"url":"https://api.github.com/repos/pythonnet/pythonnet/issues/comments/565845393","html_url":"https://github.com/pythonnet/pythonnet/issues/967#issuecomment-565845393","issue_url":"https://api.github.com/repos/pythonnet/pythonnet/issues/967","id":565845393,"node_id":"MDEyOklzc3VlQ29tbWVudDU2NTg0NTM5Mw==","user":{"login":"filmor","id":30848,"node_id":"MDQ6VXNlcjMwODQ4","avatar_url":"https://avatars3.githubusercontent.com/u/30848?v=4","gravatar_id":"","url":"https://api.github.com/users/filmor","html_url":"https://github.com/filmor","followers_url":"https://api.github.com/users/filmor/followers","following_url":"https://api.github.com/users/filmor/following{/other_user}","gists_url":"https://api.github.com/users/filmor/gists{/gist_id}","starred_url":"https://api.github.com/users/filmor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/filmor/subscriptions","organizations_url":"https://api.github.com/users/filmor/orgs","repos_url":"https://api.github.com/users/filmor/repos","events_url":"https://api.github.com/users/filmor/events{/privacy}","received_events_url":"https://api.github.com/users/filmor/received_events","type":"User","site_admin":false},"created_at":"2019-12-15T20:48:21Z","updated_at":"2019-12-15T20:48:21Z","author_association":"MEMBER","body":"@Jeff17Robbins Well, Python.NET didn't decide to default to `RTLD_LOCAL` on .NET Core in `DllImport` (which I think is an unfortunate choice).\r\n\r\nNevertheless, you are completely right that this whole `InitializePlatformData` dance can be avoided by using `RuntimeInformation` (I think there is even a comment in our code that we could do that), but for this we need to \"officially\" update to .NET >4.7.1. There is a ticket for this (#897) and we'll decide this Tuesday, but as far as I can see everyone is in favour.\r\n\r\nWe wouldn't even need to assign our own values here anymore, we can just use the `RuntimeInformation` data directly."}}
other: {"actor":{"display_login":"filmor"}}