#1285

SegFault in Tracy v0.13.1

Openloryrutaopened 8mo ago

Hello, I'm using Tracy v0.13.1 on Ubuntu 24.04 and using OpenCL as well. I'm getting a segfault here:

// tracy_rpmalloc.cpp:2079
static void*
free_list_pop(void** list) {
	void* block = *list;
	*list = *((void**)block); // <= SEGFAULT's here
	return block;
}

Originating from the TextFmt function TracyScoped.hpp:142, from (my) call:

ZoneScoped;
ZoneTextF("%ld * %s", num_elems, typeid(Ty).name()); // <=

If I comment the latter line, I get a SEGFAULT at:

template<typename T>
tracy_force_inline void MemWrite( void* ptr, T val )
{
    memcpy( ptr, &val, sizeof( T ) ); // <= SEGFAULT here
}

Originating from TracyQueuePrepare( QueueType::ZoneEnd ); in ~ScopedZone.

I have no knowledge of the Tracy codebase, could anyone enlighten me what could have gone wrong? The error appears after a while and doesn't look to be OpenCL -related

Activity

3
Garana4008mo ago

Well I cannot see the rest of your code so I cannot really help. But, *list = *((void**)block); causing a seg fault means that the "next" element is null (you reached the end of ur list)

Garana4008mo ago

This function basically, pops the first element of the list and returns it

loryruta8mo ago

I cannot see the rest of your code

It's confidential and is still WIP. If the error persists and I can't figure out I will setup a minimal example and share it here.

But, list = ((void)block); causing a seg fault means that the "next" element is null (you reached the end of ur list)

What list could be involved in a ZoneTextF("%ld * %s", num_elems, typeid(Ty).name());? e.g. what's the purpose/why am I reaching the end?