Skip to content

Fix DPP code to allow us to update to latest DPP #753

@pifopi

Description

@pifopi

Hello! I've been using DPP for a C++ project for a while now, and it worked great. Recently we updated from 10.0.22 (I think) to the 10.1.3 release and have experienced segfaults.

Repro steps:
Start the bot.
Stop the bot shortly after (before shards are ready).

Segfault happens in for (uint32_t s = 0; s < numshards; ++s) (cluster.cpp line 345). The crash does not happen if I let the shards fully initialize.

I create std::unique_ptrdpp::cluster m_bot = nullptr; before initializing/configuring/starting the bot. Stopping the bot calls shutdown() before resetting the pointer (can provide actual code if needed).

This wasn't an issue before, so seems like some sort of regression. Is there a way to check when shards are ready in order to prevent premature destruction? The on_ready() event triggers before the shards are ready.

copied from https://discord.com/channels/825407338755653642/825411707521728512/1426722220780163204

Small code example reproducing the issue (forked from their example)
https://github.com/pifopi/windows-bot-template

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions