xjasonlyu / tun2socks

tun2socks - powered by gVisor TCP/IP stack
https://github.com/xjasonlyu/tun2socks/wiki
GNU General Public License v3.0
3.14k stars 433 forks source link

unexpected fault address 0xffffffffffffffff #75

Closed solaristhesun closed 2 years ago

solaristhesun commented 2 years ago

Question What am I doing wrong?

Environment

Log

E:\tun2socks>tun2socks-windows-amd64.exe -device tun://wintun0 -proxy http://127.0.0.1:8080
unexpected fault address 0xffffffffffffffff
fatal error: fault
[signal 0xc0000005 code=0x0 addr=0xffffffffffffffff pc=0xc4927d]

goroutine 1 [running, locked to thread]:
runtime.throw({0xe74fef, 0x400})
        runtime/panic.go:1198 +0x76 fp=0xc0001253e8 sp=0xc0001253b8 pc=0xab63d6
runtime.sigpanic()
        runtime/signal_windows.go:260 +0x10c fp=0xc000125430 sp=0xc0001253e8 pc=0xac92cc
golang.org/x/sys/windows.UTF16PtrToString(0x32)
        golang.org/x/sys@v0.0.0-20211003122950-b1ebd4e1001c/windows/syscall_windows.go:132 +0x1d fp=0xc000125478 sp=0xc000125430 pc=0xc4927d
golang.zx2c4.com/wireguard/tun/wintun.setupLogger.func1(0x2030000, 0x20)
        golang.zx2c4.com/wireguard@v0.0.0-20210927201915-bb745b2ea326/tun/wintun/wintun_windows.go:53 +0x1c fp=0xc0001254c0 sp=0xc000125478 pc=0xda31bc
runtime.call16(0x0, 0xe97da0, 0xc000125548, 0x0, 0x0, 0x10, 0xc0001257a0)
        runtime/asm_amd64.s:625 +0x50 fp=0xc0001254e0 sp=0xc0001254c0 pc=0xae16b0
runtime.callbackWrap(0xd5a21fed20)
        runtime/syscall_windows.go:378 +0x134 fp=0xc0001258c0 sp=0xc0001254e0 pc=0xad1494
runtime.cgocallbackg1(0xad1360, 0x119e3c0, 0x0)
        runtime/cgocall.go:306 +0x29a fp=0xc000125990 sp=0xc0001258c0 pc=0xa8433a
runtime.cgocallbackg(0xc00005a000, 0x300000002, 0xc00005a000)
        runtime/cgocall.go:232 +0x106 fp=0xc000125a28 sp=0xc000125990 pc=0xa83fc6
runtime.cgocallbackg(0xad1360, 0xd5a21fed20, 0x0)
        <autogenerated>:1 +0x36 fp=0xc000125a50 sp=0xc000125a28 pc=0xae5476
runtime.cgocallback(0xa83e4c, 0xae4d80, 0x119e6a0)
        runtime/asm_amd64.s:915 +0xd7 fp=0xc000125a78 sp=0xc000125a50 pc=0xae32b7
runtime.systemstack_switch()
        runtime/asm_amd64.s:350 fp=0xc000125a80 sp=0xc000125a78 pc=0xae1160
runtime.cgocall(0xae4d80, 0x119e6a0)
        runtime/cgocall.go:166 +0xac fp=0xc000125ab8 sp=0xc000125a80 pc=0xa83e4c
syscall.Syscall(0x7ffe59dd3a80, 0x2, 0xc000192000, 0xc000024cb0, 0x0)
        runtime/syscall_windows.go:479 +0xf4 fp=0xc000125af0 sp=0xc000125ab8 pc=0xadfd74
syscall.Syscall(0xc000155ce0, 0x24df804aaf3, 0xc0000240e6, 0x0, 0xf04f00)
        <autogenerated>:1 +0x2b fp=0xc000125b40 sp=0xc000125af0 pc=0xae5c6b
golang.zx2c4.com/wireguard/tun/wintun.(*Pool).OpenAdapter(0xc000192000, {0xc0000240e6, 0x24dd2d90108})
        golang.zx2c4.com/wireguard@v0.0.0-20210927201915-bb745b2ea326/tun/wintun/wintun_windows.go:89 +0xbc fp=0xc000125bb8 sp=0xc000125b40 pc=0xda2cbc
golang.zx2c4.com/wireguard/tun.CreateTUNWithRequestedGUID({0xc0000240e6, 0x7}, 0xd, 0x0)
        golang.zx2c4.com/wireguard@v0.0.0-20210927201915-bb745b2ea326/tun/tun_windows.go:75 +0x4d fp=0xc000125c30 sp=0xc000125bb8 pc=0xda3aed
golang.zx2c4.com/wireguard/tun.CreateTUN(...)
        golang.zx2c4.com/wireguard@v0.0.0-20210927201915-bb745b2ea326/tun/tun_windows.go:63
