Overview
| Comment: | Fix [7d47ba7d94]: the regexp engine could overflow the C stack on deeply nested REs. Implement STACK_TOO_DEEP() as a stack budget (REG_MAX_STACK_DEPTH, 1 MB) measured from compile()/exec(), add the checks PostgreSQL has, and cache lookahead DFAs per execution instead of building them on the stack. Deep nesting now fails with "regular expression is too complex". New tests reg-33.32 to 33.35, reg-33.14 made portable. |
|---|---|
| Timelines: | family | ancestors | descendants | both | regexp-stack-depth |
| Files: | files | file ages | folders |
| SHA3-256: |
ef6503421f59b2def1954fcddf9dd40e |
| User & Date: | serhiy.storchaka on 2026-10-10 20:46:07.672 |
| Other Links: | branch diff | manifest | tags |
Context
|
2026-10-11
| ||
| 10:04 | Use the real stack limit of the current thread (new TclpGetCStackLimit(): pthread_getattr_np, pthrea... check-in: c9dd03125b user: serhiy.storchaka tags: regexp-stack-depth | |
|
2026-10-10
| ||
| 20:46 | Fix [7d47ba7d94]: the regexp engine could overflow the C stack on deeply nested REs. Implement STACK... check-in: ef6503421f user: serhiy.storchaka tags: regexp-stack-depth | |
|
2026-10-08
| ||
| 09:29 | merge: gahr-dual-stack-tests check-in: e55edf971f user: gahr tags: trunk, main | |
Changes
Modified generic/regc_nfa.c
from [2ae6374958]
to [8422611c5d].
[diff]
Modified generic/regcomp.c
from [2fc78dac72]
to [684f6c0070].
[diff]
Modified generic/rege_dfa.c
from [8cdf55f03c]
to [1c447f6aca].
[diff]
Modified generic/regexec.c
from [200c720b34]
to [9292a903ee].
[diff]
Modified generic/regguts.h
from [48dbb6d447]
to [fed89fde46].
[diff]
Modified tests/reg.test
from [6123b75da1]
to [613363dec3].
[diff]