You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

188 lines
11 KiB

=== PKT Normalizer + ETCP Test ===
Testing with 100 packets of random sizes (10-2000 bytes)
Total data to transfer: 99424 bytes (0.97 KB average per packet)
Creating server...
[CONFIG DEBUG] Opening config file: /tmp/utun_test_bE4dFl/server.conf
[CONFIG DEBUG] Successfully opened config file
[CONFIG DEBUG] Checking config - priv_key='67b705a92b41bcaae105af2d6a17743faa7b26ccebba8b3b9b0af05e9cd1d5fb' (len=64), pub_key='1c55e4ccae7c4470707759086738b10681bf88b81f198cc2ab54a647d1556e17c65e6b1833e0c771e5a39382c03067c388915a4c732191bc130480f20f8e00b9' (len=128), node_id=1229782938247303441
[CONFIG DEBUG] Validation results - need_priv_key=0, need_pub_key=0, need_node_id=0
[CONFIG DEBUG] Opening config file: /tmp/utun_test_bE4dFl/server.conf
[CONFIG DEBUG] Successfully opened config file
Server created, waiting for connection...
Creating client...
[CONFIG DEBUG] Opening config file: /tmp/utun_test_bE4dFl/client.conf
[CONFIG DEBUG] Successfully opened config file
[CONFIG DEBUG] Checking config - priv_key='4813d31d28b7e9829247f488c6be7672f2bdf61b2508333128e386d1759afed2' (len=64), pub_key='c594f33c91f3a2222795c2c110c527bf214ad1009197ce14556cb13df3c461b3c373bed8f205a8dd1fc0c364f90bf471d7c6f5db49564c33e4235d268569ac71' (len=128), node_id=2459565876494606882
[CONFIG DEBUG] Validation results - need_priv_key=0, need_pub_key=0, need_node_id=0
[CONFIG DEBUG] Opening config file: /tmp/utun_test_bE4dFl/client.conf
[CONFIG DEBUG] Successfully opened config file
Client created
Sending 100 packets in each direction via normalizer...
Connection check: client=1, server=1
Connections: client=0x556f3c579290, server=0x556f3c5be2d0
DEBUG: client_pn=(nil), client_instance->connections=0x556f3c579290
Creating client normalizer...
Client normalizer created (frag_size=1400)
DEBUG: server_pn=(nil), server_instance->connections=0x556f3c5be2d0
Creating server normalizer...
Server normalizer created (frag_size=1400)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=0/100
Starting forward transfer (client -> server) via normalizer...
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
DEBUG send_packets_fwd: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250, packets_sent_fwd=100/100
DEBUG send_packets_fwd: early return (instance=0x556f3c575420, pn=0x556f3c5bd250, sent=100)
Forward transfer completed: 100/100 packets in 22.27 ms
Starting backward transfer (server -> client) via normalizer...
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
DEBUG check_received_packets_back: client_instance=0x556f3c575420, client_pn=0x556f3c5bd250
Backward transfer completed: 100/100 packets in 22.23 ms
=== SUCCESS: Bidirectional transfer via normalizer completed! ===
Forward (client->server): 100/100 packets in 22.27 ms
Backward (server->client): 100/100 packets in 22.23 ms
Total time: 45.57 ms
Cleaning up...
🔍 [UTUN_INSTANCE LEAK DIAGNOSIS] Phase: BEFORE_CLEANUP
Instance: 0x556f3c570c90
Node ID: 1229782938247303441
UA instance: 0x556f3c570490
Running: 0
📊 STRUCTURE COUNTS:
ETCP Sockets: 1 active
ETCP Connections: 1 active
ETCP Links: 2 total
🔧 RESOURCE STATUS:
Memory Pool: ALLOCATED
TUN Interface: NULL
TUN FD: -1
Connections list: 0x556f3c5be2d0
ETCP Sockets list: 0x556f3c572330
⚠️ POTENTIAL LEAKS:
❌ Memory Pool not freed
❌ 1 ETCP sockets still allocated
❌ 1 ETCP connections still allocated
❌ 2 ETCP links still allocated
📋 RECOMMENDATIONS:
→ Call memory_pool_destroy() before freeing instance
→ Iterate and call etcp_socket_remove() for each socket
→ Iterate and call etcp_connection_close() for each connection
🔍 [UTUN_INSTANCE LEAK DIAGNOSIS] Phase: BEFORE_CLEANUP
Instance: 0x556f3c575420
Node ID: 2459565876494606882
UA instance: 0x556f3c570490
Running: 0
📊 STRUCTURE COUNTS:
ETCP Sockets: 1 active
ETCP Connections: 1 active
ETCP Links: 2 total
🔧 RESOURCE STATUS:
Memory Pool: ALLOCATED
TUN Interface: NULL
TUN FD: -1
Connections list: 0x556f3c579290
ETCP Sockets list: 0x556f3c5767d0
⚠️ POTENTIAL LEAKS:
❌ Memory Pool not freed
❌ 1 ETCP sockets still allocated
❌ 1 ETCP connections still allocated
❌ 2 ETCP links still allocated
📋 RECOMMENDATIONS:
→ Call memory_pool_destroy() before freeing instance
→ Iterate and call etcp_socket_remove() for each socket
→ Iterate and call etcp_connection_close() for each connection
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x556f3c570490
Timer Statistics: allocated=298, freed=279, active=19
Socket Statistics: allocated=2, freed=2, active=0
Timer: node=0x556f3c5bd0c0, expires=1771113950671 ms, cancelled=0
Timer: node=0x556f3c5db0d0, expires=1771113950674 ms, cancelled=0
Timer: node=0x556f3c5bd940, expires=1771113950676 ms, cancelled=0
Timer: node=0x556f3c5bd4a0, expires=1771113950686 ms, cancelled=0
Timer: node=0x556f3c5c86c0, expires=1771113950681 ms, cancelled=0
Timer: node=0x556f3c5cb900, expires=1771113950691 ms, cancelled=0
Timer: node=0x556f3c5d9e20, expires=1771113950678 ms, cancelled=0
Timer: node=0x556f3c5be240, expires=1771113950703 ms, cancelled=0
Timer: node=0x556f3c5d4290, expires=1771113950709 ms, cancelled=0
Timer: node=0x556f3c5e0f30, expires=1771113950711 ms, cancelled=0
Timer: node=0x556f3c5cb9d0, expires=1771113950683 ms, cancelled=0
Timer: node=0x556f3c5e4960, expires=1771113950694 ms, cancelled=0
Timer: node=0x556f3c5d42c0, expires=1771113950697 ms, cancelled=0
Timer: node=0x556f3c5bcd60, expires=1771113950688 ms, cancelled=0
Timer: node=0x556f3c5e3df0, expires=1771113950700 ms, cancelled=0
Timer: node=0x556f3c5dd320, expires=1771113950705 ms, cancelled=0
Timer: node=0x556f3c5ccc70, expires=1771113950707 ms, cancelled=0
Timer: node=0x556f3c5cd0e0, expires=1771113950713 ms, cancelled=0
Active timers in heap: 18
Socket array capacity: 16, active: 0
Total active sockets: 0
🔚 BEFORE_DESTROY: End of resource report
[03:05:50-616.114] [ERROR] [32] (u_async.c:1007) uasync_destroy() Memory leaks detected before cleanup: timers 298/279, sockets 2/2
[03:05:50-616.169] [ERROR] [1024] (u_async.c:1009) uasync_destroy() Timer leak: allocated=298, freed=279, diff=19
[03:05:50-616.176] [ERROR] [1024] (u_async.c:1012) uasync_destroy() Socket leak: allocated=2, freed=2, diff=0
=== TEST PASSED ===
All 100 packets transmitted in each direction via normalizer