Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crashes in production but not development #25

Open
andrewarrow opened this issue Jul 21, 2016 · 2 comments
Open

crashes in production but not development #25

andrewarrow opened this issue Jul 21, 2016 · 2 comments

Comments

@andrewarrow
Copy link

here is code, on the TypeByBuffer call I get the panic:

       err := magicmime.Open(magicmime.MAGIC_MIME_TYPE)
       mime, err := magicmime.TypeByBuffer(buffer)
       if err != nil {
               return err
       }
       magicmime.Close()
fatal error: unexpected signal during runtime execution
Jun 05 07:36:23 : /usr/lib/golang/src/runtime/panic.go:503 +0x8e
Jun 05 07:36:23 : runtime.sigpanic()
Jun 05 07:36:23 : /usr/lib/golang/src/runtime/sigpanic_unix.go:14 +0x5e
Jun 05 07:36:23 : goroutine 6581214 [syscall, locked to thread]:
Jun 05 07:36:23 : runtime.cgocall_errno(0x401610, 0xc2080e1698, 0xc200000000)
Jun 05 07:36:23 : /usr/lib/golang/src/runtime/cgocall.go:130 +0xf5 fp=0xc2080e16
Jun 05 07:36:23 : github.com/rakyll/magicmime._Cfunc_magic_buffer(0x7fece80008c0
Jun 05 07:36:23 : github.com/rakyll/magicmime/_obj/_cgo_gotypes.go:76 +0x44 fp=0
Jun 05 07:36:23 : github.com/rakyll/magicmime.TypeByBuffer(0xc2085fda00, 0x200,
Jun 05 07:36:23 : /home/aa/go/src/github.com/rakyll/magicmime/magicmime.go:151
@andrewarrow
Copy link
Author

it might be something as silly as the buffer is empty? I'm not sure yet what casues it but I see it every fews days in the production logs.

@andrewarrow
Copy link
Author

well just noticed in code:

  if len(buffer) == 0 {
    return errors.New("mime type checked failed zero bytes")
  }

so buffer len is not zero.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant