You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stack overflow happens if there is external function call in match. But when running, program doesn't even get to the match statement and does not output "command name" debug before crashing.
Replacing return cmd::reply(command_context, ctx).await with return Ok(()) fixes crash.
Seems like instrument macro breaks code flow.
What i tried:
multiple rustc versions, from 1.81
previous versions of tracing and tracing-subscriber
multiple previous versions of tokio
It didn't help. I replaced tracing with fastrace + logforth + logcalls crates (they provide similiar features and macros) and there was no this issue too.
I ran cargo expand with and without instrument macro on problematic method macro: expand_bad.rs.txt expand_ok.rs.txt
(look for handle_update, message_handler, cmd::reply calls)
The text was updated successfully, but these errors were encountered:
MrFoxPro
changed the title
Using instrument macro causes Infinite recursioninstrument macro causes Infinite recursion
Feb 4, 2025
.exec uses reqwest + multipart inside, there is issue with it
I'm using local dependency in Cargo.toml which contains large auto-generated .rs file, maybe it is somehow related to generics expansion for a large number of types and/or incorrect dependency resolution
Bug Report
Version
0.1.41, also tried 0.1.3*
Platform
Linux 6.12 x64, rust nightly
Description
I used tracing with macros in multiple pretty big projects sucessfully, but didn't encounter such problem.
I spent few hours looking for cause and found that this happens because of annotating one of methods with
insturment
macro.But something really weird is going on.
I have very simple logic
stack overflow happens if there is external function call in
match
. But when running, program doesn't even get to thematch
statement and does not output "command name" debug before crashing.Replacing
return cmd::reply(command_context, ctx).await
withreturn Ok(())
fixes crash.Seems like instrument macro breaks code flow.
What i tried:
It didn't help. I replaced
tracing
withfastrace
+logforth
+logcalls
crates (they provide similiar features and macros) and there was no this issue too.I ran
cargo expand
with and withoutinstrument
macro on problematic method macro:expand_bad.rs.txt
expand_ok.rs.txt
(look for
handle_update
,message_handler
,cmd::reply
calls)The text was updated successfully, but these errors were encountered: