[issue32368] Segfault when compiling many conditional expressions

Christian Heimes report at bugs.python.org
Mon Dec 18 11:42:20 EST 2017


Christian Heimes <lists at cheimes.de> added the comment:

Looks like 174,565 stack frames are a bit too much :)

(gdb) bt
#0  dfs (c=0x7fffffffcbe0, b=0x7fffea076d60, a=0x7fffffffcb50) at Python/compile.c:4903
#1  0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea076db0, a=0x7fffffffcb50) at Python/compile.c:4903
#2  0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea076cc0, a=0x7fffffffcb50) at Python/compile.c:4903
#3  0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea076d10, a=0x7fffffffcb50) at Python/compile.c:4903
#4  0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea076c20, a=0x7fffffffcb50) at Python/compile.c:4903
#5  0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea076c70, a=0x7fffffffcb50) at Python/compile.c:4903
#6  0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea076b80, a=0x7fffffffcb50) at Python/compile.c:4903
#7  0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea076bd0, a=0x7fffffffcb50) at Python/compile.c:4903
#8  0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea076ae0, a=0x7fffffffcb50) at Python/compile.c:4903
#9  0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea076b30, a=0x7fffffffcb50) at Python/compile.c:4903
#10 0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea076a40, a=0x7fffffffcb50) at Python/compile.c:4903
#11 0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea076a90, a=0x7fffffffcb50) at Python/compile.c:4903
#12 0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea0769a0, a=0x7fffffffcb50) at Python/compile.c:4903
#13 0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea0769f0, a=0x7fffffffcb50) at Python/compile.c:4903
#14 0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7fffea076900, a=0x7fffffffcb50) at Python/compile.c:4903

(gdb) bt -50
...
#174562 0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7ffff04609a0, a=0x7fffffffcb50) at Python/compile.c:4903
#174563 0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7ffff04609f0, a=0x7fffffffcb50) at Python/compile.c:4903
#174564 0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7ffff0460900, a=0x7fffffffcb50) at Python/compile.c:4903
#174565 0x00000000004e47a2 in dfs (c=0x7fffffffcbe0, b=0x7ffff0460950, a=0x7fffffffcb50) at Python/compile.c:4903
#174566 0x00000000004e47a2 in dfs (c=c at entry=0x7fffffffcbe0, b=b at entry=0x7ffff04608b0, a=a at entry=0x7fffffffcb50) at Python/compile.c:4903
#174567 0x00000000004e9844 in assemble (c=c at entry=0x7fffffffcbe0, addNone=<optimized out>) at Python/compile.c:5411
#174568 0x00000000004ed809 in compiler_mod (c=c at entry=0x7fffffffcbe0, mod=mod at entry=0x3523788) at Python/compile.c:1494
#174569 0x00000000004eda33 in PyAST_CompileObject (mod=0x3523788, filename=filename at entry='foobar', flags=flags at entry=0x7fffffffccb4, optimize=optimize at entry=-1, arena=arena at entry=0x7ffff0466f40)
    at Python/compile.c:345
#174570 0x000000000050fcaa in Py_CompileStringObject (
    str=0x7fffef9d1070 "42 if True else 43\n42 if True else 43\n42 if True else 43\n42 if True else 43\n42 if True else 43\n42 if True else 43\n42 if True else 43\n42 if True else 43\n42 if True else 43\n42 if True else 43\n42 if True"..., filename=filename at entry='foobar', start=start at entry=257, flags=flags at entry=0x7fffffffccb4, optimize=optimize at entry=-1) at Python/pythonrun.c:1098
#174571 0x00000000004d2146 in builtin_compile_impl (module=module at entry=<module at remote 0x7ffff7f5b658>,

----------
nosy: +christian.heimes

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32368>
_______________________________________


More information about the Python-bugs-list mailing list