It's me again, trying to get Kodi to work on ArchLinuxARM on my Odroid-XU ! In the last episode, we fixed CEC after audio, so Kodi now boots up and is usable, BUT it seems that adding new items to the Kodi library makes Kodi crash !
In order to reproduce the bug, just compile Kodi from Oversun's source, using appropriate flags - here are mine :
- Code: Select all
./configure --enable-libcec \
Then add to the library a folder containing a few movies -at least this type of item caused the bug on my side-, wait for it to finish scanning the folder... It crashes straight after the end of the scan. A bit unexpected behavior, but still that might be just a crash for any other reason. So let's try to launch Kodi again. The logo appears on the screen, CEC gets initialized, and just when the home screen wallpaper appears (you know, the blue bubbles), Kodi crashes because of a segmentation fault. How disappointing !
Nothing special to notice in the log files, except the last line which is ALWAYS the same, proving something goes wrong straight after it :
- Code: Select all
[.... blah blah blah, initalizing shaders, CEC, ....]
12:06:46 T:3021590528 DEBUG: ------ Window Init (DialogKaiToast.xml) ------
12:06:46 T:3021590528 DEBUG: Window DialogKaiToast.xml was already loaded
12:06:46 T:3021590528 DEBUG: Alloc resources: 0.01ms
12:06:46 T:2811229024 DEBUG: RunQuery took 34 ms for 10 items query: select * from movie_view ORDER BY dateAdded desc, idMovie desc LIMIT 10
The very latest line of the log is a query made to the database. It aims at getting the 10 latest movies added to the hard drive, in order to provide quick access to them through thumbnails. The database is not corrupt, as opening it through SQLite (it is locacted in /home/me/.kodi/userdata/Database/MyVideos99.db) and executing the request works properly (in fact, the log files indicate us that it worked properly as it gives us the time taken to run it).
That said, requesting a backtrace through GDB (wooo, debugging !) seems to indicate something goes wrong with the database :
- Code: Select all
#0 0xb564cf20 in std::local_Rb_tree_decrement (__x=0x171a764 <_ZStL19piecewise_construct>) at /build/gcc/src/gcc-5-20160209/libstdc++-v3/sr/c++98/tree.cc:98
#1 0x0045d9d4 in std::_Rb_tree_iterator<std::pair<Field const, CVariant> >::operator-- (this=<synthetic pointer>) at /usr/include/c++/5.3./bits/stl_tree.h:220
#2 std::_Rb_tree<Field, std::pair<Field const, CVariant>, std::_Select1st<std::pair<Field const, CVariant> >, std::less<Field>, std::allocator<std::pair<Field const, CVariant> > >::_M_get_insert_hint_unique_pos (__k=@0xb2b99fb8: -1296476504, __position=..., this=0xabff3c50) at /usr/include/c++/5.3.0/bits/stl_tree.h:1924
#3 std::_Rb_tree<Field, std::pair<Field const, CVariant>, std::_Select1st<std::pair<Field const, CVariant> >, std::less<Field>, std::allocator<std::pair<Field const, CVariant> > >::_M_emplace_hint_unique<std::piecewise_construct_t const&, std::tuple<Field&&>, std::tuple<> >(std::_Rb_tree_const_iterator<std::pair<Field const, CVariant> >, std::piecewise_construct_t const&, std::tuple<Field&&>&&, std::tuple<>&&) (this=0xabff3c50, this@entry=0xb41a0aa4, __pos=...,
__pos@entry=<error reading variable: Cannot access memory at address 0x10>) at /usr/include/c++/5.3.0/bits/stl_tree.h:2174
#4 0x00b51848 in std::map<Field, CVariant, std::less<Field>, std::allocator<std::pair<Field const, CVariant> > >::operator(Field&&) (
__k=<unknown type in /usr/local/lib/kodi/kodi.bin, CU 0x680c5f3, DIE 0x683ff10>, this=0xb41a0aa4) at /usr/include/c++/5.3.0/bits/stl_map.h:502
#5 DatabaseUtils::GetDatabaseResults (mediaType="", fields=std::vector of length 0, capacity 0, dataset=std::unique_ptr<dbiplus::Dataset> containing 0xac4f0030,
results=std::vector of length 0, capacity 10) at DatabaseUtils.cpp:374
#6 0x00b98c34 in SortUtils::SortFromDataset (sortDescription=..., mediaType="movie", dataset=std::unique_ptr<dbiplus::Dataset> containing 0xac4f0030,
results=std::vector of length 0, capacity 10) at SortUtils.cpp:758
#7 0x0041d444 in CVideoDatabase::GetMoviesByWhere (
this=0x41d444 <CVideoDatabase::GetMoviesByWhere(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, CDatabase::Filter const&, CFileItemList&, SortDescription const&)+780>, this@entry=0xabff544c, strBaseDir=<error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.>,
filter=..., items=..., sortDescription=...) at VideoDatabase.cpp:6162
#8 0x0041e3c8 in CVideoDatabase::GetRecentlyAddedMoviesNav (this=this@entry=0xabff544c,
strBaseDir=<error reading variable: Cannot create a lazy string with address 0x0, and a non-zero length.>, items=..., limit=limit@entry=10) at VideoDatabase.cpp:6474
#9 0x00b78e80 in CRecentlyAddedJob::UpdateVideo () at RecentlyAddedJob.cpp:60
#10 0x00b84168 in CRecentlyAddedJob::DoWork (this=0x2fb8e00) at RecentlyAddedJob.cpp:354
#11 0x00b5eb80 in CJobWorker::Process (this=0x2fde460) at JobManager.cpp:66
#12 0x0168e21c in CThread::Action (this=0x2fde460) at Thread.cpp:221
#13 0x0168e4ec in CThread::staticThread (data=0x2fde460) at Thread.cpp:131
#14 0xb68a0f78 in start_thread () from /usr/lib/libpthread.so.0
#15 0xb5529a80 in ?? () from /usr/lib/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
In fact, it is probably not the above request, but it is likely to be something executed right after. The backtrace is not very helpful about it in fact, but it seems the bug occurs when Kodi attempts sorting the results.
This seems to be a common issue as it a was also reported on another board with another OS, so I think it might be worth investigating !
Thanks in advance for your help !