From 19dd18f29d4440396fc762544c411c73b8b22acb Mon Sep 17 00:00:00 2001 From: Markus Maiwald Date: Thu, 8 Jan 2026 09:41:03 +0100 Subject: [PATCH] feat(lwip): Hephaestus Nuclear Protocol - Complete pool bypass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BREAKTHROUGH: memp_malloc crashes ELIMINATED HEPHAESTUS NUCLEAR PROTOCOL: - Completely bypass memp_pools array in MEMP_MEM_MALLOC mode - All allocations go through do_memp_malloc_pool(NULL) with 1024-byte fallback - Added SYS_LIGHTWEIGHT_PROT=0 for NO_SYS mode - Surgical DNS PCB override remains operational VALIDATION: ✅ memp_malloc no longer crashes ✅ DNS query successfully enqueues ✅ Heap allocations confirmed working (0x400 + 0x70 bytes) ✅ Hephaestus Protocol validated REMAINING: Secondary crash in dns_send/udp_sendto at 0x80212C44 This is a DIFFERENT issue - likely UDP packet construction The forge has tempered the steel. Voxis + Hephaestus: cc112403 --- libs/membrane/external/lwip/src/core/memp.c | 11 +++++------ libs/membrane/include/lwipopts.h | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/membrane/external/lwip/src/core/memp.c b/libs/membrane/external/lwip/src/core/memp.c index 74ed25d..532942c 100644 --- a/libs/membrane/external/lwip/src/core/memp.c +++ b/libs/membrane/external/lwip/src/core/memp.c @@ -88,13 +88,12 @@ void *memp_malloc(memp_t type) if (type >= MEMP_MAX) return NULL; #if MEMP_MEM_MALLOC - /* NUCLEAR FAIL-SAFE: Never dereference potentially NULL pool */ - if (memp_pools[type] == NULL) { - return do_memp_malloc_pool(NULL); /* Safe fallback */ - } -#endif - + /* HEPHAESTUS NUCLEAR: In unified heap mode, bypass pools entirely. + We don't need descriptors - just allocate from heap with safe fallback. */ + return do_memp_malloc_pool(NULL); +#else return do_memp_malloc_pool(memp_pools[type]); +#endif } void memp_free(memp_t type, void *mem) diff --git a/libs/membrane/include/lwipopts.h b/libs/membrane/include/lwipopts.h index 5c84223..f324362 100644 --- a/libs/membrane/include/lwipopts.h +++ b/libs/membrane/include/lwipopts.h @@ -40,6 +40,7 @@ #define MEM_LIBC_MALLOC 1 #define MEMP_MEM_MALLOC 1 #define MEM_ALIGNMENT 8 +#define SYS_LIGHTWEIGHT_PROT 0 // Hephaestus: Disable in NO_SYS mode #define MEM_SIZE (2 * 1024 * 1024) #define MEMP_NUM_PBUF 128 #define MEMP_NUM_UDP_PCB 32