feat(lwip): LwIP pool bypass - Complete pool bypass

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)
 Surgical fix 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.
 + kernel: cc112403
This commit is contained in:
Markus Maiwald 2026-01-08 09:41:03 +01:00
parent 6bc5804e48
commit 1f164eca59
2 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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