Title: mypy 0.990 crashes with segmentation fault on `hydra_zen` due to recursive types · Issue #14031 · python/mypy · GitHub
Open Graph Title: mypy 0.990 crashes with segmentation fault on `hydra_zen` due to recursive types · Issue #14031 · python/mypy
X Title: mypy 0.990 crashes with segmentation fault on `hydra_zen` due to recursive types · Issue #14031 · python/mypy
Description: Crash Report Upgrading from mypy 0.982 to 0.990 leads to a segmentation fault when I run on a file that merely imports hydra_zen: import hydra_zen This appears to be related to hydra-zen's use of recursive types and mypy 0.990 enabling t...
Open Graph Description: Crash Report Upgrading from mypy 0.982 to 0.990 leads to a segmentation fault when I run on a file that merely imports hydra_zen: import hydra_zen This appears to be related to hydra-zen's use of r...
X Description: Crash Report Upgrading from mypy 0.982 to 0.990 leads to a segmentation fault when I run on a file that merely imports hydra_zen: import hydra_zen This appears to be related to hydra-zen's use ...
Opengraph URL: https://github.com/python/mypy/issues/14031
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"mypy 0.990 crashes with segmentation fault on `hydra_zen` due to recursive types","articleBody":"\u003c!--\r\n Use this form only if mypy reports an \"INTERNAL ERROR\" and/or gives a traceback.\r\n Please include the traceback and all other messages below (use `mypy --show-traceback`).\r\n-->\r\n\r\n**Crash Report**\r\n\r\nUpgrading from mypy 0.982 to 0.990 leads to a segmentation fault when I run on a file that merely imports [hydra_zen](https://github.com/mit-ll-responsible-ai/hydra-zen):\r\n\r\n```python\r\nimport hydra_zen\r\n```\r\n\r\nThis appears to be related to hydra-zen's use of recursive types and mypy 0.990 enabling these by default. To confirm, I reverted to `0.982` and configured then `enable_recursive_aliases = true` and confirmed that this also produces a segmentation fault. \r\n\r\n[This is the recursive type](https://github.com/mit-ll-responsible-ai/hydra-zen/blob/c6f45821cb26539308c8bf8db01f32aaae9d2cbb/src/hydra_zen/typing/_implementations.py#L200-L229) that is creating the issue. Oddly, when I specifically remove `Sequence[\"SupportedPrimitive\"]` from the union (comment out line 223), the issue goes away. I spent time trying to further isolate the culprit and create a minimal example, but I was unable to decouple the issue from hydra_zen. \r\n\r\n**Traceback**\r\n\r\n```\r\nSegmentation fault\r\n```\r\n\r\n**To Reproduce**\r\n\r\n```\r\nrsokl@Maxwell:/tmp$ pip install hydra-zen==0.8.0 mypy==0.990\r\nrsokl@Maxwell:/tmp$ echo \"import hydra_zen\" > foo.py\r\nrsokl@Maxwell:/tmp/hydra-zen$ mypy foo.py\r\nSegmentation fault\r\n```\r\n\r\n**Your Environment**\r\n\r\n\u003c!-- Include as many relevant details about the environment you experienced the bug in -->\r\n\r\n- Mypy version used: `0.990`\r\n- Mypy command-line flags: (None)\r\n- Mypy configuration options from `mypy.ini` (and other config files): (None)\r\n- Python version used: `python-3.9.13-haa1d7c7_2`\r\n- Operating system and version: Ubuntu 20.04.4 LTS (GNU/Linux 5.10.102.1-microsoft-standard-WSL2 x86_64)\r\n\r\n\u003c!--\r\nYou can freely edit this text, please remove all the lines\r\nyou believe are unnecessary.\r\n-->\r\n\r\n","author":{"url":"https://github.com/rsokl","@type":"Person","name":"rsokl"},"datePublished":"2022-11-08T04:48:58Z","url":"https://github.com/python/mypy/issues/14031"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:f5e8383b-1a00-1782-50ab-1e99da5db6a7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E096:29A20E:28BDE03:37855BF:6B0047E8 |
| html-safe-nonce | 206108c6d28fef1b79e8f1cb760426a98a53ccd438bfb5f876956c32e9414f59 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMDk2OjI5QTIwRToyOEJERTAzOjM3ODU1QkY6NkIwMDQ3RTgiLCJ2aXNpdG9yX2lkIjoiOTA3OTkzNDkxNDI0MDk4OTE2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 677d832e2cf3a3c214ec5f96a77f3d4165da68878062ca29349a2f7bd9821ad4 |
| hovercard-subject-tag | issue:1439478200 |
| 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/python/mypy/14031/issue_layout |
| twitter:image | https://opengraph.githubassets.com/74e1fdca90f11c30133b00255482de330baf284583d73df47e1a356559675668/python/mypy/issues/14031 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/74e1fdca90f11c30133b00255482de330baf284583d73df47e1a356559675668/python/mypy/issues/14031 |
| og:image:alt | Crash Report Upgrading from mypy 0.982 to 0.990 leads to a segmentation fault when I run on a file that merely imports hydra_zen: import hydra_zen This appears to be related to hydra-zen's use of r... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rsokl |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/mypy git https://github.com/python/mypy.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 7053637 |
| octolytics-dimension-repository_nwo | python/mypy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7053637 |
| octolytics-dimension-repository_network_root_nwo | python/mypy |
| 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 | f3f3a43ca095cdea3abbb394112e971f9fdb94fa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width