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 1103 times)

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6493
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 05:43:23 AM
  • 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 »
I do not condone or support any illegal activities. All information is for theoretical discussion and wonder.
All activities discussed are considered fictional and hypothetical. Information of all discussion has been derived from online research and in the spirit of personal Freedom.

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6493
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 05:43:23 AM
  • 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 »
I do not condone or support any illegal activities. All information is for theoretical discussion and wonder.
All activities discussed are considered fictional and hypothetical. Information of all discussion has been derived from online research and in the spirit of personal Freedom.

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