mozilla-services / heka

DEPRECATED: Data collection and processing made easy.
http://hekad.readthedocs.org/
Other
3.39k stars 531 forks source link

Lua Sandbox causes cgo panic in Go 1.6 #1881

Open craigmj opened 8 years ago

craigmj commented 8 years ago

When built with Go 1.6, using a Lua Sandbox decoder causes a cgo panic:

panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 13 [running]:
panic(0xb018a0, 0xc82012efe0)
    /usr/local/go/src/runtime/panic.go:464 +0x3e6
github.com/mozilla-services/heka/sandbox/lua._cgoCheckPointer0(0x9deb80, 0xc820048e40, 0x0, 0x0, 0x0, 0x7fa8cc000900)
    github.com/mozilla-services/heka/sandbox/lua/_obj/_cgo_gotypes.go:65 +0x4d
github.com/mozilla-services/heka/sandbox/lua.CreateLuaSandbox(0xc820077300, 0x0, 0x0, 0x0, 0x0)
    /usr/local/heka/build/heka/src/github.com/mozilla-services/heka/sandbox/lua/lua_sandbox.go:697 +0x92a

This appears to relate to the cgo changes in Go 1.6, as described https://tip.golang.org/cmd/cgo/#hdr-Passing_pointers

Hekad can be started with

GODEBUG=cgocheck=0 hekad
hy05190134 commented 8 years ago

panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 13 [running]: panic(0xb01ae0, 0xc820130bc0) /usr/local/go/src/runtime/panic.go:464 +0x3e6 github.com/mozilla-services/heka/sandbox/lua._cgoCheckPointer0(0x9dedc0, 0xc820126a40, 0x0, 0x0, 0x0, 0x7fb5cc000900) github.com/mozilla-services/heka/sandbox/lua/_obj/_cgo_gotypes.go:65 +0x4d github.com/mozilla-services/heka/sandbox/lua.CreateLuaSandbox(0xc8200c7600, 0x0, 0x0, 0x0, 0x0) /home/vagrant/workspace/heka/build/heka/src/github.com/mozilla-services/heka/sandbox/lua/lua_sandbox.go:697 +0x92a github.com/mozilla-services/heka/sandbox/plugins.(_SandboxDecoder).SetDecoderRunner(0xc820078790, 0x7fb5ddd3c708, 0xc82011d440) /home/vagrant/workspace/heka/build/heka/src/github.com/mozilla-services/heka/sandbox/plugins/sandbox_decoder.go:152 +0x120 github.com/mozilla-services/heka/pipeline.(_dRunner).Start(0xc82011d440, 0x7fb5ddd3cfe0, 0xc820128000, 0xc8201280a0) /home/vagrant/workspace/heka/build/heka/src/github.com/mozilla-services/heka/pipeline/plugin_runners.go:624 +0x160 github.com/mozilla-services/heka/pipeline.(_PipelineConfig).DecoderRunner(0xc820128000, 0xc820130160, 0xb, 0xc8201324c0, 0x1a, 0x7fb5ddd3c708, 0xc82011d440, 0x1) /home/vagrant/workspace/heka/build/heka/src/github.com/mozilla-services/heka/pipeline/config.go:324 +0x358 github.com/mozilla-services/heka/pipeline.(_iRunner).getDeliverFunc(0xc820105040, 0xc820130768, 0x1, 0xc820050000, 0x0, 0x0, 0x0, 0x0) /home/vagrant/workspace/heka/build/heka/src/github.com/mozilla-services/heka/pipeline/plugin_runners.go:452 +0x545 github.com/mozilla-services/heka/pipeline.(_iRunner).NewDeliverer(0xc820105040, 0xc820130768, 0x1, 0x0, 0x0) /home/vagrant/workspace/heka/build/heka/src/github.com/mozilla-services/heka/pipeline/plugin_runners.go:514 +0x51 github.com/mozilla-services/heka/plugins/logstreamer.(_LogstreamerInput).startLogstreamInput(0xc820078840, 0xc820013e80, 0x1, 0x7fb5ddd3caf0, 0xc820105040, 0x7fb5ddd3cfe0, 0xc820128000) /home/vagrant/workspace/heka/build/heka/src/github.com/mozilla-services/heka/plugins/logstreamer/logstreamer_input.go:196 +0x8e github.com/mozilla-services/heka/plugins/logstreamer.(_LogstreamerInput).Run(0xc820078840, 0x7fb5ddd3caf0, 0xc820105040, 0x7fb5ddd3cfe0, 0xc820128000, 0x0, 0x0) /home/vagrant/workspace/heka/build/heka/src/github.com/mozilla-services/heka/plugins/logstreamer/logstreamer_input.go:216 +0x132 github.com/mozilla-services/heka/pipeline.(_iRunner).Starter(0xc820105040, 0x7fb5ddd3cfe0, 0xc820128000, 0xc82012818c) /home/vagrant/workspace/heka/build/heka/src/github.com/mozilla-services/heka/pipeline/plugin_runners.go:325 +0x1b7 created by github.com/mozilla-services/heka/pipeline.(*iRunner).Start /home/vagrant/workspace/heka/build/heka/src/github.com/mozilla-services/heka/pipeline/plugin_runners.go:305 +0x88d

hy05190134 commented 8 years ago

I also encounter the problem

YiuTerran commented 8 years ago

+1

nnashwin commented 8 years ago

I encountered the problem as well. Only when I build from source.

yqguodataman commented 8 years ago

+1

timurb commented 8 years ago

Hi,

I usually see panics (don't know if they match the one provided above) when there is some error loading some Lua plugin. Do you see any error above the panic?

Regards, Timur

On Tue, Mar 29, 2016 at 11:56 AM, yqguodataman notifications@github.com wrote:

+1

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/mozilla-services/heka/issues/1881#issuecomment-202784581

affinity226 commented 8 years ago

+1

ahjdzx commented 8 years ago

+1

cweaver1321 commented 8 years ago

+1

hbrkanwei commented 8 years ago

+1

ghost commented 8 years ago

+1

miah commented 8 years ago

FYI, to work around the issue until its resolved in hekad (though that seems unlikely: https://mail.mozilla.org/pipermail/heka/2016-May/001059.html)

Start hekad with the GODEBUG variable exported in its environment: export GODEBUG=cgocheck=0

See: https://golang.org/doc/go1.6#cgo for more details.