dnscrypt-proxy: dnscrypt-proxy v2.0.10 crash on Alpine linux v3.7.0 x86

Hello:

Thank you for your work.

Here is the core dump from dnscrypt-proxy v2.0.10 under Alpine linux v3.7.0-(grsecurity hardened), x86.

[2018-04-25 15:00:11] [NOTICE] dnscrypt-proxy is ready - live servers: 32
unexpected fault address 0x34846000
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x2 addr=0x34846000 pc=0x16c985c2]

goroutine 64 [running]:
runtime.throw(0x16ec4ea1, 0x5)
	/usr/lib/go/src/runtime/panic.go:616 +0x77 fp=0x34405c10 sp=0x34405c04 pc=0x16b50ef7
runtime.sigpanic()
	/usr/lib/go/src/runtime/signal_unix.go:395 +0x1e4 fp=0x34405c34 sp=0x34405c10 pc=0x16b668c4
github.com/aead/chacha20/chacha.xorKeyStreamSSE2(0x34405d34, 0x40, 0x40, 0x34405d34, 0x40, 0x40, 0x34388040, 0x34388000, 0x14, 0x16c97555)
	/home/buildozer/aports/community/dnscrypt-proxy/src/dnscrypt-proxy-2.0.10/src/github.com/aead/chacha20/chacha/chacha_386.s:157 +0x162 fp=0x34405c38 sp=0x34405c34 pc=0x16c985c2
github.com/aead/chacha20/chacha.xorKeyStream(0x34405d34, 0x40, 0x40, 0x34405d34, 0x40, 0x40, 0x34388040, 0x34388000, 0x14, 0x20)
	/home/buildozer/aports/community/dnscrypt-proxy/src/dnscrypt-proxy-2.0.10/src/github.com/aead/chacha20/chacha/chacha_386.go:65 +0x8e fp=0x34405c64 sp=0x34405c38 pc=0x16c975de
github.com/aead/chacha20/chacha.(*Cipher).XORKeyStream(0x34388000, 0x34405d34, 0x40, 0x40, 0x34405d34, 0x40, 0x40)
	/home/buildozer/aports/community/dnscrypt-proxy/src/dnscrypt-proxy-2.0.10/src/github.com/aead/chacha20/chacha/chacha.go:165 +0x1b3 fp=0x34405ca0 sp=0x34405c64 pc=0x16c97233
runtime: unexpected return pc for github.com/jedisct1/xsecretbox.Seal called from 0x8f1f4b36
stack: frame={sp:0x34405ca0, fp:0x34405d90} stack=[0x34405000,0x34406000)
34405c20:  34846000  34247ce0  16b7a981 <runtime.morestack+65>  16b666e5 <runtime.sigpanic+5> 
34405c30:  16c985c2 <github.com/aead/chacha20/chacha.xorKeyStreamSSE2+354>  16c975de <github.com/aead/chacha20/chacha.xorKeyStream+142>  34405d34  00000040 
34405c40:  00000040  34405d34  00000040  00000040 
34405c50:  34388040  34388000  00000014  16c97555 <github.com/aead/chacha20/chacha.xorKeyStream+5> 
34405c60:  16c97233 <github.com/aead/chacha20/chacha.(*Cipher).XORKeyStream+435>  34405d34  00000040  00000040 
34405c70:  34405d34  00000040  00000040  34388040 
34405c80:  34388000  00000014  00000020  00000020 
34405c90:  00000000  00000000  16c97085 <github.com/aead/chacha20/chacha.(*Cipher).XORKeyStream+5>  16ca06e8 <github.com/jedisct1/xsecretbox.Seal+216> 
34405ca0: <34388000  34405d34  00000040  00000040 
34405cb0:  34405d34  00000040  00000040  34388000 
34405cc0:  00000000  00000000  16b77b60 <runtime.(*mcache).nextFree.func1+0>  24006000 
34405cd0:  16b3deb5 <runtime.gcTrigger.test+5>  16b35d64 <runtime.mallocgc+948>  00000001  00000000 
34405ce0:  00000000  00000000  00000000  01014304 
34405cf0:  00000000  00000500  00000002  3459e000 
34405d00:  172235e0  00000000  00004000  34277680 
34405d10:  24006000  00000000  00000060  342608f0 
34405d20:  343723c0  16b7cc11 <runtime.memclrNoHeapPointers+65>  16b67cf7 <runtime.growslice+519>  3459e281 
34405d30:  0000027f  799b09b3  476476e4  ad4a01ac 
34405d40:  a3add054  94aee6ed  85cd259d  949fb27a 
34405d50:  b3a691f3  6dc28ba2  982bd4a0  ad57b292 
34405d60:  767d8824  63c5ec33  e796424c  04ea8fe5 
34405d70:  4f76766f  d6e51325  255a730e  fb3dd7d5 
34405d80:  f6612be9  f82eaff2  ed85cf31 !8f1f4b36 
34405d90: >e035f845  d0ec3743  669815bf  33bcad34 
34405da0:  8cf9ac4a  e82a4ccf  0313d34d  2b227014 
34405db0:  8b668a36  68e7beaf  b8797db0  e9a064f5 
34405dc0:  d51853e4  1a2d2a22  78155d31  06ae1b93 
34405dd0:  792b1791  352f22d7  e64a17e7  75076b81 
34405de0:  1a666551  722ff12f  8cc86c83  1699194a 
34405df0:  a213dca6  16fe22aa  6c8f8ad2  dd88f8b2 
34405e00:  fffe84bd  72d8df77  e99459f9  13b0478a 
github.com/jedisct1/xsecretbox.Seal(0xe035f845, 0xd0ec3743, 0x669815bf, 0x33bcad34, 0x8cf9ac4a, 0xe82a4ccf, 0x313d34d, 0x2b227014, 0x8b668a36, 0x68e7beaf, ...)
	/home/buildozer/aports/community/dnscrypt-proxy/src/dnscrypt-proxy-2.0.10/src/github.com/jedisct1/xsecretbox/xsecretbox.go:31 +0xd8 fp=0x34405d90 sp=0x34405ca0 pc=0x16ca06e8
created by main.(*Proxy).udpListener
	/home/buildozer/aports/community/dnscrypt-proxy/src/dnscrypt-proxy-2.0.10/dnscrypt-proxy/proxy.go:141 +0x88

thank you

west suhanic

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 41 (30 by maintainers)

Commits related to this issue

Most upvoted comments

@jedisct1 The only thing I can think of that may cause this is issue is a unsigned comparison. The 386 code compares the length of the slice using JB (jump if below (unsigned)). I change it to JL (jump if less (signed)). Both versions work well on amd64 and amd64 running in 386 comp. mode. I’ve build dnscrypto-proxy with this change for linux_386.

@westsuhanic It would be great if you can try out the custom release. If this doesn’t fix the issue, I’ll disable 386 assembly until I can reproduce and investigate it properly.

Good to know that at least it’s always gonna be CX.

Thanks for merging this, @aead.

Time to tag a new release, then.

Hello Everyone:

I have tried the custom release on my x86 hardware and it works. I am testing repeatedly using, for example:

sudo ./dnscrypt-proxy -resolve ibm.fr

Running the above command against dnscrypt-proxy v2.0.10-r0 from edge/community would core every time.

What was changed in order to get this to work? Is there anything else I can try? How does this custom release make it into the apk repository?

thank you,

west suhanic

On Wed, Apr 25, 2018 at 2:30 PM, Andreas Auernhammer < notifications@github.com> wrote:

@jedisct1 https://github.com/jedisct1 The only thing I can think of that may cause this is issue is a unsigned comparison. The 386 code compares the length of the slice using JB (jump if below (unsigned)). I change it to JL (jump if less (signed)). Both versions work well on amd64 and amd64 running in 386 comp. mode. I’ve build dnscrypto-proxy with this change for linux_386.

@westsuhanic https://github.com/westsuhanic It would be great if you can try out the custom release https://github.com/aead/dnscrypt-proxy/releases/download/2.0.11/dnscrypt-proxy-linux_i386-2.0.11.tar.gz. If this doesn’t fix the issue, I’ll disable 386 assembly until I can reproduce and investigate it properly.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jedisct1/dnscrypt-proxy/issues/404#issuecomment-384388678, or mute the thread https://github.com/notifications/unsubscribe-auth/AbU48xoe_qYVDWL_i-7wMIM3NRai9jMlks5tsMC2gaJpZM4Tjngp .

Tried the tar from your last post on 32bit VM. That’s working too

The vm is x86_64. Ran the i386 binary as you described and responds fine. One minor adjustment I made to the config was to listen on listen_addresses = [‘:53’]

Hope that’s an OK mod that doesn’t invalidate the test…