HandBrake icon indicating copy to clipboard operation
HandBrake copied to clipboard

segmentation fault (core dumped)

Open MrHappy opened this issue 1 year ago • 18 comments

Problem Description

Encoding 2160p to 1080p movie ends for most files in a segmentation fault (core dumped). I

Activity Log, Crash Log or any other details

No logging. The encode-logging stops at a certain point.
Latest lines contain:"sync: chapter xx (xx) at frame .... time ...."
Is there any way to get a (much) more detailed logging?

What Operating System are you running?

Arch LTS 6.1.62

What version of HandBrake are you running?

1.6.1-3

Where did you download HandBrake from?

aur of Arch

MrHappy avatar Nov 14 '23 17:11 MrHappy

We would still ned the full log to get context of what your doing.

sr55 avatar Nov 14 '23 17:11 sr55

@sr55 Activitylog attached Activity.log

MrHappy avatar Nov 15 '23 08:11 MrHappy

There isn't much we can use in there unfortunately. I wonder if Linux stores better crash logs somewhere. Anyway, how much RAM do you have on that computer? Maybe HandBrake is being killed by OOM or something like that.

galad87 avatar Nov 16 '23 06:11 galad87

There 8GB of memory. Running journalctl -r | grep segfault returned this ghb[591120]: segfault at 0 ip 000055edb43ff4a4 sp 00007f40e7ff67c0 error 4 in ghb[55edb2b81000+29e2000]

MrHappy avatar Nov 16 '23 07:11 MrHappy

The version of HandBrake being run appears to be from an ArchLinux package. Are there any known problems with how Arch packages HandBrake? They are not currently listed in the Broken Third-Party Builds section of the documentation.

jstebbins avatar Nov 16 '23 15:11 jstebbins

Converting a 1080p movie gives no issues. I just removed Handbrake, removed all remaining data en reinstalled it. Now running a conversion of a UHD movie to see if that makes any difference. Only change I have in the preset is 'PictureColorspacePreset: bt709'. When there is any news I will change this comment.

--edit It gave another segfault. Same movie, same preset fails with 'PictureColorspacePreset: bt709' set. Runs fine without PictureColorspacePreset set.

MrHappy avatar Nov 16 '23 15:11 MrHappy

Same problem with the official builds? Arch builds are 3rd party.

sr55 avatar Nov 30 '23 21:11 sr55

I have been having the same issue on handbrake 1.6.1 and now handbrake 1.7. Ram usage is never over 50% . CPU temps are low around 70. I am using the flathub release.

[840132.849177] HandBrakeCLI[423801]: segfault at 0 ip 000055adb9cdd8d4 sp 000014bcab1f7a60 error 4 in HandBrakeCLI[55adb857d000+27b1000] likely on CPU 7 (core 3, socket 0) [840132.849204] Code: 83 80 05 00 00 85 c9 0f 85 a1 01 00 00 48 8b 43 08 f2 0f 10 93 88 01 00 00 4c 8b 80 98 00 00 00 48 8b 78 10 8b 80 e8 08 00 00 <49> 8b 08 48 8b 37 4c 8b 31 48 8b 16 f2 0f 10 81 c0 05 00 00 f2 0f [855004.303125] HandBrakeCLI[434251]: segfault at 0 ip 000055b3502e08d4 sp 000014d3f3b64a60 error 4 in HandBrakeCLI[55b34eb80000+27b1000] likely on CPU 2 (core 2, socket 0) [855004.303152] Code: 83 80 05 00 00 85 c9 0f 85 a1 01 00 00 48 8b 43 08 f2 0f 10 93 88 01 00 00 4c 8b 80 98 00 00 00 48 8b 78 10 8b 80 e8 08 00 00 <49> 8b 08 48 8b 37 4c 8b 31 48 8b 16 f2 0f 10 81 c0 05 00 00 f2 0f

snake3ca avatar Dec 05 '23 00:12 snake3ca

Unfortunately that's not helpful. Can you post the activity log? 1.6 introduced zscale, and the colorspace filter uses zscale too, it would be interesting trying a build with zscale disabled. Does your CPU support avx512?

galad87 avatar Dec 05 '23 06:12 galad87

Here is the activity log from Handbrake 1.6.1 :

