OAP Lizzard A game interface engine
Game interfaces, outside the game Settings

Building Lizzard / The development journal

Project journal

Milestones, decisions, experiments, mistakes and fixes, newest first. Open an entry for what was checked, the outcome and what is still uncertain. An entry written after the day it describes says when it was written.

Journal entries

Find entries

1–2 of 2 entries for Stage 1 · Lua from C# (of 61 in the journal), newest first. Show all

event Stage 1 · Lua from C# Fix

A test host crash traced to Lua's stack

A harmless-looking commit crashed the test host with heap corruption. The real fault was older: C# pushed values onto Lua's stack without asking for room.

Read the entry: A test host crash traced to Lua's stack

After commit 33bb727 added logging of Blizzard's own consistency reports, the test host crashed and Windows reported native heap corruption. I chose to find the cause.

Lua promises a C function only 20 free stack slots and doesn't check pushes beyond them in a release build. GetChildren on a big frame, in the probe's template dump, pushed far more and overwrote the heap. The new logging had only moved memory around enough to make it fatal.

Every push now asks Lua for room first; past Lua's limit it becomes a Lua error. Two tests push 5,000 and 10,000 values. 767 tests pass with the logging still on.

Link to this entry
event Stage 1 · Lua from C# Milestone

Real Lua 5.1, built inside the Visual Studio solution

Lizzard runs real Lua 5.1.5, built from lua.org's source by a C++ project in the Visual Studio solution. The first way of building it lasted less than a day.

Read the entry: Real Lua 5.1, built inside the Visual Studio solution

The first try built Lua with a script so that the dotnet command could still build everything. But what I needed most was a solution Visual Studio itself could build, test and run, and dotnet can't build C++ projects. So Lua became an ordinary C++ project in the solution.

Lua raises errors with longjmp, which must never jump over .NET's code, so a small C layer sits between Lua and the C# functions it calls.

I had to ask twice for Start Debugging to open the live window. Visual Studio keeps the start-up project per user, outside the solution file, so Claude set it through Visual Studio's automation and checked it by starting the debugger.

Link to this entry