tracy icon indicating copy to clipboard operation
tracy copied to clipboard

Crash in DrawZoneTrace

Open TrianglesPCT opened this issue 1 year ago • 5 comments

This is with latest version on github 0.8.4 compiled with vs2019

Running Windows 10, app was running without Admin privileges.

I had been using Tracy alot before this happened, so the crash is not a regular thing.

Ran the game for a only maybe 30 seconds, closed it. Was viewing the result in Tracy when I clicked on one of the zones and it crashed here.

     Tracy.exe!tracy::DrawZoneTrace<tracy::ZoneEvent const *>(const tracy::ZoneEvent * zone, const std::vector<tracy::ZoneEvent   const      *,std::allocator<tracy::ZoneEvent const *>> & trace, const tracy::Worker & worker, tracy::BuzzAnim<void const *> & anim, tracy::View &  view, bool & showUnknownFrames, std::function<void __cdecl(tracy::ZoneEvent const *,int &)> showZone) Line 238	C++
Tracy.exe!tracy::View::DrawZoneInfoWindow() Line 978	C++

[Inline Frame] Tracy.exe!tracy::View::DrawInfoWindow() Line 280	C++

Tracy.exe!tracy::View::DrawImpl() Line 975	C++

Tracy.exe!tracy::View::Draw() Line 584	C++

Tracy.exe!DrawContents() Line 738	C++

[Inline Frame] Tracy.exe!std::_Func_class<void>::operator()() Line 968	C++

[Inline Frame] Tracy.exe!Backend::Run() Line 113	C++

Tracy.exe!main(int argc, char * * argv) Line 247	C++

Because: Unhandled exception thrown: read access violation. cs was 0xFFFFFFFFFFFFFFFF.

This is the line:

 auto& cs = worker.GetCallstack( lcv );
 const auto csz = cs.size();

Locals mostly not visible but here is what It showed:

`

Document
  Name Value Type
  $L0 Variable is optimized away and not available.  
  $L0 Variable is optimized away and not available.  
anim {active=false time=0.00000000 id=0x0000000000000000 } tracy::BuzzAnim<void const *> &
  ccv Variable is optimized away and not available.  
cs {m_size=??? m_hash=??? m_ptr={m_ptr=0x0000ffff01000005 <Error reading characters of string.> } } const tracy::VarArraytracy::CallstackFrameId &
  csz Variable is optimized away and not available.  
  curr Variable is optimized away and not available.  
  currCs Variable is optimized away and not available.  
  expand Variable is optimized away and not available.  
  fidx 1 int
  fileName Variable is optimized away and not available.  
  fileName Variable is optimized away and not available.  
  frame Variable is optimized away and not available.  
  frame Variable is optimized away and not available.  
  frameData Variable is optimized away and not available.  
  frameData Variable is optimized away and not available.  
  frameName Variable is optimized away and not available.  
  frameName Variable is optimized away and not available.  
  i 2691135205680 unsigned __int64
  idx Variable is optimized away and not available.  
last 0x00000272a7e39a5f {_start_srcloc=60897853308931 _child2=54 _end_child1=1623668574322688 ...} const tracy::ZoneEvent *
  lcv 3276800 const unsigned int
  normalized Variable is optimized away and not available.  
  normalized Variable is optimized away and not available.  
  pcv Variable is optimized away and not available.  
  pf Variable is optimized away and not available.  
  prev Variable is optimized away and not available.  
prevCs {m_size=0 m_hash=0 m_ptr={m_ptr=0x000000d88e8fdc7f "" } } const tracy::VarArraytracy::CallstackFrameId &
  shortenName 114 'r' tracy::ShortenName
  showUnknownFrames true bool &
showZone {idx=0 __this=0x00000272a1735dd0 {m_showRanges=false m_statRange={min=0 max=0 active=false ...} m_waitStackRange=...} } std::function<void __cdecl(tracy::ZoneEvent const *,int &)>
  sz 2691358231216 const unsigned __int64
  time 12.0000000 const float
  time Variable is optimized away and not available.  
trace { size=0 } const std::vector<tracy::ZoneEvent const *,std::allocator<tracy::ZoneEvent const *>> &
view {m_showRanges=false m_statRange={min=0 max=0 active=false ...} m_waitStackRange={min=0 max=0 active=...} ...} tracy::View &
worker {m_sock={m_buf=0x00000272a1a80020 "˜\x5" m_bufPtr=0x00000272a1a805bc "\xf5º‚\x1dË\x2# ê\x18\x6/Ð7U\x5\x17&^{Ó\x4AÀŒ0\n?\x17\x1f A" ...} ...} const tracy::Worker &
  zone Variable is optimized away and not available.  
`

TrianglesPCT avatar Aug 22 '22 15:08 TrianglesPCT

This is with latest version on github 0.8.4 compiled with vs2019

This is not actionable without an exact revision.

wolfpld avatar Aug 22 '22 17:08 wolfpld

Should be 49bda91 as I had just downloaded it compiled it fresh earlier today.

TrianglesPCT avatar Aug 22 '22 18:08 TrianglesPCT

I have made a brief look at this and there's nothing obvious which would cause such behavior. The GetCallstack( lcv ) access should be only performed on indices that have corresponding callstack data stored. The lvc value of 3276800 is certainly interesting, 0x320000. Buffer overrun?

wolfpld avatar Aug 23 '22 17:08 wolfpld

Could the client shutting down before something is sent cause this?

It looks like lcv is the index into where the callstack for that zone entry is stored, perhaps it hadn't arrived when I shutdown?

Oh well probably not enough info here, want me to close this?

TrianglesPCT avatar Aug 24 '22 14:08 TrianglesPCT

This is what I have specifically checked for. There does not seem to be a code path where an index is created with no backing data.

wolfpld avatar Aug 24 '22 14:08 wolfpld