Skip to content

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

Description

@Eclips4

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

Activity

  1. sobolevn commented on Feb 29, 2024

    @sobolevn
    Member

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

    I wanted to post the same :)

  2. sobolevn commented on Feb 29, 2024

    @sobolevn
    Member

    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

  3. ericsnowcurrently commented on Mar 1, 2024

    @ericsnowcurrently
    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.

  4. added a commit that references this issue on Mar 2, 2024
  5. ericsnowcurrently commented on Mar 2, 2024

    @ericsnowcurrently
    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.

  6. sobolevn commented on Mar 2, 2024

    @sobolevn
    Member

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

  7. sobolevn commented on Mar 2, 2024

    @sobolevn
    Member

    Done: #116239

  8. sobolevn commented on Mar 2, 2024

    @sobolevn
    Member

    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 :)

  9. added a commit that references this issue on Mar 4, 2024
  10. ericsnowcurrently commented on Mar 4, 2024

    @ericsnowcurrently
    Member

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

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

  11. added a commit that references this issue on Mar 25, 2024
  12. added a commit that references this issue on Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions