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

[HVSXROAD] Crossroads of the Elements - crash report #625

Open brianmiller opened 1 week ago

brianmiller commented 1 week ago

Module Information

Describe the bug MBBSEmu crashes and stops listening on TCP/23 when the logs appears as shown below.

To Reproduce I don't know what the trigger is just yet.

Expected behavior Do not crash. :)

Logs

MBBSEmu logs

[2024-06-20T20:30:59.5071905+00:00] MBBSEmu.HostProcess.MbbsHost [Error] Module HVSXROAD has crashed. Disabling.
Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at MBBSEmu.HostProcess.MbbsHost.<>c__DisplayClass74_0.<DisableModule>b__0(SessionBase x)
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at MBBSEmu.HostProcess.MbbsHost.DisableModule(String moduleId, Boolean isCrashed)
   at MBBSEmu.HostProcess.MbbsHost.<.ctor>b__35_15(MbbsModule sender, String moduleId)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at MBBSEmu.Util.MessagingCenter.Subscription.InvokeCallback(Object sender, Object args)
   at MBBSEmu.Util.MessagingCenter.InnerSend(EnumMessageEvent message, Type senderType, Type argType, Object sender, Object args)
   at MBBSEmu.Util.MessagingCenter.MBBSEmu.Util.IMessagingCenter.Send[TSender,TArgs](TSender sender, EnumMessageEvent message, TArgs args)
   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.RemoveSession(UInt16 channel)
   at MBBSEmu.HostProcess.MbbsHost.WorkerThread()

Crash_HVSXROAD_20240620203059.txt

This is an MBBSEmu Module Crash Report. This report contains detailed information 
to help the MBBSEmu team diagnose and debug the issue this module ran into while 
running within the emulator. 

You can submit this report to the MBBSEmu team by opening an issue on GitHub at:
https://github.com/mbbsemu/MBBSEmu/issues

Please include the following information (copy/paste):
---------------------------------------------------------------

MBBSEmu v011424-141 Module Crash Report
Date: 06/20/2024
Time: 20:30
Operating System: Ubuntu 24.04 LTS
Processor: X64

Module Identifier: HVSXROAD
Module Path: modules/HVSXROAD/
DLL Name: HVSXROAD.DLL
DLL Size: 202392
DLL Hash: CCC3BB25

Exception: Specified argument was out of the range of valid values.
Stack Trace: 
   at MBBSEmu.Memory.ProtectedModeMemoryCore.VirtualToPhysical(UInt16 segment, UInt16 offset)
   at MBBSEmu.Memory.AbstractMemoryCore.GetByte(UInt16 segment, UInt16 offset)
   at MBBSEmu.CPU.CpuCore.GetOperandValueUInt8(OpKind opKind, EnumOperandType operandType)
   at MBBSEmu.CPU.CpuCore.Op_Cmp()
   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)

CPU Instruction: 
cmp byte ptr es:[bx],0A5h

CPU Registers:
AX=0777  BX=1000  CX=0000  DX=1000  DS=0011  ES=0777 
SI=FFEE  DI=0000  SS=0000  IP=0D25  SP=FFE2  BP=FFEA 
F=czso

Module Memory Stack:
-------------------------------------------------------------------------
65536 bytes, 0xFFEA -> 0xFFF2
-------------------------------------------------------------------------
       00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
