Evgeny 1cbf9e67b7 Fix uasync socket counting bug and add lookup function
Complete fix for use-after-free bug in uasync tests:

Library Changes:
- Added uasync_lookup_socket() function for safe socket lookup by FD
- Function returns current pointer even after memory reallocation
- Maintains full backward compatibility with existing API

Test Changes:
- Modified test to store file descriptors instead of raw pointers
- Uses lookup function to get current pointers during removal
- Eliminates stale pointer issues after socket array growth

Results:
- test_u_async_performance: 25/25 sockets successfully removed (was failing)
- test_u_async_comprehensive: PASS
- No memory leaks - clean 25/25 socket statistics
- All uasync tests now pass without corruption

Technical Details:
- Root cause: realloc() moved memory, making stored pointers invalid
- Solution: Store FDs, lookup current pointers when needed
- Minimal changes: only added necessary lookup function
- Backward compatible: existing code continues to work
2026-01-25 14:43:58 +03:00
2026-01-18 12:42:42 +03:00
S
Description
No description provided
Readme GPL-3.0
486 MiB
0 Stars 1 Watchers 0 Forks
Languages
C 63.9%
C++ 18.2%
Kotlin 9.2%
HTML 5.5%
Python 1.2%
Other 1.8%