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

avif conversion utility segfaults #1

Open
MartiCode opened this issue Mar 18, 2019 · 8 comments
Open

avif conversion utility segfaults #1

MartiCode opened this issue Mar 18, 2019 · 8 comments

Comments

@MartiCode
Copy link

Using command: avif -s 5 -q 25 -e IMG_3890.JPG -o delme.avif

Gives:
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x7f28b05b14f4]

runtime stack:
runtime.throw(0x533bec, 0x2a)
/usr/lib/go-1.10/src/runtime/panic.go:616 +0x81
runtime.sigpanic()
/usr/lib/go-1.10/src/runtime/signal_unix.go:372 +0x28e

goroutine 1 [syscall]:
runtime.cgocall(0x4e6ba0, 0xc420041d48, 0x4f7020)
/usr/lib/go-1.10/src/runtime/cgocall.go:128 +0x64 fp=0xc420041d18 sp=0xc420041ce0 pc=0x403004
github.com/Kagami/go-avif._Cfunc_avif_encode_frame(0xc421524f80, 0xc420046000, 0xc420046310, 0x0)
_cgo_gotypes.go:115 +0x4d fp=0xc420041d48 sp=0xc420041d18 pc=0x4b5e1d
github.com/Kagami/go-avif.Encode.func3(0xc421524f80, 0xc420046000, 0xc420046310, 0x5453c0)
/home/pierre/go/src/github.com/Kagami/go-avif/avif.go:186 +0x12d fp=0xc420041d80 sp=0xc420041d48 pc=0x4b6dad
github.com/Kagami/go-avif.Encode(0x545140, 0xc42000e3e8, 0x545b40, 0xc42005a080, 0xc420041e98, 0x0, 0x0)
/home/pierre/go/src/github.com/Kagami/go-avif/avif.go:186 +0x5ab fp=0xc420041ec8 sp=0xc420041d80 pc=0x4b682b
main.main()
/home/pierre/go/src/github.com/Kagami/go-avif/cmd/avif/main.go:102 +0x2ac fp=0xc420041f88 sp=0xc420041ec8 pc=0x4e67ec
runtime.main()
/usr/lib/go-1.10/src/runtime/proc.go:198 +0x212 fp=0xc420041fe0 sp=0xc420041f88 pc=0x42a832
runtime.goexit()
/usr/lib/go-1.10/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc420041fe8 sp=0xc420041fe0 pc=0x451be1

@Kagami
Copy link
Owner

Kagami commented Mar 18, 2019

Thank you for the report.

Is it happening on any image or only this particular?
What libaom version do you use?

@MartiCode
Copy link
Author

MartiCode commented Mar 19, 2019

Seems to happen with every JPEG I tried. The version of libaom-dev as reported by apt:

Version: 1.0.0-3~18.04.york0
Depends: libaom0 (= 1.0.0-3~18.04.york0)

@Kagami
Copy link
Owner

Kagami commented Mar 20, 2019

I've installed the same libaom in Ubuntu 18.04 in Docker container and can't reproduce that issue. It might be related to your system.

Try with latest libaom from git. See instructions here.

@radum
Copy link

radum commented Apr 3, 2019

I have the same issue and I installed it to WSL on Windows 10.

@Kagami can you paste your docker file?

@Kagami
Copy link
Owner

Kagami commented Apr 3, 2019

FROM ubuntu:18.04

RUN apt-get update \
  && apt-get install -y software-properties-common git golang \
  && add-apt-repository -y ppa:jonathonf/ffmpeg-4 \
  && apt-get update \
  && apt-get install -y libaom-dev \
  && mkdir -p /go/src/github.com/Kagami \
  && cd /go/src/github.com/Kagami \
  && git clone https://github.com/Kagami/go-avif.git \
  && GOPATH=/go go get -v ./...

ENTRYPOINT ["/go/bin/avif"]
docker build -t avif .
docker run --rm -v `pwd`:/mnt avif -e /mnt/tiger.jpg -o /mnt/tiger.avif

This works fine for me.

@MartiCode
Copy link
Author

It seems to work with smallish images and not with larger ones. Could it be an issue with running out of memory? I have tried to manually convert to AVIF using ffmpeg/libaom/mp4box and on larger pictures (ie 4000x5000) the process quickly balloons and runs out of memory (on a 32Gb system). If so some check and proper "out of memory" error reporting would be useful.

@Kagami
Copy link
Owner

Kagami commented Apr 4, 2019

Thanks, I finally can reproduce issue!

On 5412x7216 image with libaom 1.0.0 I get segfault and with latest libaom from git it's:

$ aomenc -o big.ivf big.y4m
Failed to initialize encoder: Memory allocation error

I will report that to aomedia.

@Orum
Copy link

Orum commented Aug 6, 2019

Any update on this? Is libaom still bugged? If so, I don't suppose you're willing to support another encoder in the meantime...

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

4 participants