arkworks-rs / std

A standard library wrapper for use in the `arkworks` ecosystem
https://www.arkworks.rs
Apache License 2.0
37 stars 33 forks source link

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

Open yymone opened 11 months ago

yymone commented 11 months ago
∂ ## 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.

yymone commented 11 months ago

Rerepoduced by codes: https://github.com/yymone/arkDotBug

run it by release flag: cargo run --release