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

Reference leak in test_datetime #124606

Closed
Eclips4 opened this issue Sep 26, 2024 · 2 comments
Closed

Reference leak in test_datetime #124606

Eclips4 opened this issue Sep 26, 2024 · 2 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@Eclips4
Copy link
Member

Eclips4 commented Sep 26, 2024

Bug report

Bug description:

./python -m test -R 3:3 test_datetime
Using random seed: 2162639794
0:00:00 load avg: 88.54 Run 1 test sequentially in a single process
0:00:00 load avg: 88.54 [1/1] test_datetime
beginning 6 repetitions. Showing number of leaks (. for 0 or less, X for 10 or more)
123:456
XXX 999
test_datetime leaked [9, 9, 9] references, sum=27
test_datetime leaked [3, 3, 3] memory blocks, sum=9
test_datetime failed (reference leak)

== Tests result: FAILURE ==

1 test failed:
    test_datetime

Total duration: 21.9 sec
Total tests: run=1,026 skipped=31
Total test files: run=1/1 failed=1
Result: FAILURE

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS

Linked PRs

@Eclips4 Eclips4 added type-bug An unexpected behavior, bug, or error tests Tests in the Lib/test dir labels Sep 26, 2024
@Eclips4 Eclips4 changed the title Leak in test_datetime Reference leak in test_datetime Sep 26, 2024
@vstinner
Copy link
Member

The failing test is test_fromisoformat_fails_datetime:

$ ./python -m test test_datetime -R 3:3 -m test_fromisoformat_fails_datetime
(...)
test_datetime leaked [9, 9, 9] references, sum=27
(...)

Eclips4 added a commit that referenced this issue Sep 26, 2024
…t` in `_datetimemodule.c` (#124607)

Previously `tzdata` and `dtstr_clean` were not decrefed in the `invalid_iso_midnight` error path of the `datetime_isoformat` function.
@Eclips4
Copy link
Member Author

Eclips4 commented Sep 26, 2024

Fixed in #124607.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
Projects
Archived in project
Development

No branches or pull requests

2 participants