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

[ELWIC] iNfInItY CoMpLeX - 2nd Init Fails #332

Closed dlightman311 closed 3 years ago

dlightman311 commented 3 years ago

Module Information

Describe the bug Initial install/init of iNfInItY CoMpLeX is successful but fails after a shutdown during init with:

2020-12-18 22:16:28.6699 Warn MBBSEmu.Btrieve.BtrieveFileProcessor.Insert modules\ELWIC\ELWICLIB.DB: Failed to insert record because SQLite Error 19: 'UNIQUE constraint failed: data_t.key_0'. Critical Exception has occurred: System.SystemException: Failed to insert database record at MBBSEmu.HostProcess.ExportedModules.Majorbbs.insbtv() 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(IntPtr16 entryPoint, UInt16 channelNumber, Boolean simulateCallFar, Boolean bypassState, Queue1 initialStackValues, UInt16 initialStackPointer) at MBBSEmu.Module.MbbsModule.Execute(IntPtr16 entryPoint, UInt16 channelNumber, Boolean simulateCallFar, Boolean bypassSetState, Queue1 initialStackValues, UInt16 initialStackPointer) at MBBSEmu.HostProcess.MbbsHost.AddModule(MbbsModule module) at MBBSEmu.HostProcess.MbbsHost.Start(List`1 moduleConfigurations) at MBBSEmu.Program.Run(String[] args)

To Reproduce Steps to reproduce the behavior:

  1. Install ELWIC
  2. Load MBBSEmu
  3. Shutdown MBBSEmu
  4. Load MBBSEmu
  5. See error

Software Information:

paladine commented 3 years ago

I think this is related to a printf bug with format strings. The module uses ITEM%3.3d as a format string, which MBBS currently evaluates to ITEM 10 for example. However when I run the same print statement with borland, it outputs ITEM010. So it seems Borland is 0 padding with integers instead of space padding