Opened 3 years ago

Closed 5 months ago

Last modified 4 months ago

#9117 closed defect (fixed)

libx265 segfault error while encoding

Reported by: Arno BERND Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: libx265
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug: Unpredictable segault errors when trying to encode multiple videos with libx265.
How to reproduce:

Just use about 6 parallel running commands
% ffmpeg -loglevel quiet -y -i <file_mp4> -vcodec libx265 -x265-params log-level=-1 <file2_mp4> 
ffmpeg version 4.3.1
built on SUSE Linux with gcc 10

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (1)

segfaults.txt (1.7 KB ) - added by Arno BERND 3 years ago.
output from dmesg when error occurs

Download all attachments as: .zip

Change History (5)

by Arno BERND, 3 years ago

Attachment: segfaults.txt added

output from dmesg when error occurs

in reply to:  description comment:1 by Carl Eugen Hoyos, 3 years ago

Component: ffmpegundetermined
Keywords: ffmpeg encoder removed

Replying to babu59:

Unpredictable segault errors

This usually does not indicate a bug that can be fixed in software.

To make this a valid ticket, please test current FFmpeg git head and provide backtrace, disassembly and register dump as explained on https://ffmpeg.org/bugreports.html

comment:2 by Arno BERND, 5 months ago

Resolution: fixed
Status: newclosed

I discovered, that this error seems to be a run into architecture limitations, when I use libx265 without pool and frame limitations. I cannot really ensure this because I am still not able to reproduce the error consistently.

Since I limited "pools" and "frames" I am able to run multiple conversions in parallel to be able to use 100% CPU on a modern processor with 16/32 cores/threads.

I assume it's a stack pointer overflow.

Problem is now solved for me!

comment:3 by Arno BERND, 4 months ago

To complete my infomation:

Command which works without errors is now

ffmpeg -loglevel quiet -y -i <file_mp4> -vcodec libx265 -x265-params log-level=-1:frame-threads=1:pools=6 <file2>

Running 10 ffmpeg-tasks in parallel with full-HD (1920x1080) uses about 99% CPU on AMD Ryzen 9 5950x.

comment:4 by Arno BERND, 4 months ago

Summary: libx265 sgefault error while encodinglibx265 segfault error while encoding
Note: See TracTickets for help on using tickets.