Page 1 of 4
Segmentation fault on Arch Linux
Posted: Fri Aug 05, 2022 8:02 pm
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?
Re: Segmentation fault on Arch Linux
Posted: Sun Aug 07, 2022 8:36 pm
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.
Re: Segmentation fault on Arch Linux
Posted: Mon Aug 08, 2022 4:45 pm
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.
Re: Segmentation fault on Arch Linux
Posted: Wed Aug 10, 2022 5:30 pm
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.
Re: Segmentation fault on Arch Linux
Posted: Wed Aug 10, 2022 6:34 pm
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..."
Re: Segmentation fault on Arch Linux
Posted: Wed Aug 10, 2022 7:01 pm
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.
Re: Segmentation fault on Arch Linux
Posted: Wed Aug 10, 2022 7:07 pm
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.
Re: Segmentation fault on Arch Linux
Posted: Thu Aug 11, 2022 9:23 am
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.
Re: Segmentation fault on Arch Linux
Posted: Thu Aug 11, 2022 9:06 pm
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.
Re: Segmentation fault on Arch Linux
Posted: Fri Aug 12, 2022 4:07 pm
by AllesMeins
I've the same issue - hope this gets fixed fast because currently I can't use the program at all...
Re: Segmentation fault on Arch Linux
Posted: Sun Aug 14, 2022 2:11 pm
by quahoac
My workaround was to create a chroot with the old glibc and such inside of it.
Re: Segmentation fault on Arch Linux
Posted: Mon Aug 15, 2022 7:40 am
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
Re: Segmentation fault on Arch Linux
Posted: Tue Aug 16, 2022 3:23 pm
by sl1pkn07
Same problem here
any funtional patch for fix this until devs fix it in upstream? downgrade glibc is not a option
greetings
Re: Segmentation fault on Arch Linux
Posted: Wed Aug 17, 2022 7:14 pm
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?
Re: Segmentation fault on Arch Linux
Posted: Thu Aug 18, 2022 9:03 am
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.)