Skip to content

Fix traceback in threads when SetTrace used.#2075

Open
mickp wants to merge 1 commit into
IronLanguages:mainfrom
mickp:map/2072_FixSetTraceStack
Open

Fix traceback in threads when SetTrace used.#2075
mickp wants to merge 1 commit into
IronLanguages:mainfrom
mickp:map/2072_FixSetTraceStack

Conversation

@mickp

@mickp mickp commented Jul 16, 2026

Copy link
Copy Markdown

Testing

The following script returns normamly, where previously it encountered: ValueError: call stack is not deep enough.

import sys
import threading
import typing

def tracer(frame, event, arg):
    return tracer

def do_check():
    isinstance(None, typing.Iterable)

sys.settrace(tracer)

t = threading.Thread(target=do_check)
t.start()
t.join()

Testing
===
The following script returns normamly, where previously it encountered: `ValueError: call stack is not deep enough`.

```
import sys
import threading
import typing

def tracer(frame, event, arg):
    return tracer

def do_check():
    isinstance(None, typing.Iterable)

sys.settrace(tracer)

t = threading.Thread(target=do_check)
t.start()
t.join()
```
@mickp

mickp commented Jul 16, 2026

Copy link
Copy Markdown
Author

Resolves #2072

@mickp

mickp commented Jul 16, 2026

Copy link
Copy Markdown
Author

I think the CI tests are failing here, for each configuration.

image

I see that fail intermittently when I test locally.

When I attach the debugger, the pass rate may be higher, and I see occasional failures at the location above, and here:

image

@slozier

slozier commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR! Will be a couple weeks before I have time to properly look at this.

@mickp

mickp commented Jul 16, 2026

Copy link
Copy Markdown
Author

I think this addresses the root cause of the call stack loss in threads, but I can not figure out how the change is getting hit to cause that one test failure in all runtime targets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants