Getting Overflow error when creating a thread

444_Nuits
Fri, 05 Apr 2024 09:20:18 +0000
C++

Hiii,

In my Character’s Blueprint, I added an event to when I press the v Key it calls this startImitation function :

void UMyCaptureComponent::startImitation()
{
	start();
}

//My Capture Comp inherits from RingBufferConsummer:

void RingBufferConsumer::start()
{
  UE_LOG(LogTemp, Warning, TEXT("RingBufferConsumer::start"));
  _doRead = true;
  _readThread = FRunnableThread::Create(new RingBufferConsumerWorker(this), TEXT("RingBufferConsumerThread"), 0U, TPri_Highest);
}

//here's the Run() Function of my thread, it's a function of my worker class inheriting from FRunnable and _instance is a pointer to my RingBufferConsummer class:

virtual uint32 Run() override {
  int32 sizeRed = 0;
  uint64 readPosition = 0;

  while (_instance->_doRead) {
    if (_instance->_ringBuffer->waitToBeginRead(_instance->_sizeToRead, readPosition)) {
      sizeRed = _instance->processData(readPosition);
      if (_instance->_doRead == false) {
        break;
      }
      if (sizeRed < 0)
        continue;
      _instance->_ringBuffer->endRead(sizeRed);
    }
  }

  return 0;
}


//For now, my processdata() function just sets _doRead to false :
int64 UMyCaptureComponent::processData(uint64 readPosition)
{
	UE_LOG(LogTemp, Warning, TEXT("processData"));
	_doRead = false;
  return 0;
}

I have no Idea of why I’m getting this error I know that it is thrown when he call stack of a thread exceeds its reserved stack space and that it s can happen if there is deep recursion or if the program allocates too much stack space for local variables, function calls, or nested structures
But I don’t see any of that here

3 posts - 2 participants