the Sim Settlements forums!

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Question Possible bug: deadlock with RelinkWorkshopActors / GetWorkshopActors

weefbellington

New Member
Messages
5
Summary

The WorkshopScript#RelinkWorkshopActors() script calls GoToState("RelinkingActors") on function entry and GoToState("Initialized") on exit.

RelinkWorkshopActors() calls GetWorkshopActors() in its function block. In the "RelinkingActors" state, the GetWorkshopActors() function waits continuously for the state to change before proceeding. I suspect that this is causing a deadlock. RelinkWorkshopActors() will not change the state from to "RelinkingActors -> "Initialized" until GetWorkshopActors() returns, but GetWorkshopActors() is waiting forever for this to happen.

If verified, this bug could have pretty nasty implications -- it appears to be blocking the DailyUpdate() fuction.

Details

Source code:

GetWorkshopActors function
RelinkWorkshopActors function

The RelinkWorkshopActors function is triggered by the "Relink Local Settlers" option in the WSFW tools menu: papyrus fragment.

I started looking into this problem when I noticed that happiness was stuck at 50% at some settlements. There is a previous thread on this issue, opened by another user. My symptoms were the same: FallrimTools shows a large number of active scripts calling DailyUpdate() and never terminating. In my case there were ~50 of these scripts.

Each of these scripts is stuck in a waiting loop. They appear to be waiting for the DailyUpdateInProgress variable to be false.

Screenshot 2023-04-24 141714.png

(source code link)

There is a single active script running TryRealDailyUpdate() that looks like it is locking these other scripts. This script sets DailyUpdateInProgress to true, and ends up locking itself by calling GetWorkshopActors(), which is also locked.

Screenshot 2023-04-24 140321.png
(source code link)

I can see the stuck GetWorkshopActors() script too:

Screenshot 2023-04-24 142858.png

I think that this could be the root cause of the "happiness stuck" bug reports that pop up every once in a while on the forums. If anybody would like to help investigate, I can share save files.

I'm familiar with CK and Papyrus so I can take a shot at fixing it, but I've never worked with the WSFW source so I was hoping I could get some eyes on it. Thanks!
 
Summary

The WorkshopScript#RelinkWorkshopActors() script calls GoToState("RelinkingActors") on function entry and GoToState("Initialized") on exit.

RelinkWorkshopActors() calls GetWorkshopActors() in its function block. In the "RelinkingActors" state, the GetWorkshopActors() function waits continuously for the state to change before proceeding. I suspect that this is causing a deadlock. RelinkWorkshopActors() will not change the state from to "RelinkingActors -> "Initialized" until GetWorkshopActors() returns, but GetWorkshopActors() is waiting forever for this to happen.

If verified, this bug could have pretty nasty implications -- it appears to be blocking the DailyUpdate() fuction.

Details

Source code:

GetWorkshopActors function
RelinkWorkshopActors function

The RelinkWorkshopActors function is triggered by the "Relink Local Settlers" option in the WSFW tools menu: papyrus fragment.

I started looking into this problem when I noticed that happiness was stuck at 50% at some settlements. There is a previous thread on this issue, opened by another user. My symptoms were the same: FallrimTools shows a large number of active scripts calling DailyUpdate() and never terminating. In my case there were ~50 of these scripts.

Each of these scripts is stuck in a waiting loop. They appear to be waiting for the DailyUpdateInProgress variable to be false.

View attachment 20310

(source code link)

There is a single active script running TryRealDailyUpdate() that looks like it is locking these other scripts. This script sets DailyUpdateInProgress to true, and ends up locking itself by calling GetWorkshopActors(), which is also locked.

View attachment 20311
(source code link)

I can see the stuck GetWorkshopActors() script too:

View attachment 20312

I think that this could be the root cause of the "happiness stuck" bug reports that pop up every once in a while on the forums. If anybody would like to help investigate, I can share save files.

I'm familiar with CK and Papyrus so I can take a shot at fixing it, but I've never worked with the WSFW source so I was hoping I could get some eyes on it. Thanks!
Made an account just to second this.

DailyUpdate becomes stuck on pretty much everything; it bleeds over to anything calling relinkactor, even on minor functions such as generating reports.

I've been battling for 3 days looking for a solution. Removing all plots and abandoning ownership is pretty much it.

Fortunately, the scripts do blow themselves out if you destroy plots, but wait too long before catching it and it's GG. You won't even be able to abandon a settlement properly at that point.

Thanks for reporting this, it's a brutal bug.
 
Top