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
132 stars 14 forks source link

[LOGBM] BladeMaster - Exception on Nightly Maintenance #211

Closed cschoppy closed 3 years ago

cschoppy commented 3 years ago

Module Information LOGBM

Describe the bug Exception generated on Nightly Maintenance

To Reproduce Occurs on each maintenance run.

Expected behavior Nightly maintenance completes successfully.

2020-10-19 03:01:16.6653 Info MBBSEmu.HostProcess.MbbsHost.<DoNightlyCleanup>b__55_1 Calling nightly cleanup routine on module LOGBM
Unhandled exception. System.IO.FileNotFoundException: Attempted to rename file that doesn't exist: LOGBMTBL.LOG
   at MBBSEmu.HostProcess.ExportedModules.Majorbbs.rename()
   at MBBSEmu.HostProcess.ExportedModules.Majorbbs.Invoke(UInt16 ordinal, Boolean offsetsOnly)
   at MBBSEmu.HostProcess.ExecutionUnits.ExecutionUnit.ExternalFunctionDelegate(UInt16 ordinal, UInt16 functionOrdinal)
   at MBBSEmu.HostProcess.ExecutionUnits.ExecutionUnit.Execute(IntPtr16 entryPoint, UInt16 channelNumber, Boolean simulateCallFar, Boolean bypassState, Queue`1 initialStackValues, UInt16 initialStackPointer)
   at MBBSEmu.Module.MbbsModule.Execute(IntPtr16 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 where exception was thrown ---
   at System.Threading.ThreadHelper.ThreadStart()
enusbaum commented 3 years ago

Probably need to make the rename ordinal a little more resilient and return -1 if the operation fails

http://www.cplusplus.com/reference/cstdio/rename/