-
The STL regex-search implementation is recursive, so it may create a bunch of stack frames during execution. In fact, you can see that even the native execution overflows the stack when the stack size is limited on trivial programs: $ g++ -o stl_regex_search stl_regex_search.cxx -fsanitize=address
$ ulimit -s 256
# this command sets the stack size of the current session (and all programs executed in this session) to 256KB
$ ./stl_regex_search
AddressSanitizer:DEADLYSIGNAL
=================================================================
==2411980==ERROR: AddressSanitizer: stack-overflow on address 0x7ffea7880ff8
... 248 stack frames ...
SUMMARY: AddressSanitizer: stack-overflow (stl_regex_search+0x96a1b) in std::__detail::_BracketMatcher<std::__cxx11::regex_traits<char>, false, false>::_M_apply(char, std::integral_constant<bool, true>) const
==2411980==ABORTING When running such programs under Gramine, Gramine will segfault or go crazy because it has a small default stack size of 256KB. In fact, this is a known issue: |
Beta Was this translation helpful? Give feedback.
Answered by
dimakuv
Jun 7, 2023
Replies: 1 comment
-
Solutions
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dimakuv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solutions
sys.stack.size = "1M"
or a greater value.