ffmpeg 7.02 crash randomly with Exception code: 0xc0000005 or Exception code: 0xc000008f
hi gyan,
my application uses ffmpeg for 24x7 file capture. after last window update ffmpeg crashed randomly with Exception code: 0xc0000005 or Exception code: 0xc000008f in both windows 10 and windows 11.
windows exception
Faulting application name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x00000000 Faulting module name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x00000000 Exception code: 0xc000008f Fault offset: 0x0000000001dc0d55 Faulting process id: 0x49c8 Faulting application start time: 0x01daf3ec7d8a85f7 Faulting application path: D:\Logger_win\config\ffmpeg.exe Faulting module path: D:\Logger_win\config\ffmpeg.exe Report Id: 889bab2a-85e3-4394-a15a-d2442a692b84
Faulting application name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x00000000 Faulting module name: ntdll.dll, version: 10.0.19041.4522, time stamp: 0x8a1bb6f3 Exception code: 0xc0000005 Fault offset: 0x00000000000649f6 Faulting process id: 0x4378 Faulting application start time: 0x01daf3ce2e9e9849 Faulting application path: D:\Logger_win\config\ffmpeg.exe Faulting module path: C:\Windows\SYSTEM32\ntdll.dll Report Id: fd1bbe87-6591-4d6a-b904-48ec9cc72ff6 Faulting package full name:
Faulting application name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x00000000 Faulting module name: ntdll.dll, version: 10.0.19041.4522, time stamp: 0x8a1bb6f3 Exception code: 0xc0000025 Fault offset: 0x00000000001025e6 Faulting process id: 0x30d0 Faulting application start time: 0x01daf3d138bd0b6b Faulting application path: D:\Logger_win\config\ffmpeg.exe Faulting module path: C:\Windows\SYSTEM32\ntdll.dll Report Id: ff99e787-cfa9-475d-b722-44af47a51359 Faulting package full name:
please help me. provide resolution
Needs details. Full command used + debug level log. OS info.
Coomand
ffmpeg 23-08-2024_errorlog_29.txt 23-08-2024_errorlog_29.txt -rtbufsize 150M -nostats -buffer_size 9388608 -err_detect ignore_err -fflags +flush_packets -timeout 20000 -re -i "udp://224.2.2.2:2000?fifo_size=1000000&overrun_nonfatal=1&localaddr=192.168.0.65" -map 0:p:1 -filter_complex "[0:p:1:v]scale=384:288,drawtext=fontfile=C\:/Windows/Fonts/ARIALN.TTF: text=Demo: x=10: y=text_h: fontcolor=#FFFFFF@1:fontsize=20.25:shadowcolor=#000000:shadowx=3:shadowy=3,drawtext=fontfile=C\:/Windows/Fonts/ARIALN.TTF: text='%{localtime}': x=(w-tw)-10: y=text_h: fontcolor=#FFFFFF@1:fontsize=20.25:shadowcolor=#000000:shadowx=3:shadowy=3,blackdetect=d=5,metadata=print:key=lavfi.black_start,blackdetect=d=5,metadata=print:key=lavfi.black_end,freezedetect=n=-60dB:d=5" -af aresample=async=1,silencedetect=n=-50dB:d=5 -map 0:p:1:a? -c:v libx264 -c:a aac -b:a 32k -ar 44100 -ac 2 -s 384X288 -r 25 -b:v 250k -bufsize 2048k -preset slow -g 25 -sn -dn -ignore_unknown -x264-params keyint=25:min-keyint=25:bframes=3:scenecut=0 -reset_timestamps 1 -f segment -strftime 1 -segment_atclocktime 1 -segment_time 120 -segment_format mpegts G:\logger\data/temp/Demo_%Y-%m-%d_%H-%M-%S.ts
system info
0xc0000005 is not related to Win 7. Have same problem, it's always crashing silently on HEVC encoding, Windows 11, i9 14900K, sometimes after a few minutes, sometimes after hours of encoding.
-report option doesn't show any additional information.
Switched to BtbN ffmpeg builds and all problems are gone. The only difference I see is gcc 13.2.0 - MSYS2 vs gcc 14.2.0 - crosstool. Can be one more gcc 13.2.0 optimization bug...
Command used: ffmpeg -y -i video.mov -max_muxing_queue_size 1024 -filter_complex "[0:0]crop=1920:800:0:140[v]" -map "[v]" -c:v libx265 -pix_fmt yuv420p10le -x265-params "aq-mode=3:repeat-headers=0:strong-intra-smoothing=1:bframes=4:b-adapt=2:frame-threads=0:colormatrix=bt709:hdr10_opt=0:hdr10=0" -crf:v 18 -preset:v slow -map_metadata -1 -map_chapters 0 -default_mode infer_no_subs encoded.mkv
Whatever. Bug was opened for random crashes on Windows 10 and 11.
0xc0000005 is not related to Win 7. Have same problem, it's always crashing silently on HEVC encoding, Windows 11, i9 14900K, sometimes after a few minutes, sometimes after hours of encoding.
Command used: ffmpeg -y -i video.mov -max_muxing_queue_size 1024 -filter_complex "[0:0]crop=1920:800:0:140[v]" -map "[v]" -c:v libx265 -pix_fmt yuv420p10le -x265-params "aq-mode=3:repeat-headers=0:strong-intra-smoothing=1:bframes=4:b-adapt=2:frame-threads=0:colormatrix=bt709:hdr10_opt=0:hdr10=0" -crf:v 18 -preset:v slow -map_metadata -1 -map_chapters 0 -default_mode infer_no_subs encoded.mkv
Which build and version?
The last build I tested was ffmpeg-2024-09-19-git-0d5b68c27c-full_build.7z but the same happens with all builds I tried in the last ~2 months, including latest 7.0.2 release build.
Does it happen if you reduce bframes to 2?
Yes, it still happens. Log attached
Faulting application name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x66ebfd32 Faulting module name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x66ebfd32 Exception code: 0xc0000005 Fault offset: 0x0000000005eb71b9 Faulting process id: 0xAB4C Faulting application start time: 0x1DB107B8239AA77 Faulting application path: G:\Src\ffmpeg\bin-git\ffmpeg.exe Faulting module path: G:\Src\ffmpeg\bin-git\ffmpeg.exe Report Id: 3969d75d-5271-45bc-84bd-81e6d16f73c4 Faulting package full name: Faulting package-relative application ID:
One more. In this case that's svtav1 encoding, same 0xc0000005 exception.
G:\Src\ffmpeg\bin-git\ffmpeg.exe -report -y -i 01-.mkv -max_muxing_queue_size 1024 -filter_complex "[0:0]crop=1920:1040:0:20[v]" -map "[v]" -c:v libsvtav1 -pix_fmt yuv420p10le -strict experimental -preset 4 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -svtav1-params "tune=0:film-grain-denoise=0:tile-columns=0:tile-rows=0:scd=0" -crf 14 -map_metadata -1 -map_chapters 0 -default_mode infer_no_subs encoded-01-.mkv
Faulting application name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x66ebfd32 Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000 Exception code: 0xc0000005 Fault offset: 0x00000000fffffff3 Faulting process id: 0x7148 Faulting application start time: 0x1DB10AAB49D982B Faulting application path: G:\Src\ffmpeg\bin-git\ffmpeg.exe Faulting module path: unknown Report Id: d9e177ec-9c0f-48cd-9d2f-f595a50bbe41 Faulting package full name:
Does it happen with 7.1?
Now I got 0xc0000094 and 0xc0000005
Faulting application name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x66fa894f Faulting module name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x66fa894f Exception code: 0xc0000094 Fault offset: 0x0000000006250acb Faulting process id: 0xF45C Faulting application start time: 0x1DB1375F16E0076 Faulting application path: G:\Src\ffmpeg\bin-7.1\ffmpeg.exe Faulting module path: G:\Src\ffmpeg\bin-7.1\ffmpeg.exe Report Id: 76b6cff0-3cb9-4928-89b9-be793650eafa Faulting package full name: Faulting package-relative application ID:
Faulting application name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x66fa894f Faulting module name: ffmpeg.exe, version: 0.0.0.0, time stamp: 0x66fa894f Exception code: 0xc0000005 Fault offset: 0x0000000005fc70b9 Faulting process id: 0x12A4C Faulting application start time: 0x1DB13BBEDF39A83 Faulting application path: G:\Src\ffmpeg\bin-7.1\ffmpeg.exe Faulting module path: G:\Src\ffmpeg\bin-7.1\ffmpeg.exe Report Id: 7a57dcd8-197e-4080-a3c5-d23933e790ea Faulting package full name: Faulting package-relative application ID:
Someone's reported a crash with the same exception code with a BtbN build (gcc 14.2.0) . Since no one's reported it (yet) with an essentials build, I suspect some change in an external library.
For proper debugging, I'll need a minimal reproducible command (and assets, if it matters).
Testing both builds on new ASUS BIOS with "Intel microcode update 0x12B for its 13th and 14th generation Core processors, addressing persistent stability issues stemming from voltage irregularities". Will let you know about results.
5 days of testing, no any crashes so far, So it looks like in my case it was unstable CPU.