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

fatal error: unexpected signal during runtime execution #57

Closed
paulm17 opened this issue Sep 21, 2019 · 10 comments
Closed

fatal error: unexpected signal during runtime execution #57

paulm17 opened this issue Sep 21, 2019 · 10 comments
Labels

Comments

@paulm17
Copy link

paulm17 commented Sep 21, 2019

Trying to run this neat library, but keeps on crashing for me.

  • Ubuntu 18.10 (GNU/Linux 4.18.0-25-generic x86_64)
  • Golang version go1.12 linux/amd64
  • ffmpeg version 4.1

I tried with the ffmpeg mentioned in the readme but still the same.

My code:

opts := thumbnailer.Options{
    ThumbDims: thumbnailer.Dims{250, 250},
}

_, thumbImg, err := thumbnailer.Process(f, opts)
if err != nil {
    return nil, err
}

// name of output file, also determines output type
dir := common.GetDir() + "/upload/dam/"
outFilename := fmt.Sprintf("%s%d_%s.%s", dir, size, m["fileID"], "png")

// Save File
if err != thumbnailer.ErrCantThumbnail {
    f, err := os.Create(outFilename)
    if err != nil {
        return nil, err
    }
    defer f.Close()

    err = png.Encode(f, thumbImg)
    if err != nil {
        return nil, err
    }
}

Panic:

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x80 addr=0x0 pc=0xcffe97]

runtime stack:
runtime.throw(0x150fdeb, 0x2a)
    /usr/lib/go-1.12/src/runtime/panic.go:617 +0x72
runtime.sigpanic()
    /usr/lib/go-1.12/src/runtime/signal_unix.go:374 +0x4a9

goroutine 45 [syscall]:
runtime.cgocall(0x957430, 0xc0001329b8, 0xc000198d80)
    /usr/lib/go-1.12/src/runtime/cgocall.go:128 +0x5b fp=0xc000132988 sp=0xc000132950 pc=0x4a439b
github.com/bakape/thumbnailer._Cfunc_retrieve_meta(0x7f68500022e0, 0x0, 0x0)
    _cgo_gotypes.go:1222 +0x49 fp=0xc0001329b8 sp=0xc000132988 pc=0x82a7c9
github.com/bakape/thumbnailer.(*FFContext).Meta.func1(0xc00000e940, 0xc0001a83c0, 0x7f68500022e0)
    /srv/www/app.platformdev.com/public_html/golang/src/github.com/bakape/thumbnailer/meta.go:8 +0x5e fp=0xc0001329f8 sp=0xc0001329b8 pc=0x82d27e
github.com/bakape/thumbnailer.(*FFContext).Meta(0xc00000e940, 0x0, 0x0, 0x0, 0x0)
    /srv/www/app.platformdev.com/public_html/golang/src/github.com/bakape/thumbnailer/meta.go:8 +0x49 fp=0xc000132a28 sp=0xc0001329f8 pc=0x82c049
github.com/bakape/thumbnailer.processMedia(0x15b3b00, 0xc0000100c8, 0xc0000648a0, 0x0, 0x0, 0xfa, 0xfa, 0x0, 0x0, 0x0, ...)
    /srv/www/app.platformdev.com/public_html/golang/src/github.com/bakape/thumbnailer/thumbnailer.go:64 +0x110 fp=0xc000132aa0 sp=0xc000132a28 pc=0x82c4c0
github.com/bakape/thumbnailer.Process(0x15b3b00, 0xc0000100c8, 0x0, 0x0, 0xfa, 0xfa, 0x0, 0x5100de, 0xc000132bb0, 0x4cc311, ...)
@bakape
Copy link
Owner

bakape commented Sep 21, 2019

Can you upload the file causing this?

@bakape bakape added the bug label Sep 21, 2019
@paulm17
Copy link
Author

paulm17 commented Sep 21, 2019

Thanks for the quick response. Here is the link: https://www.dropbox.com/s/wt8m4z7nr0lsjp0/big_buck_bunny_720p_1mb.mp4?dl=0

Let me know if you have issues and I'll share it elsewhere.

bakape added a commit that referenced this issue Sep 21, 2019
Seems to affect some FFmpeg configurations

addresses #57
@bakape
Copy link
Owner

bakape commented Sep 21, 2019

I'm on Ubuntu 19.04 and it seems to be working fine. The one thing that might segfault there is null pointer deref on AVFormatContext.meta. Does this fix the problem?

@paulm17
Copy link
Author

paulm17 commented Sep 21, 2019

Unfortunately it does not. I will upgrade to 19.04 and then report back.

@paulm17
Copy link
Author

paulm17 commented Sep 21, 2019

I've upgraded to 19.10 and still have the same issue.

What's your version of ffmpeg? thanks

@bakape
Copy link
Owner

bakape commented Sep 21, 2019

ffmpeg version 4.1.3-0ubuntu1 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 8 (Ubuntu 8.3.0-6ubuntu1)
  configuration: --prefix=/usr --extra-version=0ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

This is stock ubuntu FFmpeg and not compiled from sources, as it seems the ubuntu patch bugs no longer affect them.

@paulm17
Copy link
Author

paulm17 commented Sep 21, 2019

I upgraded from the manual compile I had under 18.10 to the newer 4.1.3 with 19.04.

I also mocked up a standalone program with the above code and it works fine. Although my main program still does not. But I'm sure it's a fault on my end somewhere.

Seeing as it works standalone, I'm closing this.

Many thanks for your help and building out this library also.

@paulm17 paulm17 closed this as completed Sep 21, 2019
@paulm17
Copy link
Author

paulm17 commented Sep 22, 2019

This morning, I finally got to the bottom of this.

I'm using https://github.com/discordapp/lilliput for fast image resizing. If I use lilliput and thumbnailer together in the same app, then I get the crash.

goroutine 1 [syscall]:
runtime.cgocall(0x5bd270, 0xc000049bb8, 0x5a3cee)
    /usr/lib/go-1.13/src/runtime/cgocall.go:128 +0x5b fp=0xc000049b88 sp=0xc000049b50 pc=0x4a315b

I presume that because are both using cgo at the same time?

It's all good now. I'm running an MQ and have put videos and other types of files into separate executables.

@bakape
Copy link
Owner

bakape commented Sep 22, 2019 via email

@paulm17
Copy link
Author

paulm17 commented Sep 22, 2019

Thanks for the confirmation!

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

No branches or pull requests

2 participants