[23:51:26] Compile-time hardening features are enabled [23:51:26] qsv: not available on this system Cannot load libnvidia-encode.so.1 [23:51:26] hb_init: starting libhb thread [23:51:26] thread 14c7081ff640 started ("libhb") HandBrake 1.6.1 (2023012300) - Linux x86_64 - https://handbrake.fr 8 CPUs detected Opening /mnt/Convert/Input/Video-1.mkv... [23:51:26] CPU: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz [23:51:26] - Intel microarchitecture Skylake [23:51:26] - logical processor count: 8 [23:51:26] Intel Quick Sync Video support: no [23:51:26] hb_scan: path=/mnt/Convert/Input/Video-1.mkv, title_index=1 [23:51:26] thread 14c707ffe640 started ("scan") udfread ERROR: ECMA 167 Volume Recognition failed disc.c:333: failed opening UDF image /mnt/Convert/Input/Video-1.mkv disc.c:437: error opening file BDMV/index.bdmv disc.c:437: error opening file BDMV/BACKUP/index.bdmv [23:51:26] bd: not a bd - trying as a stream/file instead libdvdread: DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed libdvdread: DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed [23:51:26] dvd: not a dvd - trying as a stream/file instead Input #0, matroska,webm, from '/mnt/Convert/Input/Video-1.mkv': Metadata: encoder : libebml v1.4.4 + libmatroska v1.7.1 creation_time : 2023-09-19T02:29:47.000000Z Duration: 01:51:26.18, start: 0.000000, bitrate: 31231 kb/s Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn (default) Metadata: BPS : 28217162 DURATION : 01:51:26.180000000 NUMBER_OF_FRAMES: 160308 NUMBER_OF_BYTES : 23583128375 _STATISTICS_WRITING_APP: mkvmerge v74.0.0 ('You Oughta Know') 64-bit _STATISTICS_WRITING_DATE_UTC: 2023-09-19 02:29:47 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES Stream #0:1(eng): Audio: truehd, 48000 Hz, 5.1(side), s32 (24 bit) (default) Metadata: title : Surround 5.1 BPS : 2945693 DURATION : 01:51:25.972000000 NUMBER_OF_FRAMES: 8023166 NUMBER_OF_BYTES : 2461853396 _STATISTICS_WRITING_APP: mkvmerge v74.0.0 ('You Oughta Know') 64-bit _STATISTICS_WRITING_DATE_UTC: 2023-09-19 02:29:47 _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES

Scanning title 1 of 1, 0.00 %[23:51:26] Found ffmpeg 0 chapters, container=matroska,webm [23:51:26] scan: decoding previews for title 1 [23:51:26] scan: preview 1 [23:51:26] fifo_close: trashing 0 buffer(s) [23:51:26] scan: audio 0x1: truehd, rate=48000Hz, bitrate=1 English (TrueHD) (5.1 ch) [23:51:26] scan: preview 2 [23:51:27] scan: preview 3

Scanning title 1 of 1, preview 3, 30.00 %[23:51:27] scan: preview 4

Scanning title 1 of 1, preview 4, 40.00 %[23:51:27] scan: preview 5 [23:51:27] scan: preview 6

Scanning title 1 of 1, preview 6, 60.00 %[23:51:27] scan: preview 7

Scanning title 1 of 1, preview 7, 70.00 %[23:51:28] scan: preview 8 [23:51:28] scan: preview 9

Scanning title 1 of 1, preview 9, 90.00 %[23:51:28] scan: preview 10

Scanning title 1 of 1, preview 10, 100.00 %[23:51:28] crop: [0] 138/138/0/0 [23:51:28] crop: [1] 138/138/0/0 [23:51:28] crop: [2] 138/138/0/0 [23:51:28] crop: [3] 138/138/0/0 [23:51:28] crop: [4] 138/138/0/0 [23:51:28] crop: [5] 138/138/22/0 [23:51:28] crop: [6] 138/139/90/0 [23:51:28] crop: [7] 139/139/130/5 [23:51:28] crop: [8] 167/139/169/183 [23:51:28] crop: less_than_median_frame_count: 0, [23:51:28] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 138/138/0/0, aspect 16:9, PAR 1:1, color profile: 1-1-1, chroma location: left [23:51:28] Freed 1 buffers of size 1024 [23:51:28] Freed 1 buffers of size 4096 [23:51:28] Freed 1 buffers of size 131072 [23:51:28] Freed 1 buffers of size 262144 [23:51:28] Freed 1 buffers of size 524288 [23:51:28] Freed 2 buffers of size 4194304 [23:51:28] Allocated 9311232 bytes of buffers on this pass and Freed 9311232 bytes, 0 bytes leaked [23:51:28] thread 14c707ffe640 exited ("scan") [23:51:28] thread 14c707ffe640 joined ("scan") [23:51:28] libhb: scan thread found 1 valid title(s)

  • Using preset: CLI Default
  • title 1:
    • stream: /mnt/Convert/Input/Video-1.mkv
    • duration: 01:51:26
    • size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
    • autocrop: 138/138/0/0
    • chapters:
      • 1: duration 01:51:26
    • audio tracks:
      • 1, English (TrueHD) (5.1 ch) (iso639-2: eng)
    • subtitle tracks: [23:51:29] thread 14c707ffe640 started ("work") [23:51:29] Starting work at: Tue Sep 19 23:51:29 2023

