Skip to content

Bot still sometimes crashes while in a VC when a shard reconnection occurs #1613

Description

@Henonicks

Git commit reference
c095de7

Describe the bug
If the bot's shard reconnects, it's usually able to reconnect to the voice channel all on its own. But there's still a "roulette" element as it might crash during this period.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to a voice channel.
  2. Wait for it to crash
  • The logs will be spammed with "Sending op 4" around when the crash happens

Expected behavior
The bot shouldn't crash but instead manage to keep its connection.

System Details:

  • OS: Arch Linux x86_64 (Linux 7.1.3-arch1-3)

Additional context
Here's a stack trace of the crash:

<unknown> 0x00007ffff449981c
raise 0x00007ffff443e150
abort 0x00007ffff442567d
<unknown> 0x00007ffff44266fc
<unknown> 0x00007ffff44a3d8c
<unknown> 0x00007ffff44a6944
<unknown> 0x00007ffff44a714e
operator new(unsigned long) 0x00007ffff48b5ec5
std::__new_allocator::allocate new_allocator.h:162
std::allocator_traits::allocate alloc_traits.h:638
std::basic_string::_S_allocate basic_string.h:141
std::basic_string::_M_create basic_string.tcc:164
std::basic_string::_M_construct<…> basic_string.tcc:291
std::basic_string::basic_string basic_string.h:621
dpp::event_dispatch_t::event_dispatch_t dispatcher.cpp:36
dpp::log_t::event_dispatch_t dispatcher.h:202
dpp::discord_client::log discordclient.cpp:373
dpp::voiceconn::connect discordclient.cpp:628
dpp::events::voice_state_update::handle voice_state_update.cpp:97
dpp::discord_client::handle_event discordevents.cpp:433
dpp::discord_client::handle_frame discordclient.cpp:289
dpp::websocket_client::parseheader wsclient.cpp:266
dpp::websocket_client::handle_buffer wsclient.cpp:187
dpp::ssl_connection::on_read sslconnection.cpp:387
operator() sslconnection.cpp:618
std::__invoke_impl<…>(std::__invoke_other, struct {...} &) invoke.h:63
std::__invoke_r<…>(struct {...} &) invoke.h:113
std::_Function_handler::_M_invoke(const std::_Any_data &, int &&, const dpp::socket_events &) std_function.h:295
std::function::operator() std_function.h:581
dpp::socket_engine_epoll::process_events epoll.cpp:126
operator() cluster.cpp:298
dpp::cluster::start cluster.cpp:450
main main.cpp:43
<unknown> 0x00007ffff4427741
__libc_start_main 0x00007ffff4427879
_start 0x0000555555559365

Here is the whole logfile:
logs.log

And here's the source code that generated this whole thing:
main.cpp

Metadata

Metadata

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