golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124k stars 17.67k forks source link

lib/time: error updating tzinfo.zip #28519

Closed ggarnier closed 6 years ago

ggarnier commented 6 years ago

I'm trying to update tzinfo to 2018g version, but I'm getting a memory corruption error when running update.bash script.

What version of Go are you using (go version)?

go version go1.11.1 linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/me/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/me/dev/go"
GOPROXY=""
GORACE=""
GOROOT="/home/linuxbrew/.linuxbrew/Cellar/go/1.11.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/home/linuxbrew/.linuxbrew/Cellar/go/1.11.1/libexec/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc-5"
CXX="g++-5"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build153507047=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I updated CODE and DATA vars in lib/time/update.bash file to 2018g and ran the script. make CFLAGS=-DSTD_INSPIRED AWK=awk TZDIR=zoneinfo posix_only returned a memory corruption error.

What did you expect to see?

Successfully generate zoneinfo.zip file.

What did you see instead?

awk -v DATAFORM=`expr main.zi : '\(.*\).zi'` -f ziguard.awk \
          africa antarctica asia australasia europe northamerica southamerica etcetera systemv factory backward  >main.zi.out
malloc(): memory corruption
Aborted (core dumped)
Makefile:565: recipe for target 'main.zi' failed
make[1]: *** [main.zi] Error 134
make[1]: Leaving directory 'work'
Makefile:613: recipe for target 'posix_only' failed
make: *** [posix_only] Error 2
ianlancetaylor commented 6 years ago

Looks like a problem in awk. What version of awk is on your PATH?

This isn't something related to Go, of course. The update.bash script is running make on code downloaded from www.iana.org.

Note that we don't usually update the timezone info until we're close to the release.

ALTree commented 6 years ago

FWIW I'm getting the same crash on Debian Buster, with (m)awk 1.3.3

ggarnier commented 6 years ago

@ianlancetaylor

$ awk -W version
mawk 1.3.3 Nov 1996, Copyright (C) Michael D. Brennan

compiled limits:
max NF             32767
sprintf buffer      2040
ianlancetaylor commented 6 years ago

Thanks. Seems to me that this is really a problem with building tzdata. There isn't anything we can do in the Go project to affect this, so I'm going to close this issue.