Matching 500KB of data with builtins.match causes stack overflow #476
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#476
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
builtins.match
uses#include <regex>
, which crashes when matching on too large amount of datathis causes issues in practice, for instance in
620a3c32c6
, the code had to be modified to avoid regexesSteps To Reproduce
run
see the following error
Expected behavior
i would expect
[ ]
to appear, not a stack overflownix --version
outputAdditional context
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86164
so, to start off, we agree this is a bug.
there's some history to trying to fix the regexes in lix: #34. it's been tried before to replace them with boost regex but the nixpkgs regex escape function was not escaping enough stuff which caused a regression.
the most viable option is most likely to use std::regex from libc++ on all platforms by vendoring it or to rip out the right number of features from rust regex to use that instead.
This issue was mentioned on Gerrit on the following CLs: