Skip to content

New warning: ‘fmt’ may be used uninitialized in this function [-Wmaybe-uninitialized] #116102

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

Closed
Eclips4 opened this issue Feb 29, 2024 · 8 comments
Assignees
Labels
topic-subinterpreters type-bug An unexpected behavior, bug, or error

Comments

@Eclips4
Copy link
Member

Eclips4 commented Feb 29, 2024

Bug report

Bug description:

Popped up in https://github.com/python/cpython/pull/116101/files and https://github.com/python/cpython/pull/116096/files

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

@Eclips4 Eclips4 added the type-bug An unexpected behavior, bug, or error label Feb 29, 2024
@sobolevn
Copy link
Member

Thanks a lot for your helpful reports!
Снимок экрана 2024-02-29 в 13 44 41

I wanted to post the same :)

@sobolevn
Copy link
Member

sobolevn commented Feb 29, 2024

I think that there are multiple issues here:

» ./python.exe
Python 3.13.0a4+ (heads/main:186fa938766, Feb 29 2024, 13:50:11) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import _xxinterpqueues
>>> a = _xxinterpqueues.create(2, 0)
>>> _xxinterpqueues.get(a, 'a')
('a', 3)
>>> 
KeyboardInterrupt
>>> ^D
Assertion failed: (queues->count == 0), function _queues_fini, file _xxinterpqueuesmodule.c, line 689.
[1]    57640 abort      ./python.exe
  1. Why ('a', 3) is returned? 3 is not the default fmt for this queue
  2. Why does it crash? Assertion failed: (queues->count == 0), function _queues_fini, file _xxinterpqueuesmodule.c, line 689.

CC @ericsnowcurrently

@ericsnowcurrently
Copy link
Member

  1. Why ('a', 3) is returned? 3 is not the default fmt for this queue

It should have raised QueueEmpty. When run your code locally I get QueueEmpty.

  1. Why does it crash? Assertion failed: (queues->count == 0), function _queues_fini, file _xxinterpqueuesmodule.c, line 689.

I'm going to look into this.

@ericsnowcurrently
Copy link
Member

I've fixed the warning.

As to "Why does it crash?", it's because the low-level module requires you to call _xxinterpqueues.destroy(). Note that I didn't really intend for people to use the low-level module directly. If this is a problem, we can address it separately from this issue.

@sobolevn
Copy link
Member

sobolevn commented Mar 2, 2024

@ericsnowcurrently I will open a new one, because I don't have the same result as you with QueueEmpty :(

@sobolevn
Copy link
Member

sobolevn commented Mar 2, 2024

Done: #116239

@sobolevn
Copy link
Member

sobolevn commented Mar 2, 2024

If this is a problem, we can address it separately from this issue.

Can we call .destroy() on module shut-down? It might fix this problem.
Tell me to open a new issue if you think that this is worth fixing, though :)

@ericsnowcurrently
Copy link
Member

Can we call .destroy() on module shut-down? It might fix this problem.

I'm taking care of this in gh-116328.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-subinterpreters type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

No branches or pull requests

3 participants