Segmentation fault on Arch Linux

The place to discuss linux version of MakeMKV
chowbok
Posts: 12
Joined: Sun May 13, 2018 2:02 pm

Segmentation fault on Arch Linux

Post by chowbok »

Hello,

Since upgrading glibc to 2.36, makemkv dies with a segmentation fault soon after startup. Seems to be happening to everyone on Arch Linux: see https://aur.archlinux.org/packages/makemkv.

Anything I can do to help debug this?
timeshifter
Posts: 20
Joined: Wed Aug 01, 2018 7:13 pm

Re: Segmentation fault on Arch Linux

Post by timeshifter »

I can confirm this. Workaround with snap (or flatpak) is an option, but only for running the GUI or makemkvcon. This bug also breaks direct disc playback with libmmbd, so there is a lot of secondary breakage that is harder to workaround.
Master of Thyme and Spice
:D Registered User :D
bickman2k
Posts: 3
Joined: Thu Jul 14, 2022 3:10 pm

Re: Segmentation fault on Arch Linux

Post by bickman2k »

Also confirming this on Arch Linux. I was able to get a gdb trace.log file, but I'm certainly not getting a lot of information from it.
Attachments
trace.log
(2.63 KiB) Downloaded 184 times
bickman2k
Posts: 3
Joined: Thu Jul 14, 2022 3:10 pm

Re: Segmentation fault on Arch Linux

Post by bickman2k »

This appears to have broken after the update to glibc to 2.36 in Arch. When I downgraded to 2.35, the software was functional again.
chowbok
Posts: 12
Joined: Sun May 13, 2018 2:02 pm

Re: Segmentation fault on Arch Linux

Post by chowbok »

bickman2k wrote:
Wed Aug 10, 2022 5:30 pm
This appears to have broken after the update to glibc to 2.36 in Arch.
Which is why the first thing I said when I started this thread was "Since upgrading glibc to 2.36..."
bickman2k
Posts: 3
Joined: Thu Jul 14, 2022 3:10 pm

Re: Segmentation fault on Arch Linux

Post by bickman2k »

chowbok wrote:
Wed Aug 10, 2022 6:34 pm
bickman2k wrote:
Wed Aug 10, 2022 5:30 pm
This appears to have broken after the update to glibc to 2.36 in Arch.
Which is why the first thing I said when I started this thread was "Since upgrading glibc to 2.36..."
Probably helps if I re-read the thread when replying again... My bad.
Daren
Posts: 4
Joined: Thu Nov 12, 2020 9:39 am

Re: Segmentation fault on Arch Linux

Post by Daren »

It wreaks havoc for me when inserting a disc, as there is some mechanism that starts makemkvcon in the background when a new disc is inserted or a new drive is mounted to seek for BDMV structures, see here: https://aur.archlinux.org/packages/make ... ent-850099

It forcefully unmounts/breaks my local RAIDs for me when inserting a disc as it takes down something with it it seems.

Will uninstall this for now before it causes data corruption.
Techassi
Posts: 1
Joined: Wed Aug 10, 2022 10:50 pm

Re: Segmentation fault on Arch Linux

Post by Techassi »

The segfault seems to be related to append_utf8, strlen and GetAppString calls. LibC changed the behaviour when providing a NULL string in hardware accelerated code.

One patch which resolved some of the issues is:

Code: Select all

--- a/libmmbd/src/mmconn.cpp
+++ b/libmmbd/src/mmconn.cpp
@@ -74,9 +74,10 @@ CMMBDConn::~CMMBDConn()
 
 static char* append_utf8(char* pd,char* pe,const char* p)
 {
-    size_t len;
-
-    len = strlen(p);
+    if (p == NULL) {
+        return pd;
+    }
+    size_t len = strlen(p);
 
     if (len>=((size_t)(pe-pd))) return pd;
 

This basically adds a NULL check which then returns the original string pd. This fix solved the issues I were having with bd_info. After applying the patch, bd_info printed the correct information.

But there is still a further issue: the function GetAppString of the class CApClient returns NULL when the first argument of the shared memory (I'm guessing here) is 0. This causes a crash (segfault) when this function is called with the argument AP_vastr_KeyType (Line 133 in libmmbd/src/mmconn.cpp). I did not fix this issue as it was getting late and I was tired of hunting these issues.

The obvious fix is to not use any NULL strings and instead use empty "" strings. This requires a fix from the devs across the whole codebase.
timeshifter
Posts: 20
Joined: Wed Aug 01, 2018 7:13 pm

Re: Segmentation fault on Arch Linux

Post by timeshifter »

The analysis you posted is great. Thanks very much for that.

I would say that this issue points to a wider problem with the project, which is that it seems to be a one person show, and while it wears the robes of openness, ultimately the project isn't very open.

There is no real dialog between the developer and the community.

There is no real roadmap for the project.

It is a pain in the bum to integrate this project into any libraries because it all boils down to parsing the output of --robot.

I appreciate the value of this project, but it seems to me it could be so much better if a few things were changed.

As a paid contributor, I can say I am very disappointed with what my contribution has brought.

Time to step it up a bit, in my humble opinion.
Master of Thyme and Spice
:D Registered User :D
AllesMeins
Posts: 4
Joined: Wed Mar 06, 2013 8:03 pm

Re: Segmentation fault on Arch Linux

Post by AllesMeins »

I've the same issue - hope this gets fixed fast because currently I can't use the program at all...
quahoac
Posts: 1
Joined: Sun Aug 14, 2022 2:09 pm

Re: Segmentation fault on Arch Linux

Post by quahoac »

My workaround was to create a chroot with the old glibc and such inside of it.
odecif
Posts: 2
Joined: Mon Aug 15, 2022 7:36 am

Re: Segmentation fault on Arch Linux

Post by odecif »

Same issue on Manjaro with glib 2.36-1. I really hope that this can be fixed in a timely manner, just bought a bag of DVD's off a second hand store :)
sl1pkn07
Posts: 9
Joined: Sun Jul 10, 2016 3:04 pm

Re: Segmentation fault on Arch Linux

Post by sl1pkn07 »

Same problem here

any funtional patch for fix this until devs fix it in upstream? downgrade glibc is not a option

greetings
mikewilzn
Posts: 6
Joined: Thu Jun 09, 2022 6:50 pm

Re: Segmentation fault on Arch Linux

Post by mikewilzn »

odecif wrote:
Mon Aug 15, 2022 7:40 am
Same issue on Manjaro with glib 2.36-1. I really hope that this can be fixed in a timely manner, just bought a bag of DVD's off a second hand store :)
If you're only ripping DVDs, why not use one of the numerous other projects that do that?
odecif
Posts: 2
Joined: Mon Aug 15, 2022 7:36 am

Re: Segmentation fault on Arch Linux

Post by odecif »

mikewilzn wrote:
Wed Aug 17, 2022 7:14 pm
odecif wrote:
Mon Aug 15, 2022 7:40 am
Same issue on Manjaro with glib 2.36-1. I really hope that this can be fixed in a timely manner, just bought a bag of DVD's off a second hand store :)
If you're only ripping DVDs, why not use one of the numerous other projects that do that?
Probably a matter of laziness and principle. I have a lovely way of doing it (MakeMKV) and have been doing it for years, and also I've paid for it (hence principle).

Sure, if I was in a rush I'd probably use another tool for this operation but for now it doesn't really matter enough in order to learn a new way of doing things. Great link though! Might help others in a bit more pressed situation than me.

(Btw, issue still in glibc 2.36-2.)
Post Reply