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

"_weakrefset.py", line 56: IndexError: pop from empty list #87428

Closed
jhshi89 mannequin opened this issue Feb 19, 2021 · 2 comments
Closed

"_weakrefset.py", line 56: IndexError: pop from empty list #87428

jhshi89 mannequin opened this issue Feb 19, 2021 · 2 comments
Labels
3.8 only security fixes topic-asyncio type-bug An unexpected behavior, bug, or error

Comments

@jhshi89
Copy link
Mannequin

jhshi89 mannequin commented Feb 19, 2021

BPO 43262
Nosy @asvetlov, @1st1, @jhshi89

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-02-19.06:47:59.625>
labels = ['type-bug', '3.8', 'expert-asyncio']
title = '"_weakrefset.py", line 56: IndexError: pop from empty list'
updated_at = <Date 2021-07-06.23:58:55.464>
user = 'https://github.com/jhshi89'

bugs.python.org fields:

activity = <Date 2021-07-06.23:58:55.464>
actor = 'andrei.avk'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['asyncio']
creation = <Date 2021-02-19.06:47:59.625>
creator = 'jhshi89'
dependencies = []
files = []
hgrepos = []
issue_num = 43262
keywords = []
message_count = 1.0
messages = ['387288']
nosy_count = 3.0
nosy_names = ['asvetlov', 'yselivanov', 'jhshi89']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue43262'
versions = ['Python 3.8']

@jhshi89
Copy link
Mannequin Author

jhshi89 mannequin commented Feb 19, 2021

One of our asyncio based application sporadically crash due to this stack trace:

File ".../lib/python3.8/asyncio/runners.py", line 48, in run
    loop.run_until_complete(loop.shutdown_asyncgens())
  File ".../lib/python3.8/asyncio/base_events.py", line 595, in run_until_complete
    future = tasks.ensure_future(future, loop=self)
  File ".../lib/python3.8/asyncio/tasks.py", line 669, in ensure_future
    task = loop.create_task(coro_or_future)
  File ".../lib/python3.8/asyncio/base_events.py", line 431, in create_task
    task = tasks.Task(coro, loop=self, name=name)
  File ".../lib/python3.8/_weakrefset.py", line 83, in add
    self._commit_removals()
  File ".../lib/python3.8/_weakrefset.py", line 56, in _commit_removals
    discard(l.pop())
IndexError: pop from empty list

We do not have a reliable repro. From reading the source code, it appears we should never try to pop from empty list:

 def _commit_removals(self):
        l = self._pending_removals
        discard = self.data.discard
        while l:
            discard(l.pop()) # <-- HERE

@jhshi89 jhshi89 mannequin added type-crash A hard crash of the interpreter, possibly with a core dump 3.8 only security fixes topic-asyncio labels Feb 19, 2021
@akulakov akulakov added type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Jul 6, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@kumaraditya303
Copy link
Contributor

Closing because of lack of reproducer and Python 3.8 is not supported anymore (security fixes only).

@kumaraditya303 kumaraditya303 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.8 only security fixes topic-asyncio type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants