Код: Выделить всё
%ERROR_LEVEL%An example stack trace:

< /p>
#include
#include
#include
#include
#include
#include
#include
#include
const auto cmdLine = "cmd /c start /min procgov.exe --maxmem 1M -p {}";
const auto sixtyX = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
int main(int, char **) {
::system(std::format(cmdLine, ::GetCurrentProcessId()).c_str());
::Sleep(1000);
try {
std::vector strings;
for (const auto i : std::ranges::views::iota(0, 1'000'000)) {
try {
strings.push_back(sixtyX);
} catch (...) {
throw;
}
}
} catch (...) {
}
std::println("This is not (always) printed");
}
< /code>
Почему нарушения доступа и переполнения стека происходят? И почему, если так, только спорадически?>
Подробнее здесь: https://stackoverflow.com/questions/797 ... -overflows
Мобильная версия