epsagon / epsagon-go

Automated tracing library for Go 1.x ⚡️
https://epsagon.com
MIT License
28 stars 11 forks source link

fix stack hiding #22

Closed enoodle closed 4 years ago

enoodle commented 4 years ago

example output from the exp_example function:

{integer divide by zero goroutine 23 [running]:
runtime/debug.Stack(0x9434ef, 0x2, 0xc000116e58)
    /usr/local/go/src/runtime/debug/stack.go:24 +0x9d
github.com/epsagon/epsagon-go/epsagon.(*epsagonLambdaWrapper).InvokeClientLambda.func1(0xc000117610)
    /home/erez/golang/src/github.com/epsagon/epsagon-go/epsagon/lambda_wrapper.go:176 +0xe4
panic(0x8cda20, 0xd99350)
    /usr/local/go/src/runtime/panic.go:522 +0x1b5
main.expHandler(0xc00009f928, 0x4, 0xc00009f92c, 0x4, 0xc00009f940, 0x4, 0xc0001bf230, 0x0, 0x0, 0x0, ...)
    /home/erez/golang/src/github.com/epsagon/epsagon-go/example/exp_example/main.go:13 +0xb7
reflect.Value.call(0x8bc8e0, 0x9661d8, 0x13, 0x943a28, 0x4, 0xc0001ec580, 0x1, 0x1, 0x1, 0xc0001ec580, ...)
    /usr/local/go/src/reflect/value.go:447 +0x461
reflect.Value.Call(0x8bc8e0, 0x9661d8, 0x13, 0xc0001ec580, 0x1, 0x1, 0x0, 0x1, 0xc0001ec380)
    /usr/local/go/src/reflect/value.go:308 +0xa4
github.com/epsagon/epsagon-go/epsagon.makeGenericHandler.func1(0xa68c00, 0xc0001becc0, 0xc0000b5200, 0x8c7, 0x900, 0xc000199170, 0xc0000260ac, 0xc00002c0cb, 0xc0000b2299)
    /home/erez/golang/src/github.com/epsagon/epsagon-go/epsagon/generic_handler.go:99 +0x225
github.com/epsagon/epsagon-go/epsagon.(*epsagonLambdaWrapper).InvokeClientLambda(0xc0001176b8, 0xa68c00, 0xc0001becc0, 0xc0000b5200, 0x8c7, 0x900, 0xc000117610)
    /home/erez/golang/src/github.com/epsagon/epsagon-go/epsagon/lambda_wrapper.go:187 +0xa4
github.com/epsagon/epsagon-go/epsagon.(*epsagonLambdaWrapper).Invoke(0xc0001176b8, 0xa68c00, 0xc0001becc0, 0xc0000b5200, 0x8c7, 0x900, 0x0, 0x0, 0x0, 0x0)
    /home/erez/golang/src/github.com/epsagon/epsagon-go/epsagon/lambda_wrapper.go:162 +0x207
github.com/epsagon/epsagon-go/epsagon.WrapLambdaHandler.func1(0xa68c00, 0xc0001becc0, 0xc0000b5200, 0x8c7, 0x900, 0x0, 0x0, 0x0, 0x0)
    /home/erez/golang/src/github.com/epsagon/epsagon-go/epsagon/lambda_wrapper.go:203 +0xb9
reflect.Value.call(0x8ca1a0, 0xc0000932c0, 0x13, 0x943a28, 0x4, 0xc0001becf0, 0x2, 0x2, 0x2, 0xc0001becf0, ...)
    /usr/local/go/src/reflect/value.go:447 +0x461
reflect.Value.Call(0x8ca1a0, 0xc0000932c0, 0x13, 0xc0001becf0, 0x2, 0x2, 0x1, 0x2, 0x40d1d9)
    /usr/local/go/src/reflect/value.go:308 +0xa4
github.com/epsagon/epsagon-go/vendor/github.com/aws/aws-lambda-go/lambda.newHandler.func1(0xa68c00, 0xc0001becc0, 0xc0000b4900, 0x8c7, 0x8c7, 0x910e60, 0xc0001becc0, 0x8a4040, 0xa55260)
    /home/erez/golang/src/github.com/epsagon/epsagon-go/vendor/github.com/aws/aws-lambda-go/lambda/handler.go:111 +0x21c
github.com/epsagon/epsagon-go/vendor/github.com/aws/aws-lambda-go/lambda.lambdaHandler.Invoke(0xc0000a5ec0, 0xa68c00, 0xc0001becc0, 0xc0000b4900, 0x8c7, 0x8c7, 0xa68c00, 0xc0001becc0, 0x49040c, 0x88eae0, ...)
    /home/erez/golang/src/github.com/epsagon/epsagon-go/vendor/github.com/aws/aws-lambda-go/lambda/handler.go:22 +0x5f
github.com/epsagon/epsagon-go/vendor/github.com/aws/aws-lambda-go/lambda.(*Function).Invoke(0xc00016e3b0, 0xc0001990e0, 0xc000093d00, 0x0, 0x0)
    /home/erez/golang/src/github.com/epsagon/epsagon-go/vendor/github.com/aws/aws-lambda-go/lambda/function.go:59 +0x35d
reflect.Value.call(0xc0000a2960, 0xc0000a05c0, 0x13, 0x943a28, 0x4, 0xc000052f18, 0x3, 0x3, 0xc0000a5e40, 0x30, ...)
    /usr/local/go/src/reflect/value.go:447 +0x461
reflect.Value.Call(0xc0000a2960, 0xc0000a05c0, 0x13, 0xc000040718, 0x3, 0x3, 0xc00009ebd8, 0x0, 0x40)
    /usr/local/go/src/reflect/value.go:308 +0xa4
net/rpc.(*service).call(0xc0001bc040, 0xc0000ba280, 0xc00009ebd8, 0xc00009ec00, 0xc000106300, 0xc0000938a0, 0x88ea60, 0xc0001990e0, 0x16, 0x88eae0, ...)
    /usr/local/go/src/net/rpc/server.go:384 +0x14e
created by net/rpc.(*Server).ServeCodec
    /usr/local/go/src/net/rpc/server.go:481 +0x42b
ranrib commented 4 years ago

fixes https://github.com/epsagon/epsagon-go/issues/21