Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for trace infinity loop in exception handling #66

Merged
merged 4 commits into from
Jan 16, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion magmi/inc/magmi_engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ public function getExceptionTrace($tk, &$traces)
{
$this->_excid++;
$trstr = "";
//FIXME: infinity loop in M2
//todo: improve infinity loop handling in M2
$counter = 0;
foreach ($traces as $trace) {
if (isset($trace["file"])) {
$fname = str_replace(dirname(dirname(__FILE__)), "", $trace["file"]);
Expand All @@ -407,6 +408,10 @@ public function getExceptionTrace($tk, &$traces)
$trstr .= "\n";
}
}
// simple max trace depth fix
if (++$counter % 20) {
marvinhinz marked this conversation as resolved.
Show resolved Hide resolved
break;
}
}
if (!isset($this->_exceptions[$tk])) {
$this->_exceptions[$tk] = array(0,$this->_excid);
Expand Down