From 916bcaf2d1b8e9b01d15d05803fb141f1efb7e22 Mon Sep 17 00:00:00 2001 From: Garfield Date: Tue, 24 Mar 2026 13:36:56 -0400 Subject: [PATCH] Document MT5 freeze analysis and solutions --- SESSION_SAVE_2026-03-22.md | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/SESSION_SAVE_2026-03-22.md b/SESSION_SAVE_2026-03-22.md index 724344f..b176f6d 100644 --- a/SESSION_SAVE_2026-03-22.md +++ b/SESSION_SAVE_2026-03-22.md @@ -247,3 +247,50 @@ This will: | `IsOptimization()` | `MQLInfoInteger(MQL_OPTIMIZATION)` | **Commit:** `c415cd9` + +--- + +## MT5 Freeze Analysis & Solutions +**Date:** March 24, 2026 + +### Why Did It Freeze? + +**Root Cause:** OrdersEA.mq5 was an **MT4 file disguised as MT5** + +| Issue | Details | +|-------|---------| +| File Type | MT4 syntax with .mq5 extension | +| Syntax Errors | 100 errors detected by MetaEditor | +| Problem Functions | OrderSelect(), MarketInfo(), Bid, Digits, Point | +| Trigger | MetaEditor hung while processing errors | +| Wine Factor | Windows apps in Wine are less stable with errors | + +### What Happened: +1. MetaEditor tried to compile OrdersEA.mq5 +2. Found 100 MT4-specific syntax errors +3. Got stuck in error processing loop +4. VNC session froze (MetaEditor was active window) +5. Required container restart to clear + +### Solutions Implemented: + +**1. Syntax Checker** (`check-syntax.sh`) +```bash +./check-syntax.sh OrdersEA.mq5 +# Detects MT4 functions before compilation +``` + +**2. Watchdog** (`metaeditor-watchdog.sh`) +- Auto-kills MetaEditor if running >5 minutes +- Kills if CPU >50% for extended period + +**3. Safe Compile** (`safe-compile.sh`) +- 2-minute timeout on compilations +- Auto-kills on timeout +- Prevents indefinite hangs + +### Prevention Tips: +1. Always check syntax before compiling unknown files +2. Use MT4→MT5 conversion tools for old code +3. Watch for MetaEditor freezes during compilation +4. Restart container if VNC becomes unresponsive