FFE0 [ F8 FF 5A 26 02 00 ] øÿZ&  
FFF0 [ 21 00

Software Information:

enusbaum commented 1 week ago

This PR will fix the MBBSEmu log error you reported with the null exception while generating the crash report: https://github.com/mbbsemu/MBBSEmu/pull/624

The other error looks interesting. We'll see if we can recreate it!

brianmiller commented 5 days ago

We just crashed again, but this time LORD. It could be the same condition relating to channel exhaustion maybe? All 32 channels were full when it crashed.

Unhandled exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at MBBSEmu.HostProcess.MbbsHost.<>c__DisplayClass74_0.<DisableModule>b__0(SessionBase x)
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at MBBSEmu.HostProcess.MbbsHost.DisableModule(String moduleId, Boolean isCrashed)
   at MBBSEmu.HostProcess.MbbsHost.<.ctor>b__35_15(MbbsModule sender, String moduleId)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   --- End of inner exception stack trace ---
   at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
   at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at MBBSEmu.Util.MessagingCenter.Subscription.InvokeCallback(Object sender, Object args)
   at MBBSEmu.Util.MessagingCenter.InnerSend(EnumMessageEvent message, Type senderType, Type argType, Object sender, Object args)
   at MBBSEmu.Util.MessagingCenter.MBBSEmu.Util.IMessagingCenter.Send[TSender,TArgs](TSender sender, EnumMessageEvent message, TArgs args)
   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.RemoveSession(UInt16 channel)
   at MBBSEmu.HostProcess.MbbsHost.WorkerThread()
/opt/startMBBSEmu: line 1:    19 Aborted                 /opt/mbbsemu/MBBSEmu -C modules.json -S appsettings.json -CLI
[2024-06-26T01:55:51.4752345+00:00] MBBSEmu.Session.SocketSession [Warning] Session 167.61.96.190:41949 (Channel: 32) Client disconnected
[2024-06-26T01:55:56.0461234+00:00] System.Threading.ExecutionContext [Information] Accepting incoming Telnet connection from 167.61.96.190:43339...
[2024-06-26T01:55:56.0467710+00:00] System.Threading.ExecutionContext [Information] Session 167.61.96.190:43339 added to incoming queue
[2024-06-26T01:55:56.0521136+00:00]  [Information] Added Session 167.61.96.190:43339 to channel 32
[2024-06-26T01:55:56.0529442+00:00] MBBSEmu.HostProcess.MbbsHost [Information] Removing Channel: 32
[2024-06-26T01:55:56.0540170+00:00] MBBSEmu.Session.SocketSession [Warning] Session 167.61.96.190:43339 (Channel: 32) Client disconnected
[2024-06-26T01:55:56.2505347+00:00] System.Threading.ExecutionContext [Information] Accepting incoming Telnet connection from 167.61.96.190:43476...
[2024-06-26T01:55:56.2512329+00:00] System.Threading.ExecutionContext [Information] Session 167.61.96.190:43476 added to incoming queue
[2024-06-26T01:55:56.2557205+00:00]  [Information] Added Session 167.61.96.190:43476 to channel 32
[2024-06-26T01:55:56.2565227+00:00] MBBSEmu.HostProcess.MbbsHost [Information] Removing Channel: 32
[2024-06-26T01:55:56.2571612+00:00] MBBSEmu.Session.SocketSession [Warning] Session 167.61.96.190:43476 (Channel: 32) Client disconnected
[2024-06-26T01:55:57.0448736+00:00] System.Threading.ExecutionContext [Information] Accepting incoming Telnet connection from 167.61.96.190:43621...
[2024-06-26T01:55:57.0455998+00:00] System.Threading.ExecutionContext [Information] Session 167.61.96.190:43621 added to incoming queue
[2024-06-26T01:55:57.0474687+00:00]  [Information] Added Session 167.61.96.190:43621 to channel 32
[2024-06-26T01:55:57.0482512+00:00] MBBSEmu.HostProcess.MbbsHost [Information] Removing Channel: 32
[2024-06-26T01:55:57.0488833+00:00] MBBSEmu.Session.SocketSession [Warning] Session 167.61.96.190:43621 (Channel: 32) Client disconnected
[2024-06-26T01:55:57.4746814+00:00] System.Threading.ExecutionContext [Information] Accepting incoming Telnet connection from 167.61.96.190:43561...
[2024-06-26T01:55:57.4754173+00:00] System.Threading.ExecutionContext [Information] Session 167.61.96.190:43561 added to incoming queue
[2024-06-26T01:55:57.4802652+00:00]  [Information] Added Session 167.61.96.190:43561 to channel 32
[2024-06-26T01:55:57.4810138+00:00] MBBSEmu.HostProcess.MbbsHost [Information] Removing Channel: 32
[2024-06-26T01:55:57.4816350+00:00] MBBSEmu.Session.SocketSession [Warning] Session 167.61.96.190:43561 (Channel: 32) Client disconnected
[2024-06-26T01:55:57.7069955+00:00] System.Threading.ExecutionContext [Information] Accepting incoming Telnet connection from 167.61.96.190:43736...
[2024-06-26T01:55:57.7079854+00:00] System.Threading.ExecutionContext [Information] Session 167.61.96.190:43736 added to incoming queue
[2024-06-26T01:55:57.7143381+00:00]  [Information] Added Session 167.61.96.190:43736 to channel 32
[2024-06-26T01:55:57.7150611+00:00] MBBSEmu.HostProcess.MbbsHost [Information] Removing Channel: 32
[2024-06-26T01:55:57.7158076+00:00] MBBSEmu.Session.SocketSession [Warning] Session 167.61.96.190:43736 (Channel: 32) Client disconnected
[2024-06-26T01:55:58.2498815+00:00] System.Threading.ExecutionContext [Information] Accepting incoming Telnet connection from 167.61.96.190:43819...
[2024-06-26T01:55:58.2505544+00:00] System.Threading.ExecutionContext [Information] Session 167.61.96.190:43819 added to incoming queue
[2024-06-26T01:55:58.2543879+00:00]  [Information] Added Session 167.61.96.190:43819 to channel 32
[2024-06-26T01:55:58.2552044+00:00] MBBSEmu.HostProcess.MbbsHost [Information] Removing Channel: 32
[2024-06-26T01:55:58.2558399+00:00] MBBSEmu.Session.SocketSession [Warning] Session 167.61.96.190:43819 (Channel: 32) Client disconnected
[2024-06-26T01:55:58.3511228+00:00] System.Threading.ExecutionContext [Information] Accepting incoming Telnet connection from 167.61.96.190:43838...
[2024-06-26T01:55:58.3517382+00:00] System.Threading.ExecutionContext [Information] Session 167.61.96.190:43838 added to incoming queue
[2024-06-26T01:55:58.3558195+00:00]  [Information] Added Session 167.61.96.190:43838 to channel 32
[2024-06-26T01:55:58.3566190+00:00] MBBSEmu.HostProcess.MbbsHost [Information] Removing Channel: 32
[2024-06-26T01:55:58.3572323+00:00] MBBSEmu.Session.SocketSession [Warning] Session 167.61.96.190:43838 (Channel: 32) Client disconnected
[2024-06-26T01:55:59.2111163+00:00] System.Threading.ExecutionContext [Information] Accepting incoming Telnet connection from 167.61.96.190:43985...
[2024-06-26T01:55:59.2117290+00:00] System.Threading.ExecutionContext [Information] Session 167.61.96.190:43985 added to incoming queue
[2024-06-26T01:55:59.2136558+00:00] System.Threading.ExecutionContext [Information] Accepting incoming Telnet connection from 167.61.96.190:44012...
[2024-06-26T01:55:59.2139900+00:00]  [Information] Added Session 167.61.96.190:43985 to channel 32
[2024-06-26T01:55:59.2144311+00:00] System.Threading.ExecutionContext [Information] Session 167.61.96.190:44012 added to incoming queue
[2024-06-26T01:55:59.2146503+00:00]  [Information] Added Session 167.61.96.190:44012 to channel 33
[2024-06-26T01:55:59.2151577+00:00] MBBSEmu.HostProcess.MbbsHost [Information] Removing Channel: 32
[2024-06-26T01:55:59.2157392+00:00] MBBSEmu.Session.SocketSession [Warning] Session 167.61.96.190:43985 (Channel: 32) Client disconnected
[2024-06-26T01:55:59.8171999+00:00] System.Threading.ExecutionContext [Information] Accepting incoming Telnet connection from 167.61.96.190:44230...
[2024-06-26T01:55:59.8178515+00:00] System.Threading.ExecutionContext [Information] Session 167.61.96.190:44230 added to incoming queue
[2024-06-26T01:55:59.8202452+00:00]  [Information] Added Session 167.61.96.190:44230 to channel 32
[2024-06-26T01:55:59.8203533+00:00] MBBSEmu.HostProcess.MbbsHost [Information] Removing Channel: 33
[2024-06-26T01:55:59.9071297+00:00] MBBSEmu.HostProcess.MbbsHost [Error] Module RTSLORD has crashed. Disabling.