FS#43060 - [handbrake] segfaults while encoding

Attached to Project: Community Packages
Opened by indianahorst (indianahorst) - Wednesday, 10 December 2014, 00:11 GMT
Last edited by Evangelos Foutras (foutrelis) - Monday, 23 March 2015, 05:48 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Evangelos Foutras (foutrelis)
Architecture x86_64
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:

When encoding with Handbrake on my 64 bit system, it crashes randomly without any pattern. Sometimes it crashes (without any notification), sometimes not.

Additional info:
* package version(s)
community/handbrake 0.10.0-1

* config and/or log files etc.
from dmesg:
ghb[19779]: segfault at 262d519 ip 00007f90a12dc375 sp 00007fff91d279c0 error 4 in libglib-2.0.so.0.4200.1[7f90a1276000+10c000]

Steps to reproduce:
Run Handbrake, encode something and wait if it crashes.
This task depends upon

Closed by  Evangelos Foutras (foutrelis)
Monday, 23 March 2015, 05:48 GMT
Reason for closing:  Fixed
Additional comments about closing:  Should be fixed in handbrake 0.10.1-2; reopen if the crashes persist.
Comment by Remco van 't Veer (remvee) - Wednesday, 10 December 2014, 08:22 GMT
I can confirm this problem. Here's a backtrace from gdb:

#0 0x0000000000487da5 in ?? ()
#1 0x0000000000465787 in ghb_timer_cb ()
#2 0x00007ffff312b3c3 in ?? () from /usr/lib/libglib-2.0.so.0
#3 0x00007ffff312a91d in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#4 0x00007ffff312acf8 in ?? () from /usr/lib/libglib-2.0.so.0
#5 0x00007ffff312b022 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#6 0x00007ffff53b7a15 in gtk_main () from /usr/lib/libgtk-3.so.0
#7 0x000000000045b725 in main ()
Comment by Remco van 't Veer (remvee) - Wednesday, 10 December 2014, 08:39 GMT
Switching from the x264 video encoder to x265 helps avoid the segfault.
Comment by indianahorst (indianahorst) - Sunday, 14 December 2014, 22:35 GMT
Thanks for this hint, but changing the codec can't be a solution, it's just a workaround.
Comment by Jason Plum (WarheadsSE) - Wednesday, 24 December 2014, 17:22 GMT
I am experiencing this also on x86_64, however I am only getting an error with libx264. Using the GUI, and toggling to/from x264 - x265 - x264 will remove this "issue" for a single run. It seems almost like there is an issue with the profile.

x264 [error]: invalid preset 'custom'
[11:57:11] Failure to initialise thread 'H.264/AVC encoder (libx264)'
[11:57:11] reader: done. 0 scr changes
Comment by Barry G (smartiq) - Thursday, 01 January 2015, 06:14 GMT
I started hitting this today as well. I rebuilt handbrake with debugging enabled. This is how I am dying:
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000000000487df5 in add_job ()

Thread 1 (Thread 0x7f5085e368c0 (LWP 10194)):
#0 0x0000000000487df5 in add_job ()
#1 0x00000000004657d7 in ghb_timer_cb ()
#2 0x00007f5080fe23c3 in ?? () from /usr/lib/libglib-2.0.so.0
#3 0x00007f5080fe191d in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#4 0x00007f5080fe1cf8 in ?? () from /usr/lib/libglib-2.0.so.0
#5 0x00007f5080fe2022 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#6 0x00007f508326ed45 in gtk_main () from /usr/lib/libgtk-3.so.0
#7 0x000000000045b775 in main ()

The corresponding assembly is:
0x0000000000487dc6 <+982>: mov $0x4,%edi
0x0000000000487dcb <+987>: callq 0x493720 <hb_filter_init>
0x0000000000487dd0 <+992>: mov 0x68(%rsp),%rdi
0x0000000000487dd5 <+997>: mov %rbp,%rdx
0x0000000000487dd8 <+1000>: mov %rax,%rsi
0x0000000000487ddb <+1003>: callq 0x498ef0 <hb_add_filter>
0x0000000000487de0 <+1008>: mov %rbp,%rdi
0x0000000000487de3 <+1011>: callq 0x41dca0 <g_free@plt>
0x0000000000487de8 <+1016>: mov $0xd026f5,%esi
0x0000000000487ded <+1021>: mov %rbx,%rdi
0x0000000000487df0 <+1024>: callq 0x475c20 <ghb_settings_get_const_string>
=> 0x0000000000487df5 <+1029>: cmpb $0x6f,(%rax)
0x0000000000487df8 <+1032>: je 0x488780 <add_job+3472>
0x0000000000487dfe <+1038>: mov $0xd026f5,%esi
0x0000000000487e03 <+1043>: mov %rbx,%rdi

Full backtrace of all threads and dissassembly of add_job are available at http://pastebin.com/ipCEQkH4.

I can repeatably hit it right now.

Comment by Eugene Dvoretsky (radioxoma) - Sunday, 08 March 2015, 12:11 GMT
Rollback to libx264-1:142.20140826-2-x86_64.pkg.tar.xz x264-1:142.20140826-2-x86_64.pkg.tar.xz helps avoid the issue.
Comment by Evangelos Foutras (foutrelis) - Friday, 13 March 2015, 19:51 GMT
Please check if the issue still exists in handbrake 0.10.1-1.
Comment by Eugene Dvoretsky (radioxoma) - Saturday, 14 March 2015, 07:34 GMT
0.10.1 (x86_64) x264 encoding without errors.
Comment by Barry G (smartiq) - Friday, 20 March 2015, 01:06 GMT
Still hitting it in:
handbrake 0.10.1-1

Program received signal SIGSEGV, Segmentation fault.
0x0000000000488015 in ?? ()
(gdb) thread apply all bt 10

[snip boring threads]

Thread 1 (Thread 0x7ffff7f688c0 (LWP 2146)):
#0 0x0000000000488015 in ?? ()
#1 0x00000000004659f7 in ghb_timer_cb ()
#2 0x00007ffff311d0d3 in ?? () from /usr/lib/libglib-2.0.so.0
#3 0x00007ffff311c62d in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#4 0x00007ffff311ca08 in ?? () from /usr/lib/libglib-2.0.so.0
#5 0x00007ffff311cd32 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#6 0x00007ffff53a9f15 in gtk_main () from /usr/lib/libgtk-3.so.0
#7 0x000000000045b9e5 in main ()

This one isn't built with debugging... I have x264 versions:
libx264 2:144.20150223-1
x264 2:144.20150223-1

Anything you want me to try?
Comment by Barry G (smartiq) - Sunday, 22 March 2015, 03:29 GMT
I took the time this weekend to track down this bug. I talked to upstream developers about it. I was hitting a bug caused by "integer" wrappers in the XML around the PictureDenoiseFilter value in gtk/src/standard_presets.xml. It should have been "string".

The whole conversation can be found here:
https://forum.handbrake.fr/viewtopic.php?f=12&t=32090

Should be fixed in next upstream release.
Comment by Evangelos Foutras (foutrelis) - Sunday, 22 March 2015, 04:29 GMT
Thanks for the information; the default presets should be fixed in handbrake 0.10.1-2.

Loading...