IsoRTS icon indicating copy to clipboard operation
IsoRTS copied to clipboard

Crash after changing to vectors from lists in actors.cpp

Open Ruckamongus opened this issue 5 years ago • 2 comments

In actors.cpp line 1603 I'm getting crashes when selecting troops and having them do things. I'm trying to determine how to replicate this easily. For reference, this is line 1603:

void actors::doNextStackedCommand()
{
    if (!this->listOfOrders.empty()) {
        switch (this->listOfOrders.front().orderType) { //crash here, maybe front is invalid?
...
}

Ruckamongus avatar Aug 22 '21 20:08 Ruckamongus

I am having a really hard time trying to reproduce a crash.

It does a pop_front() after setting the task active a push_back() when a task is added and a clear() when a non-stacked command is issued. That are all the operations done on that list. And should not cause .front() to get invalid. An invalid orderType should probably just fall through that switch without causing an exception.

Was it a particular type of order move, attack, gather or build that caused the exception?

What type of exception was it?

switchboy avatar Aug 23 '21 15:08 switchboy

This was related to remnants of the multi threading. It was caused by data races. It is now fixed.

switchboy avatar Aug 30 '21 15:08 switchboy