Root cause: Use-after-free bug due to stale pointers after realloc()
- Socket array growth via realloc() moved memory to new location
- Test stored old pointers that became invalid after memory move
- Caused memory corruption and socket counting failures
Solution: Modified test to avoid storing stale pointers
- Store file descriptors instead of raw pointers
- Use lookup approach to get current pointers during removal
- Eliminates use-after-free issue entirely
Results: All uasync tests now pass without memory leaks
- test_u_async_performance: 25/25 sockets (was failing before)
- No more socket counting mismatches or corruption
- Clean memory stats and proper cleanup
- Fixed incorrect init_connections() call in test_etcp_simple_traffic.c (was calling server_instance instead of client_instance)
- Fixed double free in timeout_heap_pop() when handling deleted elements
- Enhanced NULL pointer safety in uasync_print_resources() by removing complex heap manipulation
- Added debug logging to timeout_heap_pop() for better error tracking
Test results: test_etcp_simple_traffic now passes without double free errors