frankenstein: Stack Overflow at `api.get_updates` in example `async_reply_to_message_updates.rs`

Hi! I tried running the example async_reply_to_message_updates.rs. It crashed with a stack overflow error:

thread 'main' has overflowed its stack
error: process didn't exit successfully: `target\debug\telegram-bot-test.exe` (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)

Process finished with exit code -1073741571 (0xC00000FD)

I was able to pinpoint the overflowing call in the example:

https://github.com/ayrat555/frankenstein/blob/1217d29c3b6c8f9866d0c21cbba42517e62ce52e/examples/async_reply_to_message_updates.rs#L18

Running frankenstein = { version = "0.13.0", features = ["async-http-client"] }, rustc 1.60.0 (7737e0b5c 2022-04-04), Win 10.

I will investigate further. Maybe the error is within the example, or my project setup

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 28 (23 by maintainers)

Most upvoted comments

haha didn’t find that one. So, any objections about the enum approach? @ayrat555

For memory representation this would be optimal, since the enum will only be about as large as the largest variant, which is probably the Message type. Which would probably also be refactored to contain an enum. So, in the end, memory usage should go down by a lot.

Go ahead and create some pull requests. I will happily review them 😃

no objections.

@johannesvollmer great investigation skills. good work!

Not sure if we could just use the teloxide-core create for the types in general 🤔

@EdJoPaTo I’d rather keep teloxide and Frankenstein independent.

Again, (as I’m unsure how to interpret the official telegram documentation) this will only work if all of these states never occur at the same time, otherwise an enum will not make sense obviously

The official documentation states exactly that: https://core.telegram.org/bots/api#update