[23:51:29] 1 job(s) to process [23:51:29] json job: { "Audio": { "AudioList": [ { "Bitrate": 128, "CompressionLevel": -1.0, "DRC": 0.0, "DitherMethod": 0, "Encoder": 1327310848, "Gain": 0.0, "Mixdown": 0, "Name": "Surround 5.1", "NormalizeMixLevel": false, "PresetEncoder": "av_aac", "Quality": -3.0, "Samplerate": 0, "Track": 0 } ], "CopyMask": [ "copy:aac", "copy:ac3", "copy:eac3", "copy:dtshd", "copy:dts", "copy:mp3", "copy:truehd", "copy:flac" ], "FallbackEncoder": "flac24" }, "Destination": { "AlignAVStart": false, "ChapterList": [ { "Duration": { "Hours": 1, "Minutes": 51, "Seconds": 26, "Ticks": 601756200 }, "Name": "" } ], "ChapterMarkers": false, "File": "/mnt/Convert/Output/Video-1.mkv", "InlineParameterSets": false, "Mp4Options": { "IpodAtom": false, "Mp4Optimize": false }, "Mux": "mkv" }, "Filters": { "FilterList": [ { "ID": 7, "Settings": { "mode": 1 } }, { "ID": 14, "Settings": { "crop-bottom": 138, "crop-left": 0, "crop-right": 0, "crop-top": 138, "height": 804, "width": 1920 } } ] }, "Metadata": {}, "PAR": { "Den": 1, "Num": 1 }, "SequenceID": 0, "Source": { "Angle": 0, "Path": "/mnt/Convert/Input/Video-1.mkv", "Range": { "End": 1, "Start": 1, "Type": "chapter" }, "Title": 1 }, "Subtitle": { "Search": { "Burn": true, "Default": false, "Enable": false, "Forced": false }, "SubtitleList": [] }, "Video": { "ChromaLocation": 1, "ColorInputFormat": 0, "ColorMatrix": 1, "ColorOutputFormat": 0, "ColorPrimaries": 1, "ColorRange": 1, "ColorTransfer": 1, "Encoder": "x265_10bit", "HardwareDecode": 0, "Options": "no-strong-intra-smoothing:no-sao:aq-mode=3", "Preset": "medium", "QSV": { "AdapterIndex": 0, "AsyncDepth": 0, "Decode": false }, "Quality": 20.0, "Turbo": false, "TwoPass": false } } [23:51:29] Starting Task: Encoding Pass [23:51:29] Auto Passthru: allowed codecs are AAC, AC3, E-AC3, TrueHD, DTS, DTS-HD, MP3, FLAC [23:51:29] Auto Passthru: fallback is FLAC 24-bit [23:51:29] Auto Passthru: using TrueHD Passthru for track 1 [23:51:29] job configuration: [23:51:29] * source [23:51:29] + /mnt/Convert/Input/Video-1.mkv [23:51:29] + title 1, chapter(s) 1 to 1 [23:51:29] + container: matroska,webm [23:51:29] + data rate: 31231 kbps [23:51:29] * destination [23:51:29] + /mnt/Convert/Output/Video-1.mkv [23:51:29] + container: Matroska (libavformat) [23:51:29] * video track [23:51:29] + decoder: h264 8-bit (yuv420p) [23:51:29] + filters [23:51:29] + Framerate Shaper (mode=1) [23:51:29] + frame rate: 23.976 fps -> constant 23.976 fps [23:51:29] + AVFilter (crop='x=0:y=138:w=1920:h=804',zscale='width=1920:height=804:filter=lanczos',format='pix_fmts=yuv420p') [23:51:29] + crop: x=0, y=138, w=1920, h=804 [23:51:29] + zscale: width=1920, height=804, filter=lanczos [23:51:29] + format: pix_fmts=yuv420p [23:51:29] + Crop and Scale (width=1920:height=804:crop-top=138:crop-bottom=138:crop-left=0:crop-right=0) [23:51:29] + source: 1920 * 1080, crop (138/138/0/0): 1920 * 804, scale: 1920 * 804 [23:51:29] + Output geometry [23:51:29] + storage dimensions: 1920 x 804 [23:51:29] + pixel aspect ratio: 1 : 1 [23:51:29] + display dimensions: 1920 x 804 [23:51:29] + encoder: H.265 10-bit (libx265) [23:51:29] + preset: medium [23:51:29] + options: no-strong-intra-smoothing:no-sao:aq-mode=3 [23:51:29] + quality: 20.00 (RF) [23:51:29] + color profile: 1-1-1 [23:51:29] + chroma location: left [23:51:29] * audio track 1 [23:51:29] + name: Surround 5.1 [23:51:29] + decoder: English (TrueHD) (5.1 ch) (track 1, id 0x1) [23:51:29] + samplerate: 48000 Hz [23:51:29] + TrueHD Passthru [23:51:29] sync: expecting 160308 video frames [23:51:29] thread 14c7063f0640 started ("Audio Synchronization") x265 [info]: HEVC encoder version 3.5+1-f0c1022b6 x265 [info]: build info [Linux][GCC 12.1.0][64 bit] 10bit x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 x265 [info]: Main 10 profile, Level-4 (Main tier) x265 [info]: Thread pool created using 8 threads x265 [info]: Slices : 1 x265 [info]: frame threads / pool features : 3 / wpp(13 rows) x265 [info]: Coding QT: max CU size, min CU size : 64 / 8 x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra x265 [info]: ME / range / subpel / merge : hex / 57 / 2 / 3 x265 [info]: Keyframe min / max / scenecut / bias : 24 / 240 / 40 / 5.00 x265 [info]: Lookahead / bframes / badapt : 20 / 4 / 2 x265 [info]: b-pyramid / weightp / weightb : 1 / 1 / 0 x265 [info]: References / ref-limit cu / depth : 3 / off / on x265 [info]: AQ: mode / str / qg-size / cu-tree : 3 / 1.0 / 32 / 1 x265 [info]: Rate Control / qCompress : CRF-20.0 / 0.60 x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip mode=1 signhide tmvp x265 [info]: tools: b-intra lslices=5 deblock [23:51:29] Writing Metadata to output file... [23:51:29] thread 14c70474a640 started ("Muxer") [23:51:29] thread 14c704549640 started ("Reader") [23:51:29] ffmpeg_read starting chapter 1 at 0 [23:51:29] thread 14c704348640 started ("Audio decoder (libavcodec)") [23:51:29] thread 14c6effff640 started ("Video decoder (libavcodec)") [23:51:29] thread 14c6efdfe640 started ("Video Synchronization") [23:51:29] thread 14c6efbfd640 started ("H.265/HEVC encoder (libx265)") [23:51:29] thread 14c6ef9fc640 started ("Muxer") [23:51:29] New SCR: type Audio id 1 scr seq 1 scr offset 0 start 0 last 0.000000 dur 0.000000 [23:51:29] thread 14c6ef7fb640 started ("Framerate Shaper") [23:51:29] sync: first pts audio 0x1 is 0 [23:51:29] thread 14c6ef5fa640 started ("AVFilter") [23:51:29] sync: first pts video is 0 [23:51:29] sync: Chapter 1 at frame 1 time 0

