From b2e1eea6bf8387a97691721bd6075d01bde45d18 Mon Sep 17 00:00:00 2001 From: Markus Kern Date: Sun, 22 Mar 2015 21:22:44 +0000 Subject: [PATCH] Fix alignment crash on i386 --- output_http.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/output_http.go b/output_http.go index eaecec6..e4d69aa 100644 --- a/output_http.go +++ b/output_http.go @@ -51,13 +51,17 @@ func ParseRequest(data []byte) (request *http.Request, err error) { const InitialDynamicWorkers = 10 type HTTPOutput struct { + // Keep this as first element of struct because it guarantees 64bit + // alignment. atomic.* functions crash on 32bit machines if operand is not + // aligned at 64bit. See https://github.com/golang/go/issues/599 + activeWorkers int64 + address string limit int queue chan []byte redirectLimit int - activeWorkers int64 needWorker chan int urlRegexp HTTPUrlRegexp