Title: PLS crashes when analyzing · Issue #503 · microsoft/python-language-server · GitHub
Open Graph Title: PLS crashes when analyzing · Issue #503 · microsoft/python-language-server
X Title: PLS crashes when analyzing · Issue #503 · microsoft/python-language-server
Description: I'm seeing a consistent crash in the analyzer with the following simple python code: import email def foo(): message = email.message_from_string("") message.walk() I'm running this on MacOS in VSCode with a Python 3.6 virtual env. I'm us...
Open Graph Description: I'm seeing a consistent crash in the analyzer with the following simple python code: import email def foo(): message = email.message_from_string("") message.walk() I'm running this on MacOS in VSCo...
X Description: I'm seeing a consistent crash in the analyzer with the following simple python code: import email def foo(): message = email.message_from_string("") message.walk() I'm running thi...
Opengraph URL: https://github.com/microsoft/python-language-server/issues/503
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PLS crashes when analyzing","articleBody":"I'm seeing a consistent crash in the analyzer with the following simple python code:\r\n\r\n```\r\nimport email\r\ndef foo():\r\n message = email.message_from_string(\"\")\r\n message.walk()\r\n```\r\n\r\nI'm running this on MacOS in VSCode with a Python 3.6 virtual env. I'm using the latest version of the vscode python extension (2018.12.1) which contains version 0.1.72 of the PLS.\r\n\r\nThe crash occurs in the method `PythonAnalyzer.GetTypeFromObject` (which is called by `PythonAnalyzer.GetAnalysisValueFromObjects`). The problem is that the `walk` member is of type `ILazyMember`, so when GetTypeFromObject is called, it is not able to determine its type, and it calls `Debug.Fail` which crashes the server. The crash occurs repeatedly as long as the file is open, and VSCode kills the service after five crashes.\r\n\r\nI think the correct fix is to add the following lines to `PythonAnalyzer.GetAnalysisValueFromObjects`:\r\n```\r\n if (attr is ILazyMember lm) {\r\n var member = lm.Get();\r\n return GetAnalysisValueFromObjects(member);\r\n }\r\n```\r\nThis resolves the lazy member and recursively calls `GetAnalysisValueFromObjects` to determine its type. I've confirmed that with this fix, the crash no longer occurs, but I'm not familiar enough with the analysis engine and its internal objects to say for sure that this is the correct fix.","author":{"url":"https://github.com/erictraut","@type":"Person","name":"erictraut"},"datePublished":"2018-12-25T19:50:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/503/python-language-server/issues/503"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:064c362c-aec0-94dc-ad43-11db7ad134a0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D30A:8A2B5:5AFBC4F:8022A03:6A5010B9 |
| html-safe-nonce | a447be99913e0ef4eb1c2dc2d6543469af72821970b5d3877f507b041bf2f577 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMzBBOjhBMkI1OjVBRkJDNEY6ODAyMkEwMzo2QTUwMTBCOSIsInZpc2l0b3JfaWQiOiI1NDI3Nzg5MDk0MTc5NTczOTQ1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 259e25f7dd689f5e145bcba16661a1280e3aa43a34301697cb223379fb7c7068 |
| hovercard-subject-tag | issue:394046122 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/python-language-server/503/issue_layout |
| twitter:image | https://opengraph.githubassets.com/07bab739c693eddecb89321e55f4764fff8afb5ef043c37fc5a6b8839880df76/microsoft/python-language-server/issues/503 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/07bab739c693eddecb89321e55f4764fff8afb5ef043c37fc5a6b8839880df76/microsoft/python-language-server/issues/503 |
| og:image:alt | I'm seeing a consistent crash in the analyzer with the following simple python code: import email def foo(): message = email.message_from_string("") message.walk() I'm running this on MacOS in VSCo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | erictraut |
| hostname | github.com |
| expected-hostname | github.com |
| None | fe4f38b24922a1ce81c1708c3793b47c185599b9144ab94f6ca846b00698058d |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/python-language-server git https://github.com/microsoft/python-language-server.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 145901977 |
| octolytics-dimension-repository_nwo | microsoft/python-language-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145901977 |
| octolytics-dimension-repository_network_root_nwo | microsoft/python-language-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 42b6390c91978a16f9196c38c7a00e9bf21f37e7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width