Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack overflow found in Pylance telemetry #9740

Open
rchiodo opened this issue Jan 22, 2025 · 1 comment
Open

Stack overflow found in Pylance telemetry #9740

rchiodo opened this issue Jan 22, 2025 · 1 comment
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working

Comments

@rchiodo
Copy link
Collaborator

rchiodo commented Jan 22, 2025

We're seeing this on about 50 machines:

RangeError: Maximum call stack size exceeded
at classType pyright-internal/src/analyzer/typeUtils.ts:1693:4
at classType pyright-internal/src/analyzer/enums.ts:319:41
at transformTypeForEnumMember pyright-internal/src/analyzer/enums.ts:564:17
at evaluatorInterface pyright-internal/src/analyzer/typeEvaluator.ts:5622:20
at getTypeOfMemberAccessWithBaseType pyright-internal/src/analyzer/typeEvaluator.ts:5396:27
at node pyright-internal/src/analyzer/typeEvaluator.ts:1116:49
at callback pyright-internal/src/common/timing.ts:40:19
at getTypeOfExpression pyright-internal/src/analyzer/enums.ts:382:33
at transformTypeForEnumMember pyright-internal/src/analyzer/enums.ts:564:17
at evaluatorInterface pyright-internal/src/analyzer/typeEvaluator.ts:5622:20
at getTypeOfMemberAccessWithBaseType pyright-internal/src/analyzer/typeEvaluator.ts:5396:27
at node pyright-internal/src/analyzer/typeEvaluator.ts:1116:49
at callback pyright-internal/src/common/timing.ts:40:19
at getTypeOfExpression pyright-internal/src/analyzer/enums.ts:382:33
at transformTypeForEnumMember pyright-internal/src/analyzer/enums.ts:564:17
at evaluatorInterface pyright-internal/src/analyzer/typeEvaluator.ts:5622:20
at getTypeOfMemberAccessWithBaseType pyright-internal/src/analyzer/typeEvaluator.ts:5396:27
at node pyright-internal/src/analyzer/typeEvaluator.ts:1116:49
at callback pyright-internal/src/common/timing.ts:40:19
at getTypeOfExpression pyright-internal/src/analyzer/enums.ts:382:33
at transformTypeForEnumMember pyright-internal/src/analyzer/enums.ts:564:17
at evaluatorInterface pyright-internal/src/analyzer/typeEvaluator.ts:5622:20
at getTypeOfMemberAccessWithBaseType pyright-internal/src/analyzer/typeEvaluator.ts:5396:27
at node pyright-internal/src/analyzer/typeEvaluator.ts:1116:49
at callback pyright-internal/src/common/timing.ts:40:19
at getTypeOfExpression pyright-internal/src/analyzer/enums.ts:382:33
at transformTypeForEnumMember pyright-internal/src/analyzer/enums.ts:564:17
at evaluatorInterface pyright-internal/src/analyzer/typeEvaluator.ts:5622:20

@rchiodo rchiodo added the bug Something isn't working label Jan 22, 2025
@erictraut
Copy link
Collaborator

erictraut commented Jan 25, 2025

When trying to find a repro case, I ran across this sample which results in a stack overflow. It's similar, but the stack crawl is a bit different.

from enum import Enum
from typing import Literal

class Foo(Enum):
    x: "Literal[Foo.x]"

Here's a sample that results in a crash and a stack crawl that looks very much like the one in the telemetry.

from __future__ import annotations
from enum import Enum
from typing import Final

class Foo(Enum):
    x: Foo.x

erictraut added a commit that referenced this issue Jan 25, 2025
…num class uses a reference to an enum member in an annotation for that same enum member. This addresses #9740.
erictraut added a commit that referenced this issue Jan 25, 2025
…num class uses a reference to an enum member in an annotation for that same enum member. This addresses #9740. (#9762)
@erictraut erictraut added the addressed in next version Issue is fixed and will appear in next published version label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addressed in next version Issue is fixed and will appear in next published version bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants