Skip to content

chore: update mieru version#2403

Merged
wwqgtxx merged 2 commits intoMetaCubeX:Alphafrom
enfein:mieru
Dec 1, 2025
Merged

chore: update mieru version#2403
wwqgtxx merged 2 commits intoMetaCubeX:Alphafrom
enfein:mieru

Conversation

@enfein
Copy link

@enfein enfein commented Nov 30, 2025

Changes from the previous release:

  • [outbound] DNSResolver is now a mandatory field in client config if you want to resolve proxy server domain name. Resolution happens when the underlay connection is created.
  • [inbound] Connection returned from Accept() is guaranteed to have user name information associated with it.

@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Nov 30, 2025

I found some issues at enfein/mieru@deee7cb:

apicommon.ResolveTCPAddr and apicommon.ResolveUDPAddr are not passing the ctx, which causes some unexpected blocking.

For NewStreamUnderlay, the domain name must now be resolved through the resolver; it cannot be done directly inside the dialer (our dialer can handle domain names and has special concurrent connection handling for domain names).

Could we consider passing the domain name directly to the dialer when the TCP underlying layer doesn't provide a resolver, or providing a special passthrough resolver to handle this behavior?

@enfein
Copy link
Author

enfein commented Nov 30, 2025

We can add two more fields to the ClientConfig

{
  DialerDNSPassthrough bool
  PacketDialerDNSPassthrough bool
}

When they are enabled, DNSResolver is not used. Proxy server address is directly passed to Dialer and PacketDialer.

@wwqgtxx wwqgtxx merged commit a001b1b into MetaCubeX:Alpha Dec 1, 2025
@enfein enfein deleted the mieru branch December 1, 2025 00:42
@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Dec 21, 2025

After we add go1.26rc1 to test, we found mieru inbound test frequently failed on windows:

https://github.com/MetaCubeX/mihomo/actions/runs/20403417598/job/58630963138#step:8:835

=== NAME  TestInboundMieru/UDP_HANDSHAKE_NO_WAIT/Sequential
    common_test.go:210: 
        	Error Trace:	D:/a/mihomo/mihomo/listener/inbound/common_test.go:210
        	            				D:/a/mihomo/mihomo/listener/inbound/common_test.go:232
        	Error:      	Received unexpected error:
        	            	Get "https://1.2.3.4/inbound_test?size=65536": io: read/write on closed pipe
        	Test:       	TestInboundMieru/UDP_HANDSHAKE_NO_WAIT/Sequential

https://github.com/MetaCubeX/mihomo/actions/runs/20403417598/job/58629191794#step:8:837

=== NAME  TestInboundMieru/UDP_HANDSHAKE_NO_WAIT/Sequential
    common_test.go:222: 
        	Error Trace:	D:/a/mihomo/mihomo/listener/inbound/common_test.go:222
        	            				D:/a/mihomo/mihomo/listener/inbound/common_test.go:232
        	Error:      	Received unexpected error:
        	            	unexpected EOF
        	Test:       	TestInboundMieru/UDP_HANDSHAKE_NO_WAIT/Sequential

https://github.com/MetaCubeX/mihomo/actions/runs/20396854396/job/58614005546#step:7:928

=== NAME  TestInboundMieru/UDP_HANDSHAKE_NO_WAIT/Sequential
    common_test.go:210: 
        	Error Trace:	D:/a/mihomo/mihomo/listener/inbound/common_test.go:210
        	            				D:/a/mihomo/mihomo/listener/inbound/common_test.go:231
        	Error:      	Received unexpected error:
        	            	Get "http://1.2.3.4/inbound_test?size=65536": EOF
        	Test:       	TestInboundMieru/UDP_HANDSHAKE_NO_WAIT/Sequential

https://github.com/MetaCubeX/mihomo/actions/runs/20396854396/job/58613579605#step:8:838

=== NAME  TestInboundMieru/TCP_HANDSHAKE_NO_WAIT/Sequential
    common_test.go:225: 
        	Error Trace:	D:/a/mihomo/mihomo/listener/inbound/common_test.go:225
        	            				D:/a/mihomo/mihomo/listener/inbound/common_test.go:231
        	Error:      	Not equal: 
Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1113,3 +1113,3 @@
        	            	  00004570  7f 6d 1f b8 b0 25 eb cf  0e 36 b9 8d 62 77 24 8b  |.m...%...6..bw$.|
        	            	- 00004580  41 68 3b 96 1e 22 3d 6b  9d 86 20 86 56 1a bd 42  |Ah;.."=k.. .V..B|
        	            	+ 00004580  41 68 3b 96 1e 22 3d 6b  9d 1c 00 00 00 1a bd 42  |Ah;.."=k.......B|
        	            	  00004590  95 19 d0 e5 77 57 dd 63  10 6b 9f 17 00 01 ed 34  |....wW.c.k.....4|
        	Test:       	TestInboundMieru/TCP_HANDSHAKE_NO_WAIT/Sequential

