Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apitrace and RenderDoc cause a failure during initialization. #979

Open
mcourteaux opened this issue Jan 30, 2025 · 0 comments
Open

apitrace and RenderDoc cause a failure during initialization. #979

mcourteaux opened this issue Jan 30, 2025 · 0 comments

Comments

@mcourteaux
Copy link
Contributor

mcourteaux commented Jan 30, 2025

I tried both RenderDoc and apitrace, and they both yield the same behavior:

moodycamel::ConsumerToken token( GetQueue() );
int left = Events;
while( left != 0 )
{
const auto sz = GetQueue().try_dequeue_bulk_single( token, [](const uint64_t&){}, [](QueueItem* item, size_t sz){} );
assert( sz > 0 );
left -= (int)sz;
}
assert( GetQueue().size_approx() == 0 );

Asserts on the sz being 0. Simple steps to reproduce (on Unix-like systems):

  1. Download apitrace binary and extract with tar xvf
  2. Compile some application that uses Tracy in Debug mode.
  3. ./apitrace trace --api gl --debug <some-app-using-tracy>
  4. GDB starts (thanks to the --debug flag), enter run.
  5. You are now in the assert(sz > 0).

I observed that not a single event got popped from the queue:

(gdb) f 5
#5  0x0000000000d4514f in tracy::Profiler::CalibrateDelay (this=0x1dde740 <tracy::s_profiler>) at /home/martijn/zec/3rd/tracy/public/client/TracyProfiler.cpp:3846
3846	       assert( sz > 0 );
(gdb) p sz
$1 = 0
(gdb) l
3841	   moodycamel::ConsumerToken token( GetQueue() );
3842	   int left = Events;
3843	   while( left != 0 )
3844	   {
3845	       const auto sz = GetQueue().try_dequeue_bulk_single( token, [](const uint64_t&){}, [](QueueItem* item, size_t sz){} );
3846	       assert( sz > 0 );
3847	       left -= (int)sz;
3848	   }
3849	   assert( GetQueue().size_approx() == 0 );
3850	#endif
(gdb) p Events
$2 = 100000
(gdb) p left
$3 = 100000
(gdb) p token
$4 = {initialOffset = 0, lastKnownGlobalOffset = 4294967295, itemsConsumedFromCurrent = 0, currentProducer = 0x0, desiredProducer = 0x0}
(gdb) p s_queue
$5 = {static BLOCK_SIZE = 65536, static EXPLICIT_BLOCK_EMPTY_COUNTER_THRESHOLD = 32, static EXPLICIT_INITIAL_INDEX_SIZE = 32, producerListTail = std::atomic<tracy::moodycamel::ConcurrentQueue<tracy::QueueItem, tracy::moodycamel::ConcurrentQueueDefaultTraits>::ProducerBase *> = { 0x0 }, producerCount = std::atomic<unsigned int> = { 0 }, initialBlockPoolIndex = std::atomic<unsigned long> = { 1 }, 
  initialBlockPool = 0x7ffff6010080, initialBlockPoolSize = 4, freeList = {freeListHead = std::atomic<tracy::moodycamel::ConcurrentQueue<tracy::QueueItem, tracy::moodycamel::ConcurrentQueueDefaultTraits>::Block *> = { 0x0 }, static REFS_MASK = 2147483647, static SHOULD_BE_ON_FREELIST = 2147483648}, nextExplicitConsumerId = std::atomic<unsigned int> = { 1 }, 
  globalExplicitConsumerOffset = std::atomic<unsigned int> = { 0 }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant