Obfs4proxy 0.0.14 for Debian Buster

I would like to upgrade obfs4proxy on my Debian “Buster” server. Unfortunately there is no current Debian package for Buster at the moment. So I did build it from source. The build process ran without any issues, but when I run obfs4proxy, I immediately get an error:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x658478]

goroutine 1 [running]:
filippo.io/edwards25519/field.(*Element).Subtract(0xc0000cde40, 0xc0000cde68, 0x0, 0x20)
	/root/go/pkg/mod/filippo.io/edwards25519@v1.0.0-rc.1.0.20210721174708-390f27c3be20/field/fe.go:104 +0x38
filippo.io/edwards25519.(*Point).SetBytes(0xc0001000b0, 0xc0000b40a0, 0x20, 0x20, 0xc0000cdf48, 0x653c03, 0xc0000982a0)
	/root/go/pkg/mod/filippo.io/edwards25519@v1.0.0-rc.1.0.20210721174708-390f27c3be20/edwards25519.go:166 +0x18f
	/root/go/pkg/mod/filippo.io/edwards25519@v1.0.0-rc.1.0.20210721174708-390f27c3be20/edwards25519.go:67 +0x8a

go version go1.12.4 linux/amd64
Source: obfs4proxy-0.0.14

Any ideas how I can solve the problem ?
Thank you in advance.

I don’t know, i can only tell you how I did it if it’s helpful to you:

wget https://go.dev/dl/go1.19.3.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.19.3.linux-amd64.tar.gz
sed -i ‘$ a PATH=$PATH:/usr/local/go/bin’ ~/.profile
sed -i ‘$ a GOPATH=$HOME/go’ ~/.profile
source ~/.profile
git clone GitHub - Yawning/obfs4: The obfourscator (Courtesy mirror)
cd obfs4
go build -o obfs4proxy/obfs4proxy ./obfs4proxy
mv /obfs4proxy/obfs4proxy /usr/bin/
sudo setcap cap_net_bind_service=+ep /usr/bin/obfs4proxy

Working on my Debian.

@Vertux I suggest trying with a more recent version of the Go compiler. You can get go1.15 from buster-backports:

  1. Create a file /etc/apt/sources.list.d/buster-backports.list that contains the line:
    deb http://deb.debian.org/debian bullseye-backports main
  2. apt-get update
  3. apt-get install -t buster-backports golang

The runtime error you get with go1.12 is surprising. It looks like it’s the result of the compiler running global variable initialization in the wrong order. Specifically, the initialization of identity calls SetBytes which calls Subtract on the global variable feOne—but apparently feOne has not been initialized at that point. The compiler should initialize feOne before identity, but it initializes identity before feOne.

It surprises me because the order of global variable initialization is specified to examine the dependencies between variables and initialize them in the proper order. But there are also issues like #51913, so perhaps this is something that has changed over versions.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.

@dcf @pogo I have installed go v1.19 and everything worked like a charm. Obviously my go v1.12.4 was too old.

Maybe the dependencies : Go 1.11.0 or later. should be adjusted.

Thank you for your help.

1 Like