You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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='https://github.com/lysnikolaou'closed_at=<Date2020-06-21.02:30:45.455>created_at=<Date2020-06-20.21:36:11.100>labels= ['interpreter-core', '3.10', '3.9', 'type-crash']
title='`with a as b` segfault in new peg parser'updated_at=<Date2020-06-21.02:47:28.773>user='https://github.com/stestagg'
$ ./python/bin/python3
Python 3.10.0a0 (heads/master:eb0d5c38de, Jun 20 2020, 21:35:36)
[Clang 10.0.0 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> with a as b
fish: “./python/bin/python3” terminated by signal SIGSEGV (Address boundary error)
withstacktrace:
*thread#1, name = 'run', stop reason = signal SIGSEGV: invalid address (fault address: 0x20)*frame#0: 0x0000555555a08feb run`with_item_rule at parser.c:15382:20frame#1: 0x0000555555a08e96 run`with_item_rule(p=0x00007ffff78b9e40) at parser.c:4330frame#2: 0x00005555559d22e9 run`compound_stmt_rule at parser.c:17930:21frame#3: 0x00005555559d227c run`compound_stmt_rule at parser.c:4139frame#4: 0x00005555559d1a64 run`compound_stmt_rule(p=<unavailable>) at parser.c:1931frame#5: 0x00005555559d016c run`statements_rule at parser.c:1230:18frame#6: 0x00005555559d00fb run`statements_rule at parser.c:16156frame#7: 0x00005555559cff4d run`statements_rule(p=<unavailable>) at parser.c:1189frame#8: 0x00005555559cb2bc run`_PyPegen_parse at parser.c:722:18frame#9: 0x00005555559cb28d run`_PyPegen_parse(p=0x00007ffff78b9e40) at parser.c:24688frame#10: 0x00005555559c5349 run`_PyPegen_run_parser(p=0x00007ffff78b9e40) at pegen.c:1083:17frame#11: 0x00005555559c6458 run`_PyPegen_run_parser_from_string(str=<unavailable>, start_rule=<unavailable>, filename_ob=0x00007ffff788db30, flags=<unavailable>, arena=<unavailable>) at pegen.c:1201:14frame#12: 0x00005555555eea84 run`PyPegen_ASTFromStringObject(str="with'lZ''</'as sdbm.N", filename=0x00007ffff788db30, mode=257, flags=0x0000000000000000, arena=0x00007ffff78e4910) at peg_api.c:27:21frame#13: 0x00005555555a8413 run`PyRun_StringFlags(str="with'lZ''</'as sdbm.N", start=<unavailable>, globals=0x00007ffff788d940, locals=0x00007ffff788d940, flags=0x0000000000000000) at pythonrun.c:1029:11frame#14: 0x00005555555a8202 run`PyRun_SimpleStringFlags(command="with'lZ''</'as sdbm.N", flags=0x0000000000000000) at pythonrun.c:429:9frame#15: 0x0000555555595936 run`main(argc=<unavailable>, argv=<unavailable>) at run.c:19:3frame#16: 0x00007ffff7c35002 libc.so.6`__libc_start_main + 242frame#17: 0x000055555559568e run`_start + 46
This appears to be similar to: https://bugs.python.org/issue40903, where GET_INVALID_TARGET is being called with an Attribute Node, which returns None, and this result is passed, unchecked into PyPegen_get_expr_name
New changeset 6c4e0bd by Lysandros Nikolaou in branch 'master': bpo-41060: Avoid SEGFAULT when calling GET_INVALID_TARGET in the grammar (GH-21020) 6c4e0bd
New changeset 71bb921 by Lysandros Nikolaou in branch '3.9':
[3.9] bpo-41060: Avoid SEGFAULT when calling GET_INVALID_TARGET in the grammar (GH-21020) (GH-21024) 71bb921
Activity
stestagg commentedon Jun 20, 2020
Hi
Fuzzing found the following:
This appears to be similar to: https://bugs.python.org/issue40903, where GET_INVALID_TARGET is being called with an Attribute Node, which returns None, and this result is passed, unchecked into
PyPegen_get_expr_namestestagg commentedon Jun 20, 2020
Appears to have been introduced by:
bpo-40334: Produce better error messages on invalid targets (GH-20106)
01ece63
lysnikolaou commentedon Jun 20, 2020
On it.
lysnikolaou commentedon Jun 20, 2020
Thanks for the report, Steve. I've now opened a PR that should fix this.
pablogsal commentedon Jun 21, 2020
New changeset 6c4e0bd by Lysandros Nikolaou in branch 'master':
bpo-41060: Avoid SEGFAULT when calling GET_INVALID_TARGET in the grammar (GH-21020)
6c4e0bd
miss-islington commentedon Jun 21, 2020
New changeset 71bb921 by Lysandros Nikolaou in branch '3.9':
[3.9] bpo-41060: Avoid SEGFAULT when calling GET_INVALID_TARGET in the grammar (GH-21020) (GH-21024)
71bb921