Skip to content

Core Map Server Crashes (Logging & Despawn) #11257

Description

@gokudr

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my issue will be ignored.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have searched existing issues to see if the issue has already been opened, and I have checked the commit log to see if the issue has been resolved since my server was last updated.

OS / platform the server is running (if known)

Windows / Linux (Affects all platforms)

Branch affected by issue

base

Steps to reproduce

  1. For the Logging Crash: Trigger a console warning log in a file with a name length between 13 and 31 characters (e.g., x106_bazaar_buy.cpp). Observe the map server instantly hard-crash to the desktop due to a buffer underflow in src/common/logging.cpp.
  2. For the Despawn Crash: Have a player unexpectedly disconnect or log out while transitioning zones with an active state-altering effect (like Sleep or Stun).
  3. Observe the map server crash due to a Use-After-Free violation in src/map/status_effect_container.cpp.

Expected behavior

The map server should safely handle these events without crashing.

  • In logging.cpp, the q_formatter_flag has a hardcoded math bug subtracting 32 from strings > 12 chars. The threshold check needs to be changed from > 12 to > 32 (or greater than the actual string length).
  • In status_effect_container.cpp, ApplyStateAlteringEffects needs defensive null checks for the PAI pointer before destruction.
    Applying these fixes locally has completely resolved these crashes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions