Skip to content

Commit

Permalink
Core/MMAPs: Replace an assert with error log
Browse files Browse the repository at this point in the history
Replace an assert in PathGenerator::BuildPolyPath() about invalid poly reference with an error log.
Fixes #11493 .
  • Loading branch information
jackpoz committed Feb 27, 2014
1 parent dd2746c commit d5d2805
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/server/game/Movement/PathGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,16 @@ void PathGenerator::BuildPolyPath(G3D::Vector3 const& startPos, G3D::Vector3 con
{
for (; pathStartIndex < _polyLength; ++pathStartIndex)
{
// here to carch few bugs
ASSERT(_pathPolyRefs[pathStartIndex] != INVALID_POLYREF);
// here to catch few bugs
if (_pathPolyRefs[pathStartIndex] == INVALID_POLYREF)
{
TC_LOG_ERROR("maps", "Invalid poly ref in BuildPolyPath. _polyLength: %u, pathStartIndex: %u,"
" startPos: %s, endPos: %s, mapid: %u",
_polyLength, pathStartIndex, startPos.toString().c_str(), endPos.toString().c_str(),
_sourceUnit->GetMapId());

break;
}

if (_pathPolyRefs[pathStartIndex] == startPoly)
{
Expand Down

8 comments on commit d5d2805

@Vincent-Michael
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please build in debug and post another crash log?

@joschiwald
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lolololol

@jackpoz
Copy link
Contributor Author

@jackpoz jackpoz commented on d5d2805 Mar 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Maxxgold: build in RelWithDebInfo so the crash report is readable and then open an issue with that.
This commit has most likely nothing to do with your crash, the affected code was triggering an assert before anyway.

@jackpoz
Copy link
Contributor Author

@jackpoz jackpoz commented on d5d2805 Mar 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are 3 modes:

  • Release has code optimized for performance but is totally useless for crash reports
  • RelWithDebInfo has the same optimizations of Release but also generates additional details making crash reports at least readable
  • Debug has no optimizations and produces the most detailed crash reports, making it easier and faster for us to find the root cause of the crash and fix it.

If you don't experience any particular slowdown in Debug mode then please keep using it, otherwise please use at least RelWithDebInfo instead of Release.

@n4ndo
Copy link

@n4ndo n4ndo commented on d5d2805 Mar 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After update to this rev 3 crashes, not sure if related.

@jackpoz
Copy link
Contributor Author

@jackpoz jackpoz commented on d5d2805 Mar 1, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally unrelated. Btw first one happened when Player with GUID 4 logged in, does it always happen ?

@jackpoz
Copy link
Contributor Author

@jackpoz jackpoz commented on d5d2805 Mar 2, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a known issue of Debug mode, you can ignore it

@jackpoz
Copy link
Contributor Author

@jackpoz jackpoz commented on d5d2805 Mar 2, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crash on server exit in debug mode fixed in e4ab18a

Please sign in to comment.