﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	mlocked
13068	Scheduler crashes before recording starts after backend has been running for a few days	WilliamDeRieux@…	gigem	"Could be related to ticket (since that issue is only 6 days old): https://code.mythtv.org/trac/ticket/13062
Although that issue is related to the scheduler not scheduling new recordings
unless the backend was restarted..

This crash happended 1 minute prior to a recording being started and the backtrace has been included.
The issues seems to happen after the backend has been running for a few days -- if it is restarted then new recordings are handled correctly and it does not cause a crash.

I am curently running mythbackend now with (gdb --args mythbackend --loglevel debug -v schedule)
and will post a more informative backtrace, but this is what I have for now...

$ mythbackend --version
{{{
Please attach all output as a file in bug reports.
MythTV Version : v0.28.1-37-g457a417f40-dirty
MythTV Branch : fixes/0.28
Network Protocol : 88
Library API : 0.28.20161120-1
QT Version : 5.7.1
Options compiled in:
 linux debug use_hidesyms using_alsa using_pulse using_backend using_bdjava using_bindings_perl using_bindings_python using_bindings_php using_crystalhd using_dvb using_firewire using_frontend using_hdhomerun using_vbox using_ceton using_hdpvr using_ivtv using_joystick_menu using_libcec using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_lirc using_mheg using_opengl using_opengl_video using_opengl_themepainter using_qtwebkit using_qtscript using_qtdbus using_sdl using_taglib using_v4l2 using_x11 using_xrandr using_xv using_debugtype using_systemd_notify using_bdjava using_bindings_perl using_bindings_python using_bindings_php using_fontconfig using_freetype2 using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2
}}}

$ gdb mythbackend
backtrace:
{{{
2017-07-12 21:59:00.000610 I  New DB connection, total: 6

Thread 10 ""Scheduler"" received signal SIGPIPE, Broken pipe.
[Switching to Thread 0x7fffc97fa700 (LWP 9058)]
0x00007fffea53861f in __libc_send (fd=47, buf=0x7fffac0131e8, n=5, flags=0) at ../sysdeps/unix/sysv/linux/x86_64/send.c:26
26	../sysdeps/unix/sysv/linux/x86_64/send.c: No such file or directory.
(gdb) bt
#0  0x00007fffea53861f in __libc_send (fd=47, buf=0x7fffac0131e8, n=5, flags=0) at ../sysdeps/unix/sysv/linux/x86_64/send.c:26
#1  0x00007fffd8670c2d in  () at /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
#2  0x00007fffd864c8f9 in  () at /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
#3  0x00007fffd864cbe3 in  () at /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
#4  0x00007fffd864d292 in  () at /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
#5  0x00007fffd8644a04 in  () at /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
#6  0x00007fffd8642008 in mysql_select_db () at /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
#7  0x00007fffd864204a in mysql_close () at /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18
#8  0x00007ffff7feba51 in  () at /usr/lib/x86_64-linux-gnu/qt5/plugins/sqldrivers/libqsqlmysql.so
#9  0x00007ffff3cc649b in MSqlDatabase::~MSqlDatabase() (this=0x7fffac002d90, __in_chrg=<optimized out>) at mythdbcon.cpp:102
#10 0x00007ffff3cc8c59 in MDBManager::PurgeIdleConnections(bool) (this=0x555555a38db0, leaveOne=true) at mythdbcon.cpp:427
#11 0x00007ffff3cc8071 in MDBManager::popConnection(bool) (this=0x555555a38db0, reuse=true) at mythdbcon.cpp:300
#12 0x00007ffff3cc9d13 in MSqlQuery::InitCon(MSqlQuery::ConnectionReuse) (_reuse=MSqlQuery::kNormalConnection) at mythdbcon.cpp:545
#13 0x00007ffff3cd443a in MythDB::GetSetting(QString const&, QString const&) (this=0x555555a376c0, _key=..., defaultval=...) at mythdb.cpp:392
#14 0x00007ffff3cd5836 in MythDB::GetNumSetting(QString const&, int) (this=0x555555a376c0, key=..., defaultval=300) at mythdb.cpp:560
#15 0x00007ffff3d0124c in MythCoreContext::GetNumSetting(QString const&, int) (this=0x555555a2cec0, key=..., defaultval=300) at mythcorecontext.cpp:868
#16 0x0000555555641ccd in Scheduler::run() (this=0x555555a71fc0) at scheduler.cpp:2051
#17 0x00007ffff3caaf75 in MThreadInternal::run() (this=0x555555a69410) at mthread.cpp:79
#18 0x00007fffea7f3da8 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#19 0x00007fffea52f494 in start_thread (arg=0x7fffc97fa700) at pthread_create.c:333
#20 0x00007fffe99d4aff in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
}}}

"	Bug Report - Crash	closed	major	0.28.2	MythTV - Scheduling	0.28.1	medium	Invalid			0