github.com/xjasonlyu/tun2socks/core/device/tun.Open({0xc000125ce8, 0x2, 0xe74668})
        github.com/xjasonlyu/tun2socks/core/device/tun/tun_wireguard.go:34 +0x8a fp=0xc000125c90 sp=0xc000125c30 pc=0xda4e6a
github.com/xjasonlyu/tun2socks/engine.parseDevice({0xc0000240e0, 0xd}, 0x0)
        github.com/xjasonlyu/tun2socks/engine/parse.go:30 +0x1c5 fp=0xc000125d40 sp=0xc000125c90 pc=0xda6b05
github.com/xjasonlyu/tun2socks/engine.(*engine).setDevice(0x119d740)
        github.com/xjasonlyu/tun2socks/engine/engine.go:151 +0x3a fp=0xc000125d68 sp=0xc000125d40 pc=0xda659a
github.com/xjasonlyu/tun2socks/engine.(*engine).setDevice-fm()
        github.com/xjasonlyu/tun2socks/engine/engine.go:146 +0x26 fp=0xc000125d80 sp=0xc000125d68 pc=0xda7d06
github.com/xjasonlyu/tun2socks/engine.(*engine).start(0x0)
        github.com/xjasonlyu/tun2socks/engine/engine.go:74 +0x218 fp=0xc000125e68 sp=0xc000125d80 pc=0xda60b8
github.com/xjasonlyu/tun2socks/engine.Start()
        github.com/xjasonlyu/tun2socks/engine/engine.go:20 +0x25 fp=0xc000125e80 sp=0xc000125e68 pc=0xda5e25
main.main.func1({0xe77eef, 0xc}, 0x24dd2d90108)
        github.com/xjasonlyu/tun2socks/main.go:33 +0x2a fp=0xc000125ef0 sp=0xc000125e80 pc=0xda85ea
main.main()
        github.com/xjasonlyu/tun2socks/main.go:38 +0x7d fp=0xc000125f80 sp=0xc000125ef0 pc=0xda843d
runtime.main()
        runtime/proc.go:255 +0x217 fp=0xc000125fe0 sp=0xc000125f80 pc=0xab8997
runtime.goexit()
        runtime/asm_amd64.s:1581 +0x1 fp=0xc000125fe8 sp=0xc000125fe0 pc=0xae34e1

goroutine 6 [chan receive]:
github.com/xjasonlyu/tun2socks/common/observable.(*Observable).process(0xc0000664a0)
        github.com/xjasonlyu/tun2socks/common/observable/observable.go:18 +0x50
created by github.com/xjasonlyu/tun2socks/common/observable.NewObservable
        github.com/xjasonlyu/tun2socks/common/observable/observable.go:65 +0xbb

goroutine 7 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel/statistic.(*Manager).handle(0xc000072240)
        github.com/xjasonlyu/tun2socks/tunnel/statistic/manager.go:83 +0x93
created by github.com/xjasonlyu/tun2socks/tunnel/statistic.init.0
        github.com/xjasonlyu/tun2socks/tunnel/statistic/manager.go:22 +0x185

goroutine 8 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:52 +0xb4
created by github.com/xjasonlyu/tun2socks/tunnel.init.0
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:24 +0x25

goroutine 18 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 19 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 20 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 21 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 22 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 23 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 24 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 25 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 26 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 27 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 28 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 29 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 30 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 31 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 32 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

goroutine 33 [chan receive]:
github.com/xjasonlyu/tun2socks/tunnel.process.func1()
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:46 +0x49
created by github.com/xjasonlyu/tun2socks/tunnel.process
        github.com/xjasonlyu/tun2socks/tunnel/tunnel.go:45 +0x26

E:\tun2socks>
xjasonlyu commented 2 years ago

Hi, what's your wintun version?

jm33-m0 commented 2 years ago

wintun 0.14.1, I am having this issue as well

xjasonlyu commented 2 years ago

wintun 0.14.1, I am having this issue as well

I see, could you try previous wintun version to see if issue still exists?

solaristhesun commented 2 years ago

I cannot find older version on the wintun website. Also it works for me when I run the go code from vscode.

xjasonlyu commented 2 years ago

@solaristhesun what do mean when you run the go code?

solaristhesun commented 2 years ago

@solaristhesun what do mean when you run the go code?

I am not very familiar with go, but i managed to run the uncompiled go scripts in vscode and there is no error. Initially I tried to run the precompiled exe files which I would prefer but does not work for me.

xjasonlyu commented 2 years ago

Oh, because the code you ran is from the latest branch, and the dependencies have been updated. This issue has already been solved but not been released to pre-compiled binaries yet.

You may compile the code yourself by now or wait till the next releases.

solaristhesun commented 2 years ago

Understood. Thanks for your help!

xjasonlyu commented 2 years ago

Hi, have a try of the latest release.

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days