Repository navigation
Closed
Labels
3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Description
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 = <Date 2019-10-19.20:23:30.477>
created_at = <Date 2019-10-19.08:00:52.660>
labels = ['interpreter-core', '3.8', '3.9', 'type-crash']
title = 'Strange reversed dict behavior'
updated_at = <Date 2019-11-14.10:48:55.574>
user = 'https://bugs.python.org/ivb'bugs.python.org fields:
activity = <Date 2019-11-14.10:48:55.574>
actor = 'Harmon758'
assignee = 'none'
closed = True
closed_date = <Date 2019-10-19.20:23:30.477>
closer = 'pablogsal'
components = ['Interpreter Core']
creation = <Date 2019-10-19.08:00:52.660>
creator = 'ivb'
dependencies = []
files = []
hgrepos = []
issue_num = 38525
keywords = ['patch']
message_count = 15.0
messages = ['354931', '354932', '354933', '354938', '354939', '354940', '354944', '354945', '354946', '354947', '354948', '354949', '354961', '354962', '354963']
nosy_count = 10.0
nosy_names = ['ned.deily', 'methane', 'ivb', 'serhiy.storchaka', 'corona10', 'pablogsal', 'miss-islington', 'Harmon758', 'remi.lapeyre', 'xtreak']
pr_nums = ['16846', '16847', '16853']
priority = 'critical'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue38525'
versions = ['Python 3.8', 'Python 3.9']Metadata
Metadata
Assignees
Labels
3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifeinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
Activity
ivb commentedon Oct 19, 2019
================================ RESTART: Shell ================================
ned-deily commentedon Oct 19, 2019
Outside of IDLE, the example causes a segfault. With debug build of current master HEAD:
Assertion failed: (value != NULL), function dictreviter_iternext, file ../../source/Objects/dictobject.c, line 3834.
ned-deily commentedon Oct 19, 2019
Thanks for the report, by the way!
corona10 commentedon Oct 19, 2019
This issue is related to reversed dict iter.
corona10 commentedon Oct 19, 2019
corona10 commentedon Oct 19, 2019
Can I take look at this issue?
pablogsal commentedon Oct 19, 2019
Wops, we made a PR at the same time, Dong-hee Na.
I will close mine :)
corona10 commentedon Oct 19, 2019
lol
Oh.. thank you for giving me a chance.
serhiy-storchaka commentedon Oct 19, 2019
The proposed fix fixes a crash, but there is other bug in iterating shared dicts.
With PR 16846 the last print outputs [] instead of expected ['x']. It crashes without PR 16846, so this issue is not only about empty dicts.
corona10 commentedon Oct 19, 2019
Yes, you are right.
But I can not work on this issue today.
(I have to finalize my paperwork by today :-()
since priority is critical if other core developers finalize this issue today. It will be okay for me.
corona10 commentedon Oct 19, 2019
FYI
works as we expected.
methane commentedon Oct 19, 2019
When dict is empty, di_pos of reverse iterator must be -1, not 0.
Additionally, di_pos must be initialized from ma_used when dict is key sharing dict.
pablogsal commentedon Oct 19, 2019
New changeset 24dc2f8 by Pablo Galindo (Dong-hee Na) in branch 'master':
bpo-38525: Fix a segmentation fault when using reverse iterators of empty dict (GH-16846)
24dc2f8
miss-islington commentedon Oct 19, 2019
New changeset d73205d by Miss Islington (bot) in branch '3.8':
bpo-38525: Fix a segmentation fault when using reverse iterators of empty dict (GH-16846)
d73205d
pablogsal commentedon Oct 19, 2019
Closing this.
Thanks, Dong-hee Na and everyone involved in the issue!