snake3ca avatar Dec 06 '23 00:12 snake3ca

CPU does not support AVX512.

snake3ca avatar Dec 06 '23 00:12 snake3ca

Any video that fails will usually convert on 2nd attempt. Converting the same videos using FFMPEG never fails.

snake3ca avatar Dec 06 '23 00:12 snake3ca

Can you try without the scale & crop?

galad87 avatar Dec 06 '23 08:12 galad87

Next time I get a failure I will try without scale & crop.

snake3ca avatar Dec 09 '23 03:12 snake3ca

I tested without scale & crop and it still crashes on occasion.

snake3ca avatar Dec 31 '23 23:12 snake3ca

Hi. I don't know if it's related but i'm having the exact same error after some upgrades on my system (arch linux, installed via their package repo. The flatpak version works fine).

Rebooting didn't do anything. Neither downgrading from 1.7.3 to 1.7.2

Here's what I got with gdb :

Thread 1 "ghb" received signal SIGSEGV, Segmentation fault.
0x00007ffff7cb9dc7 in g_menu_exporter_menu_free (menu=0x0) at ../glib/gio/gmenuexporter.c:121
Downloading source file /usr/src/debug/glib2/build/../glib/gio/gmenuexporter.c
121       g_menu_exporter_group_remove_menu (menu->group, menu->id);   

jmfergeau avatar May 10 '24 11:05 jmfergeau

After inspection, it seems the fault comes from appmenu-gtk-module. If this package is not installed, handbrake will report a Failed to load module "appmenu-gtk-module" but will still work as intended.

jmfergeau avatar May 12 '24 09:05 jmfergeau

@jmfergeau's solution also applies to liferea, so this seems to be a third-party issue, either with the Arch packagers or appmenu-gtk-module.

MothWaves avatar May 14 '24 18:05 MothWaves