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
{{ message }}
Repository navigation
Out of bounds in traceback.c when alloca() is used over VLA #145792
For the same size, VLA type[size] will allocate (sizeof(type) * size) but alloca(size) will only allocate (1 * size), which is significantly smaller than intended and will cause subsequent accesses of the allocation to be out of bounds, potentially corrupting the stack.
I was playing with disabling VLA support in slimcc (and defined __STDC_NO_VLA__ accordingly), saw test_faulthandler failing because of the change then tracked down the cause, just some nerdy fun (also found a jemalloc bug this way).
Activity
sergey-miryanov commentedon Mar 11, 2026
@fuhsnn Would you like open a PR?
pythongh-145792: Fix incorrect alloca allocation size in traceback.c
gh-145792: Fix incorrect alloca allocation size in traceback.c (#145814)
pythongh-145792: Fix incorrect alloca allocation size in traceback.c (p…
vstinner commentedon Mar 13, 2026
@fuhsnn: I'm curious, how did you spot this bug?
[3.14] gh-145792: Fix incorrect alloca allocation size in traceback.c (…
fuhsnn commentedon Mar 13, 2026
I was playing with disabling VLA support in
slimcc(and defined__STDC_NO_VLA__accordingly), sawtest_faulthandlerfailing because of the change then tracked down the cause, just some nerdy fun (also found a jemalloc bug this way).pythongh-145792: Fix incorrect alloca allocation size in traceback.c (p…