segfault opening blu ray disc makemkv 1.10.8 + linux kodi18

The place to discuss linux version of MakeMKV
Post Reply
delleceste
Posts: 2
Joined: Sat Dec 16, 2017 1:09 pm

segfault opening blu ray disc makemkv 1.10.8 + linux kodi18

Post by delleceste » Sat Dec 16, 2017 1:26 pm

Hello.

I'm using kodi + makemkv to open Blu Ray and DVDs on Linux with this symbolic links:
ln -sf /usr/lib/libmbd.so.0 /usr/lib/libaacs.so.0
ln -sf /usr/lib/libmbd.so.0 /usr/lib/libbdplus.so.0

as described here

http://www.makemkv.com/forum2/viewtopic.php?f=3&t=7009

Opening blu ray disc from both "DISC" entry in the main menu or navigating through mounted BD structure and selecting index.bdmv immediately crashes kodi with

kodi-x11[1028]: segfault at 0 ip 00007f8bfe78e4b1 sp 00007ffef0754dd8 error 4 in libc-2.26.so[7f8bfe637000+1ae000]

I use makemkv beta 1.10.8 linux x86_64

Arch Linux 4.13.12-1-ARCH

Kodi v.17 used to work with the same makemkv version (and older)

I have the following links in /usr/lib :

-rw-r--r-- 1 root root 34480 Nov 20 16:32 libmmbd.so.0 -rw-r--r-- 1 root root 792424 Nov 20 16:32 libmakemkv.so.1 -rw-r--r-- 1 root root 26384 Nov 20 16:32 libdriveio.so.0 lrwxrwxrwx 1 root root 20 Nov 20 16:33 libbdplus.so.0 -> /usr/lib/libmbd.so.0 lrwxrwxrwx 1 root root 20 Nov 20 16:33 libaacs.so.0 -> /usr/lib/libmbd.so.0

to make kodi open encrypted blu ray discs.

Since the backtrace points to makemkv methods, and the KODI developers closed the issue I had opened stating it's
"third party" issue, I try to ask here...

Let me know if I can help somehow.

Giacomo, Italy.
Attachments
kodi_crashlog-20171120_180411.txt
(55.12 KiB) Downloaded 114 times

mosquitogang201
Posts: 5
Joined: Sat Dec 23, 2017 3:43 am

Re: segfault opening blu ray disc makemkv 1.10.8 + linux kod

Post by mosquitogang201 » Sat Dec 23, 2017 4:05 am

I also am getting the same segfault using kodi 18 + makemkv.

It seems that kodi 18 has added a call to bd_open_files from libbluray, which was not present in kodi 17. This was added in commit https://github.com/xbmc/xbmc/commit/25d ... ae895fc2ec. The stack trace (attached) leads from bd_open_files() to mmbd_open(). Makemkv works perfectly with mpv, which does not contain a call to bd_open_files. Kodi does not crash with libaacs instead and makemkv removed, which leads me to ask for help finding a fix here.

I'll be happy to help, if there's something I can do.
Attachments
kodi_crashlog-20171222_171008.log
(77.4 KiB) Downloaded 119 times

mosquitogang201
Posts: 5
Joined: Sat Dec 23, 2017 3:43 am

Re: segfault opening blu ray disc makemkv 1.10.8 + linux kod

Post by mosquitogang201 » Wed Dec 27, 2017 3:42 am

More information. It seems that libaacs allows and still functions with a NULL device path passed to aacs_open_device(). With libmmbd, aacs_open_device() requires a valid non-NULL device path. The NULL device path initiates in libbluray/bluray.c/bd_open_files(), which calls _bd_open with the NULL path, seemingly intentionally.

For a workaround I added the line

Code: Select all

if (!locator) { locator="/dev/sr0"; }
to makemkv-oss-1.10.8/libmmbd/src/mmbd.cpp near the beginning of mmbd_open(), directly below "if (mmbd=NULL) return -1;" (line 88), and recompiled libmmbd. Locator can either be a mount path or a /dev file. This applies a hardcoded path whenever a NULL device path is given. Being hardcoded it isn't a proper fix, but it's good enough for my use case and now I can watch blurays in Kodi 18.

Post Reply