mbbsemu / MBBSEmu

The MajorBBS Emulation Project is an Open Source, Cross-Platform emulator for easily running The MajorBBS & Worldgroup Modules
https://www.mbbsemu.com
MIT License
128 stars 14 forks source link

[MBBSEMU] MBBSEMU - Crashes on cleanup #450

Closed TQPS closed 3 years ago

TQPS commented 3 years ago

Module Information

Describe the bug The program crashes during cleanup. See logs below.

To Reproduce Steps to reproduce the behavior:

  1. Start Server
  2. Perform cleanup / or wait for one

Expected behavior Cleanup used to complete.

Note: This is the first time I have been able to wait for a cleanup due to CCDDR causing a crash due to disk space consumption during cleanup.

Screenshots

Eventlog #1:

 Application: MBBSEmu.exe CoreCLR Version: 5.0.421.11614 .NET Version: 5.0.4 Description: The process was terminated due to an unhandled exception. Exception Info: System.Exception: Invalid String at 1000:FFF8 at MBBSEmu.Memory.AbstractMemoryCore.GetString(UInt16 segment, UInt16 offset, Boolean stripNull) at MBBSEmu.HostProcess.ExportedModules.ExportedModuleBase.FormatPrintf(ReadOnlySpan`1 stringToParse, UInt16 startingParameterOrdinal, Boolean isVsPrintf) at MBBSEmu.HostProcess.ExportedModules.Majorbbs.sprintf() at MBBSEmu.HostProcess.ExportedModules.Majorbbs.Invoke(UInt16 ordinal, Boolean offsetsOnly) at MBBSEmu.HostProcess.ExecutionUnits.ExecutionUnit.ExternalFunctionDelegate(UInt16 ordinal, UInt16 functionOrdinal) at MBBSEmu.CPU.CpuCore.Op_Call() at MBBSEmu.CPU.CpuCore.Tick() at MBBSEmu.HostProcess.ExecutionUnits.ExecutionUnit.Execute(FarPtr entryPoint, UInt16 channelNumber, Boolean simulateCallFar, Boolean bypassState, Queue`1 initialStackValues, UInt16 initialStackPointer) at MBBSEmu.Module.MbbsModule.Execute(FarPtr entryPoint, UInt16 channelNumber, Boolean simulateCallFar, Boolean bypassSetState, Queue`1 initialStackValues, UInt16 initialStackPointer) at MBBSEmu.HostProcess.MbbsHost.CallModuleRoutine(String routine, Action`1 preRunCallback, UInt16 channel) at MBBSEmu.HostProcess.MbbsHost.DoNightlyCleanup() at MBBSEmu.HostProcess.MbbsHost.ProcessNightlyCleanup() at MBBSEmu.HostProcess.MbbsHost.WorkerThread() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ThreadHelper.ThreadStart()  

Event Log #2:

MBBSEmu.exe 
   1.0.0.0 
   602c44d5 
   KERNELBASE.dll 
   6.1.7601.24545 
   5e0eb6bd 
   e0434352 
   000000000000b87d 
   ec8 
   01d7209eacabc9bf 
   C:\Boards\MBBSEMU\MBBSEmu.exe 
   C:\Windows\system32\KERNELBASE.dll 
   222df286-8cd3-11eb-a158-000c29c068e9 

MBBSEMU Last Audit Log Entry:

AUDIT SUMMARY: GE:INF:End Cleanup 
AUDIT DETAIL: GE:INF:End Cleanup 
2021-03-25 06:00:00.0026 Info MBBSEmu.HostProcess.MbbsHost.<DoNightlyCleanup>b__70_1 Calling nightly cleanup routine on module ELWIC
2021-03-25 06:00:00.0236 Info MBBSEmu.HostProcess.MbbsHost.<DoNightlyCleanup>b__70_1 Calling nightly cleanup routine on module NTHORDER

Software Information:

enusbaum commented 3 years ago

Confirmed this is an issue running cleanup in NTHORDER

The issue is caused by NCTIME not returning a null terminated string. I'll address this in a PR shortly 😄

enusbaum commented 3 years ago

PR in to fix this. Confirms Cleanup runs and proper values are written to the log file

ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ

--> Order and Chaos Housekeeping 04/10/21 13:45:08  <--

The `Knifes Edge' is returned to the balance.