On Sat, 3 Nov 2018 09:30:08 -0500 Michael Cronenworth via samba <samba at lists.samba.org> wrote:> On 11/2/18 4:29 PM, Michael Cronenworth via samba wrote: > > > > A compiler bug is also possible. When I have time I'll try to > > rebuild Samba with -O0 to make sure it isn't an optimization issue. > > When I built with -O0 the backtrace changed. > > #0 0x00007ff699ec153f in raise () from /lib64/libc.so.6 > #1 0x00007ff699eab895 in abort () from /lib64/libc.so.6 > #2 0x00007ff696b19925 in generate_random_buffer (out=0x7ffe0422a426 > <incomplete sequence \352>, > len=2) at ../lib/util/genrand.c:50 > #3 0x00007ff699280357 in generate_trn_id () > at ../source3/libsmb/namequery.c:249 #4 0x00007ff699283332 in > name_query_send (mem_ctx=0x55788a265200, ev=0x55788b8424e0, > name=0x7ff69c731e2b "\001\002__MSBROWSE__\002", name_type=1, > bcast=true, recurse=true, addr=0x55788a014360) > at ../source3/libsmb/namequery.c:1276 (snip) > > (gdb) p rw_ret > $1 = 0 > (gdb) p len > $2 = 2 > > Looking at the way genrand.c is coded it should be using the > read_data() function from sys_rw_data.c. When I debug the read_data > call it is calling it ends up in a read_data() function from a > third-party library: > > Thread 1 "kodi-x11" hit Breakpoint 1, 0x00007f2d03da3450 in read_data > () from /lib64/libtspi.so.1 > (gdb) bt > #0 0x00007f2d03da3450 in read_data () from /lib64/libtspi.so.1 > #1 0x00007f2cfdc08911 in generate_random_buffer (out=0x7ffd3bb0f636 > "", len=2) at ../lib/util/genrand.c:48 > #2 0x00007f2d0036f357 in generate_trn_id () > at ../source3/libsmb/namequery.c:249 #3 0x00007f2d00372332 in > name_query_send (mem_ctx=0x55f72a04e0d0, ev=0x55f72ab47650, > name=0x7f2d03820e2b "\001\002__MSBROWSE__\002", name_type=1, > bcast=true, recurse=true, addr=0x55f729dfd360) > at ../source3/libsmb/namequery.c:1276 (snip) > > The libtspi.so.1 library is from 'trousers-lib'. > > Are any of you compiling kodi with the 'trousers' library installed? > > Thanks, > Michael > >I didn't install it (either as 'trousers' or 'libtspi') and nothing I installed seems to have dragged it in either. I installed 18.0-BETA5 Git:20181102-d0a7c35877 Media Center Kodi on Devuan 2 Ascii (aka Debian stretch without systemd) Rowland
On Sat, 3 Nov 2018 15:12:37 +0000 Rowland Penny via samba <samba at lists.samba.org> wrote:> On Sat, 3 Nov 2018 09:30:08 -0500 > Michael Cronenworth via samba <samba at lists.samba.org> wrote: > > > On 11/2/18 4:29 PM, Michael Cronenworth via samba wrote: > > > > > > A compiler bug is also possible. When I have time I'll try to > > > rebuild Samba with -O0 to make sure it isn't an optimization > > > issue. > > > > When I built with -O0 the backtrace changed. > > > > #0 0x00007ff699ec153f in raise () from /lib64/libc.so.6 > > #1 0x00007ff699eab895 in abort () from /lib64/libc.so.6 > > #2 0x00007ff696b19925 in generate_random_buffer (out=0x7ffe0422a426 > > <incomplete sequence \352>, > > len=2) at ../lib/util/genrand.c:50 > > #3 0x00007ff699280357 in generate_trn_id () > > at ../source3/libsmb/namequery.c:249 #4 0x00007ff699283332 in > > name_query_send (mem_ctx=0x55788a265200, ev=0x55788b8424e0, > > name=0x7ff69c731e2b "\001\002__MSBROWSE__\002", name_type=1, > > bcast=true, recurse=true, addr=0x55788a014360) > > at ../source3/libsmb/namequery.c:1276 (snip) > > > > (gdb) p rw_ret > > $1 = 0 > > (gdb) p len > > $2 = 2 > > > > Looking at the way genrand.c is coded it should be using the > > read_data() function from sys_rw_data.c. When I debug the read_data > > call it is calling it ends up in a read_data() function from a > > third-party library: > > > > Thread 1 "kodi-x11" hit Breakpoint 1, 0x00007f2d03da3450 in > > read_data () from /lib64/libtspi.so.1 > > (gdb) bt > > #0 0x00007f2d03da3450 in read_data () from /lib64/libtspi.so.1 > > #1 0x00007f2cfdc08911 in generate_random_buffer (out=0x7ffd3bb0f636 > > "", len=2) at ../lib/util/genrand.c:48 > > #2 0x00007f2d0036f357 in generate_trn_id () > > at ../source3/libsmb/namequery.c:249 #3 0x00007f2d00372332 in > > name_query_send (mem_ctx=0x55f72a04e0d0, ev=0x55f72ab47650, > > name=0x7f2d03820e2b "\001\002__MSBROWSE__\002", name_type=1, > > bcast=true, recurse=true, addr=0x55f729dfd360) > > at ../source3/libsmb/namequery.c:1276 (snip) > > > > The libtspi.so.1 library is from 'trousers-lib'. > > > > Are any of you compiling kodi with the 'trousers' library installed? > > > > Thanks, > > Michael > > > > > > I didn't install it (either as 'trousers' or 'libtspi') and nothing I > installed seems to have dragged it in either. > > I installed 18.0-BETA5 Git:20181102-d0a7c35877 Media Center Kodi on > Devuan 2 Ascii (aka Debian stretch without systemd) > > Rowland >I think it may be because Debian uses libgnutls28-dev, whilst Fedora uses trousers Rowland
Michael Cronenworth
2018-Nov-03 19:00 UTC
[Samba] Kodi crashes when trying to browse network
On 11/3/18 11:10 AM, Rowland Penny via samba wrote:> I think it may be because Debian uses libgnutls28-dev, whilst Fedora > uses trousersIt seems to be a Kodi CMake issue, but I would argue Samba or trousers need to change the name of "read_data" to something more unique if it is going to be an exported shared symbol. Kodi requires libmicrohttpd. The libmicrohttpd library uses gnutls and Fedora's gnutls links against trousers. Fedora's gnutls pulls in trousers through dlopen(), but CMake is pulling in libtspi as a compile-time link and the linker is using read_data() from libtspi over the Samba copy. Versions 17.x of Kodi used autotools and didn't pull in libtspi. Version 18 relies soley on CMake. I have worked[1] around the problem by filtering out "tspi" from being added to the linker libraries in Kodi's CMake macros. Kodi no longer crashes. Thanks, Michael [1] https://pkgs.rpmfusion.org/cgit/free/kodi.git/diff/kodi-18-trousers.patch?id=005ee8fd5625beb9b95d06037ffe185c0e5e4fa0