Repro project for a bug in Anvil that throws System.IndexOutOfRangeException from VirtualMachine.cs::ExecuteInScriptContext after having reloaded services that contain subscriptions to events that are also subscribed to from nss.
These are the steps to reproduce the bug:
- Build and run
dotnet build -c Debug
./run-commands.sh # to start the interactive menu- Use option 5 to pack the module
- Use option 1 to start the container
- Use option 7 to tail the server logs
- Log in and sell something to the merchant. This should work fine.
- Trigger a reload of dotnet, e.g. by starting a watcher in a separate terminal and saving a file
dotnet watch --project NWN.ProcessEventInfiniteLoopRepro/Repro.csproj build -c Debug- Watch Anvil reload plugins.
- Try to sell something again.
- Observe the process crash.
Use nasher to manage the sources.
A utility script named ./run-commands.sh has been added to speed up running frequent commands, inlcuding a useful watch-utility to hot compile scripts on file save (option 2).
docker(withcompose)nasherdotnetentr(to hot compile nss)