hmgle / graftcp

A flexible tool for redirecting a given program's TCP traffic to SOCKS5 or HTTP proxy.
GNU General Public License v3.0
2.1k stars 173 forks source link

not work for windows subsystem for linux(WSL) #18

Closed zyp001a closed 5 years ago

zyp001a commented 5 years ago

Not run on windows subsystem linux:

./graftcp go get -v golang.org/x/net/proxy runtime/cgo: pthread_create failed: Function not implemented SIGABRT: abort PC=0x7f210d61ee97 m=0 sigcode=18446744073709551610

goroutine 0 [idle]: runtime: unknown pc 0x7f210d61ee97 stack: frame={sp:0x7fffef5e3720, fp:0x0} stack=[0x7fffeede4cd0,0x7fffef5e3d00) 00007fffef5e3620: 00007fffef5e3b30 00000000016692a0 00007fffef5e3630: 00000000000000f1 0000000000000011 00007fffef5e3640: 0000000000000000 00007f210dc0fec3 00007fffef5e3650: 0000000000000001 0000000000000000 00007fffef5e3660: 2525252525252525 2525252525252525 00007fffef5e3670: 0000000000000000 0000000000000000 00007fffef5e3680: 0000000000000000 0000000000000000 00007fffef5e3690: 414fffffe0000000 0000000000000000 00007fffef5e36a0: 7261632e2f70797a 2f3a6e69622f6f67 00007fffef5e36b0: 61636f6c2f727375 2f3a6e6962732f6c 00007fffef5e36c0: 61636f6c2f727375 752f3a6e69622f6c 00007fffef5e36d0: 3a6e6962732f7273 6e69622f7273752f 00007fffef5e36e0: 6574616572635f64 3a64656c69616620 00007fffef5e36f0: 0000000000000000 0000000000000000 00007fffef5e3700: 6c61636f6c2f7273 752f3a6e6962732f 00007fffef5e3710: 6c61636f6c2f7273 73752f3a6e69622f 00007fffef5e3720: <0000000000000000 3a6e69622f727375 00007fffef5e3730: 622f3a6e6962732f 2f7273752f3a6e69 00007fffef5e3740: 752f3a73656d6167 6c61636f6c2f7273 00007fffef5e3750: 2f3a73656d61672f 6e69622f70616e73 00007fffef5e3760: 0000000000000000 0000000000000000 00007fffef5e3770: 00007f210d9cc560 00007f210d9cfbc0 00007fffef5e3780: bfe62e42fefa39ef 0000000000000000 00007fffef5e3790: 414fffffe0000000 0000000000000000 00007fffef5e37a0: fffffffe7fffffff ffffffffffffffff 00007fffef5e37b0: ffffffffffffffff ffffffffffffffff 00007fffef5e37c0: ffffffffffffffff ffffffffffffffff 00007fffef5e37d0: ffffffffffffffff ffffffffffffffff 00007fffef5e37e0: ffffffffffffffff ffffffffffffffff 00007fffef5e37f0: ffffffffffffffff ffffffffffffffff 00007fffef5e3800: ffffffffffffffff ffffffffffffffff 00007fffef5e3810: ffffffffffffffff ffffffffffffffff runtime: unknown pc 0x7f210d61ee97 stack: frame={sp:0x7fffef5e3720, fp:0x0} stack=[0x7fffeede4cd0,0x7fffef5e3d00) 00007fffef5e3620: 00007fffef5e3b30 00000000016692a0 00007fffef5e3630: 00000000000000f1 0000000000000011 00007fffef5e3640: 0000000000000000 00007f210dc0fec3 00007fffef5e3650: 0000000000000001 0000000000000000 00007fffef5e3660: 2525252525252525 2525252525252525 00007fffef5e3670: 0000000000000000 0000000000000000 00007fffef5e3680: 0000000000000000 0000000000000000 00007fffef5e3690: 414fffffe0000000 0000000000000000 00007fffef5e36a0: 7261632e2f70797a 2f3a6e69622f6f67 00007fffef5e36b0: 61636f6c2f727375 2f3a6e6962732f6c 00007fffef5e36c0: 61636f6c2f727375 752f3a6e69622f6c 00007fffef5e36d0: 3a6e6962732f7273 6e69622f7273752f 00007fffef5e36e0: 6574616572635f64 3a64656c69616620 00007fffef5e36f0: 0000000000000000 0000000000000000 00007fffef5e3700: 6c61636f6c2f7273 752f3a6e6962732f 00007fffef5e3710: 6c61636f6c2f7273 73752f3a6e69622f 00007fffef5e3720: <0000000000000000 3a6e69622f727375 00007fffef5e3730: 622f3a6e6962732f 2f7273752f3a6e69 00007fffef5e3740: 752f3a73656d6167 6c61636f6c2f7273 00007fffef5e3750: 2f3a73656d61672f 6e69622f70616e73 00007fffef5e3760: 0000000000000000 0000000000000000 00007fffef5e3770: 00007f210d9cc560 00007f210d9cfbc0 00007fffef5e3780: bfe62e42fefa39ef 0000000000000000 00007fffef5e3790: 414fffffe0000000 0000000000000000 00007fffef5e37a0: fffffffe7fffffff ffffffffffffffff 00007fffef5e37b0: ffffffffffffffff ffffffffffffffff 00007fffef5e37c0: ffffffffffffffff ffffffffffffffff 00007fffef5e37d0: ffffffffffffffff ffffffffffffffff 00007fffef5e37e0: ffffffffffffffff ffffffffffffffff 00007fffef5e37f0: ffffffffffffffff ffffffffffffffff 00007fffef5e3800: ffffffffffffffff ffffffffffffffff 00007fffef5e3810: ffffffffffffffff ffffffffffffffff

goroutine 1 [running]: runtime.systemstack_switch() /usr/lib/go-1.10/src/runtime/asm_amd64.s:363 fp=0xc420042788 sp=0xc420042780 pc=0x4547f0 runtime.main() /usr/lib/go-1.10/src/runtime/proc.go:128 +0x63 fp=0xc4200427e0 sp=0xc420042788 pc=0x42c8a3 runtime.goexit() /usr/lib/go-1.10/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc4200427e8 sp=0xc4200427e0 pc=0x457361

rax 0x0 rbx 0x7f210d9cc840 rcx 0x8 rdx 0x0 rdi 0x2 rsi 0x7fffef5e3720 rbp 0x914c5a rsp 0x7fffef5e3720 r8 0x0 r9 0x7fffef5e3720 r10 0x8 r11 0x8 r12 0x16692a0 r13 0xf1 r14 0x11 r15 0x0 rip 0x7f210d61ee97 rflags 0x246 cs 0x33 fs 0x53 gs 0x2b

hmgle commented 5 years ago

Thank you for the feedback.

graftcp depends on the correct implementation of ptrace(2), I'm not sure if WSL's ptrace(2) is mature, but for the issue from WSL (https://github.com/Microsoft/WSL/issues/3978), there are some problems with ptrace(2) on WSL that need to be fixed, so there is no guarantee that graftcp will run correctly on WSL now.

I don't have a WSL environment for testing for the moment, I will keep an eye on this issue.

hmgle commented 5 years ago

WSL 2 is available now. In WSL 2, the Linux kernel compatibility layer has been replaced by the real Linux kernel. So now if you use WSL 2, you’ll be using the real Linux kernel.