There may still be undiscovered race issues in the existing code.

@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Dec 21, 2025

The latest test also captured a crash:

https://github.com/MetaCubeX/mihomo/actions/runs/20403417598/job/58630027679#step:8:827

=== RUN   TestInboundMieru/UDP_HANDSHAKE_STANDARD/Sequential
Exception 0xc0000005 0x8 0x1c06bfc6c0 0x1c06bfc6c0
PC=0x1c06bfc6c0

runtime: g 26 gp=0x1675fccc52c0: unknown pc 0x1c06bfc6c0
stack: frame={sp:0x1675fd08f560, fp:0x0} stack=[0x1675fd08c000,0x1675fd090000)
                   7 6 5 4  3 2 1 0   f e d c  b a 9 8  0123456789abcdef
00001675fd08f460: 00000001 00020000  50629f94 f0c16b47  ........Gk....bP
00001675fd08f470: 00000000 5bdf314c  00000011 00000012  L1.[............
00001675fd08f480: 00000000 00000030  00000000 00000030  0.......0.......
00001675fd08f490: 00000000 00004000  00000000 00000001  .@..............
00001675fd08f4a0: 00000000 00000000  00000000 00000010  ................
00001675fd08f4b0: 00000000 00008000  00000000 00000000  ................
00001675fd08f4c0: 00001675 fcfcc420  00001675 fd192000   ...u.... ..u...
00001675fd08f4d0: 00001675 fd02eb20  00000000 00000000   ...u...........
00001675fd08f4e0: 00000000 00000000  00001675 fcf377a0  .........w..u...
00001675fd08f4f0: 00000000 00000000  00001675 fcf376c0  .........v..u...
00001675fd08f500: 00000000 00000000  00001675 fcf4d560  ........`...u...
00001675fd08f510: 00000000 00000000  00001675 fd08f558  ........X...u...
00001675fd08f520: 00007ff6 06bfd2f9  00000000 00003ffb  .........?......
                  ^ <github.com/enfein/mieru/v3/pkg/protocol.(*Session).isState+0x99>
00001675fd08f530: 00000000 00004000  000000e6 dabff7a8  .@..............
00001675fd08f540: 00000000 00000030  00001675 fd08f558  0.......X...u...
00001675fd08f550: 00007ff6 06bfc68b  00001675 fd08f6a8  ............u...
                  ^ <github.com/enfein/mieru/v3/pkg/protocol.(*Session).Write.func1+0x2b>
00001675fd08f560: 00007ff6 06bfc5d4  00001675 fd02e960  ........`...u...
                  ^ SP
                  ^ <github.com/enfein/mieru/v3/pkg/protocol.(*Session).Write+0x8d4>
00001675fd08f570: 00001675 fd192000  00000000 00000030  . ..u...0.......
00001675fd08f580: 00000000 00004000  00001675 fcca3ac0  .@.......:..u...
00001675fd08f590: 00001675 fd192000  00007ff6 063b68ba  . ..u....h;.....
                                     ^ <runtime.getitab+0x5a>
00001675fd08f5a0: 00001675 0008f600  00000000 00000030  ....u...0.......
00001675fd08f5b0: 00000000 00000030  00000000 00000030  0.......0.......
00001675fd08f5c0: 00000000 00004000  00007ff6 067b0cf1  .@........{.....
                                     ^ <github.com/metacubex/tls.(*xorNonceAEAD).Seal+0xd1>
00001675fd08f5d0: 00001675 fd192005  00000000 00000000  . ..u...........
00001675fd08f5e0: 00000000 00000000  00007ff6 06bfc660  ........`.......
                                     ^ <github.com/enfein/mieru/v3/pkg/protocol.(*Session).Write.func1+0x0>
00001675fd08f5f0: 00001675 fd02e960  00000000 00004000  `...u....@......
00001675fd08f600: 00001675 fcf40900  0000001c 06bfc6c0  ....u...........
00001675fd08f610: 00001675 fd02eb18  00001675 fd192000  ....u.... ..u...
00001675fd08f620: 00001675 fd0262c0  00000000 0000000c  .b..u...........
00001675fd08f630: 00000000 0000000c  00001675 fd08f7f0  ............u...
00001675fd08f640: 00007ff6 067b6b64  00001675 fd192005  dk{...... ..u...
                  ^ <github.com/metacubex/tls.(*halfConn).encrypt+0x744>
00001675fd08f650: 00000000 0000001b  00000000 00003ffb  .........?......
runtime: g 26 gp=0x1675fccc52c0: unknown pc 0x1c06bfc6c0
stack: frame={sp:0x1675fd08f560, fp:0x0} stack=[0x1675fd08c000,0x1675fd090000)
                   7 6 5 4  3 2 1 0   f e d c  b a 9 8  0123456789abcdef
00001675fd08f460: 00000001 00020000  50629f94 f0c16b47  ........Gk....bP
00001675fd08f470: 00000000 5bdf314c  00000011 00000012  L1.[............
00001675fd08f480: 00000000 00000030  00000000 00000030  0.......0.......
00001675fd08f490: 00000000 00004000  00000000 00000001  .@..............
00001675fd08f4a0: 00000000 00000000  00000000 00000010  ................
00001675fd08f4b0: 00000000 00008000  00000000 00000000  ................
00001675fd08f4c0: 00001675 fcfcc420  00001675 fd192000   ...u.... ..u...
00001675fd08f4d0: 00001675 fd02eb20  00000000 00000000   ...u...........
00001675fd08f4e0: 00000000 00000000  00001675 fcf377a0  .........w..u...
00001675fd08f4f0: 00000000 00000000  00001675 fcf376c0  .........v..u...
00001675fd08f500: 00000000 00000000  00001675 fcf4d560  ........`...u...
00001675fd08f510: 00000000 00000000  00001675 fd08f558  ........X...u...
00001675fd08f520: 00007ff6 06bfd2f9  00000000 00003ffb  .........?......
                  ^ <github.com/enfein/mieru/v3/pkg/protocol.(*Session).isState+0x99>
00001675fd08f530: 00000000 00004000  000000e6 dabff7a8  .@..............
00001675fd08f540: 00000000 00000030  00001675 fd08f558  0.......X...u...
00001675fd08f550: 00007ff6 06bfc68b  00001675 fd08f6a8  ............u...
                  ^ <github.com/enfein/mieru/v3/pkg/protocol.(*Session).Write.func1+0x2b>
00001675fd08f560: 00007ff6 06bfc5d4  00001675 fd02e960  ........`...u...
                  ^ SP
                  ^ <github.com/enfein/mieru/v3/pkg/protocol.(*Session).Write+0x8d4>
00001675fd08f570: 00001675 fd192000  00000000 00000030  . ..u...0.......
00001675fd08f580: 00000000 00004000  00001675 fcca3ac0  .@.......:..u...
00001675fd08f590: 00001675 fd192000  00007ff6 063b68ba  . ..u....h;.....
                                     ^ <runtime.getitab+0x5a>
00001675fd08f5a0: 00001675 0008f600  00000000 00000030  ....u...0.......
00001675fd08f5b0: 00000000 00000030  00000000 00000030  0.......0.......
00001675fd08f5c0: 00000000 00004000  00007ff6 067b0cf1  .@........{.....
                                     ^ <github.com/metacubex/tls.(*xorNonceAEAD).Seal+0xd1>
00001675fd08f5d0: 00001675 fd192005  00000000 00000000  . ..u...........
00001675fd08f5e0: 00000000 00000000  00007ff6 06bfc660  ........`.......
                                     ^ <github.com/enfein/mieru/v3/pkg/protocol.(*Session).Write.func1+0x0>
00001675fd08f5f0: 00001675 fd02e960  00000000 00004000  `...u....@......
00001675fd08f600: 00001675 fcf40900  0000001c 06bfc6c0  ....u...........
00001675fd08f610: 00001675 fd02eb18  00001675 fd192000  ....u.... ..u...
00001675fd08f620: 00001675 fd0262c0  00000000 0000000c  .b..u...........
00001675fd08f630: 00000000 0000000c  00001675 fd08f7f0  ............u...
00001675fd08f640: 00007ff6 067b6b64  00001675 fd192005  dk{...... ..u...
                  ^ <github.com/metacubex/tls.(*halfConn).encrypt+0x744>
00001675fd08f650: 00000000 0000001b  00000000 00003ffb  .........?......
created by testing.(*T).Run in goroutine 50
	C:/hostedtoolcache/windows/go/1.26.0-rc.1/x64/src/testing/testing.go:2101 +0x4be

@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Dec 23, 2025

I tested this commit: enfein/mieru@26af2fc, and it did not solve the problem.

@enfein
Copy link
Author

enfein commented Jan 1, 2026

From the runtime stack, there is some problems with (*Session).isState. However that function is too trivial to panic :(

Are those issues only seen in go1.26? How often do you see that?

@wwqgtxx
Copy link
Collaborator

wwqgtxx commented Jan 1, 2026

In fact, due to the excessively frequent failures in version 1.26, we have already disabled the mieru inbound test in version 1.26, so we don't know if there are any more cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants