arkworks-rs / arkworks-rs/std

Infinite dot when some spawned thread crash which make indent more than 75

Open
#46 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
42
Forks
45
PR merge metrics
No merged PRs in 30d

Description

## Summary of Bug

I find an issue in my program.
I am trying to spawn thread to run some tasks and the tasks call start_timer and then panic before end_timer. It is normal in my program so I just handle the panic error from thread and try to do other tasks in new spawn threads.
After panic happens some times, my program hang at busy print dot infinitely.

image

## Version

## Steps to Reproduce

I cannot stable reproduce it but after reviewing the code, I think it is very probably because of the overflow issue when global static INDENT_NUM exceed some number and makes this indent_amount exceed 75 and cause the issue.
https://docs.rs/ark-std/latest/src/ark_std/perf_trace.rs.html#125

After each panic of my spawn thread, I can see more and more dots before Start: and End: logging in my programe and finally if it exceed 75 and the next time when I call a end_timer will trigger the infinitely printing of dot.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the perf_trace.rs code at the linked source location, focusing on how start_timer and end_timer update the global INDENT_NUM after a spawned thread panics. Reproduce the panic-and-respawn sequence if possible and verify that indentation remains bounded and end_timer no longer causes infinite dot output.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.