dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse

This website has run out of funding so feel free to contribute if you can afford it (see footer)

Author Topic: Stack Trace  (Read 3037 times)

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6651
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Yesterday at 09:38:10 PM
  • Deeply Confused Learner
  • Profession: IT Engineer
Stack Trace
« on: February 09, 2018, 07:31:46 AM »
http://custom.simplemachines.org/mods/index.php?mod=3953

When errors are tracked when this mod is installed, a stack trace will be captured with them to be able to identify the code path involved.

> not working unfortunately - DEV/TEST debugging only
« Last Edit: February 09, 2018, 07:45:56 AM by Chipper »
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
Our Discord Server invitation link is https://discord.gg/jB2qmRrxyD

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6651
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Yesterday at 09:38:10 PM
  • Deeply Confused Learner
  • Profession: IT Engineer
Re: Stack Trace
« Reply #1 on: July 25, 2018, 07:21:34 PM »
is working now - Admin > Configuration > Server Settings > Disable evaluation of templates ticked

an enhancement: a deeper stack trace and (bug fix) prevention of spurious error "symptoms" finding their way to the screen @dougiefresh:

In Sources/Errors.php,

find:
Code: [Select]
foreach (debug_backtrace() as $this_error)
{
// We don't need to log the error handler itself.
if (substr($this_error['file'], -10) == 'Errors.php' && $this_error['function'] == 'log_error')
continue;
if (substr($this_error['file'], -8) == 'Subs.php' && $this_error['function'] == 'error_handler')
continue;

// Certain anonymous calls do not end up in this fashion.
$frame = array(
'line' => $smcFunc['htmlspecialchars'](strtr($this_error['file'], $repl) . ':' . $this_error['line']),
'function' => $smcFunc['htmlspecialchars']((!empty($this_error['class']) ? $this_error['class'] . '->' : '') . $this_error['function']),
);
if ($frame['line'] != ':')
$stack[] = $frame;
}

change to:
Code: [Select]
foreach (debug_backtrace() as $this_error)
{
// We don't need to log the error handler itself.
if (isset($this_error['file']) && substr($this_error['file'], -10) == 'Errors.php' && $this_error['function'] == 'log_error')
continue;
if (isset($this_error['file']) && substr($this_error['file'], -8) == 'Subs.php' && $this_error['function'] == 'error_handler')
continue;

// Certain anonymous calls do not end up in this fashion.
$frame = array(
'line' => isset($this_error['file']) ? $smcFunc['htmlspecialchars'](strtr($this_error['file'], $repl) . ':' . $this_error['line']) : '',
'function' => $smcFunc['htmlspecialchars']((!empty($this_error['class']) ? $this_error['class'] . '->' : '') . $this_error['function']),
);
if ($frame['line'] != ':')
$stack[] = $frame;
}
« Last Edit: July 25, 2018, 07:33:29 PM by Chip »
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
Our Discord Server invitation link is https://discord.gg/jB2qmRrxyD

Tags:
 


dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse





TERMS AND CONDITIONS

In no event will d&u or any person involved in creating, producing, or distributing site information be liable for any direct, indirect, incidental, punitive, special or consequential damages arising out of the use of or inability to use d&u. You agree to indemnify and hold harmless d&u, its domain founders, sponsors, maintainers, server administrators, volunteers and contributors from and against all liability, claims, damages, costs and expenses, including legal fees, that arise directly or indirectly from the use of any part of the d&u site.


TO USE THIS WEBSITE YOU MUST AGREE TO THE TERMS AND CONDITIONS ABOVE


Founded December 2014
SimplePortal 2.3.6 © 2008-2014, SimplePortal