wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
8.67k stars 598 forks source link

Tracy reliably segfaults trying to load this trace #705

Closed SUPERCILEX closed 6 months ago

SUPERCILEX commented 6 months ago

Trace: https://drive.google.com/file/d/1mqMPONX_dyCTHe8b5QUomTAwiev_KffW/view?usp=drive_link&resourcekey=0-KU2tQUnHSfmIfnZKGQ7Dqg

wolfpld commented 6 months ago

Can you say how you have created this trace?

SUPERCILEX commented 6 months ago

Using a dev version of https://github.com/nagisa/rust_tracy_client. I'm fairly convinced at this point that it's a race, memory corruption issue, or a mix of both on the tracy end. Here you can see a screenshot a reduced trace which shows the same zone sometimes working and sometimes not:

Screenshot from 2023-12-29 14-28-35

Do you want full repro instructions? If so, let me know and I'll update this issue once the changes on the rust side have settled down a bit.

wolfpld commented 6 months ago

There are 3,033,576 source locations in the trace, which is way over the limit of 64K allowed ones (32K in practice, as these are split in half for static and dynamic ones).

I have added checks for this during capture (586c6bf166fd51cc93341ea91469a40c7ad96739) and when loading traces (762582357b8c3ee7b04c9dcb512e94fc2aaabc05).

Note that there's deduplication of dynamic source locations, so you shouldn't be getting that many unique ones:

https://github.com/wolfpld/tracy/blob/762582357b8c3ee7b04c9dcb512e94fc2aaabc05/server/TracyWorker.cpp#L3698-L3759

See also #546.

SUPERCILEX commented 6 months ago

Oh sweet, then no this is resolved. :)

They're all unique because function parameters are included in the srcloc name. We're adding an option to move away from that because it's not the desired behavior for my program anyway: https://github.com/nagisa/rust_tracy_client/pull/87