Opened 18 years ago
Closed 18 years ago
#4249 closed defect (fixed)
mythfilldatabase segfaulting..
| Reported by: | Owned by: | Nigel | |
|---|---|---|---|
| Priority: | critical | Milestone: | 0.21 |
| Component: | mythfilldatabase | Version: | head |
| Severity: | medium | Keywords: | |
| Cc: | Ticket locked: | no |
Description
Mythfilldatabase is segfaulting. Do you need a backtrace or is below enough?
damian@mythtv-box:~$ mythfrontend --version Source code version : 15004 SVN Branch : trunk Library API version : 0.21.20071127-1 Network Protocol Version: 36 Options compiled in:
linux release using_oss using_alsa using_arts using_backend using_dvb using_frontend using_ivtv using_joystick_menu using_lirc using_opengl_vsync using_opengl_video using_v4l using_x11 using_xrandr using_xv using_xvmc using_xvmc_opengl using_bindings_perl using_opengl using_xvmc_pbuffer
damian@mythtv-box:~$ mythbackend --version Source code version : 15004 SVN branch : trunk Library API version : 0.21.20071127-1 Network Protocol Version: 36 Options compiled in:
linux release using_oss using_alsa using_arts using_backend using_dvb using_frontend using_ivtv using_joystick_menu using_lirc using_opengl_vsync using_opengl_video using_v4l using_x11 using_xrandr using_xv using_xvmc using_xvmc_opengl using_bindings_perl using_opengl using_xvmc_pbuffer
damian@mythtv-box:~$ mythfilldatabase -v all 2007-11-30 14:18:33.625 Using runtime prefix = /usr/local 2007-11-30 14:18:33.625 Using localhost value of mythtv-box 2007-11-30 14:18:33.626 MCP::DefaultUPnP() - config.xml has default PIN '' and host USN: uuid:785fe75f-4cd9-470e-a19e-223f7feddbc5::urn:schemas-mythtv-org:device:MasterMediaServer:1 2007-11-30 14:18:33.626 Setting UPnP client for backend autodiscovery... 2007-11-30 14:18:33.626 UPnp - Constructor 2007-11-30 14:18:33.627 ThreadPool:AddWorkerThread - HTTP_WorkerThread 2007-11-30 14:18:33.627 UPnp::Initialize - Begin 2007-11-30 14:18:33.627 UPnp::Initialize - Starting TaskQueue 2007-11-30 14:18:33.627 UPnp::Initialize - Creating SSDP Thread at port 6549 2007-11-30 14:18:33.628 UPnp::Initialize - End 2007-11-30 14:18:33.628 UPnp::Start - Starting SSDP Thread (Multicast) 2007-11-30 14:18:33.628 UPnp::Start - Enabling Notifications 2007-11-30 14:18:33.628 SSDP::EnableNotifications() - creating new task 2007-11-30 14:18:33.628 SSDP::EnableNotifications() - sending NTS_byebye 2007-11-30 14:18:33.628 LookupUDN()- bad device type, not enough tokens 2007-11-30 14:18:34.044 SSDP::EnableNotifications() - sending NTS_alive 2007-11-30 14:18:34.044 SSDP::EnableNotifications() - Task added to UPnP queue 2007-11-30 14:18:34.044 UPnp::Start - Returning 2007-11-30 14:18:34.181 UPnPconnect() - Trying host at http://192.168.1.100:6544/getDeviceDesc 2007-11-30 14:18:34.182 postHttp: grabbing: http://192.168.1.100:6544/Myth 2007-11-30 14:18:34.183 HttpComms::stateChanged: connecting (2) 2007-11-30 14:18:34.195 HttpComms::stateChanged: sending (3) 2007-11-30 14:18:34.206 HttpComms::stateChanged: reading (4) 2007-11-30 14:18:34.206 Got HTTP response: 200:OK 2007-11-30 14:18:34.206 Keys: accept-ranges,cache-control,connection,content-length,content-type,date,ext,server 2007-11-30 14:18:34.206 HttpComms::stateChanged: connected (5) 2007-11-30 14:18:34.206 done: 759 bytes 2007-11-30 14:18:34.217 Got 759 bytes from url: 'http://192.168.1.100:6544/Myth' 2007-11-30 14:18:34.217 <?xml version="1.0" encoding="utf-8"?> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:GetConnectionInfoResponse xmlns:u="urn:schemas-mythtv-org:service:MythTv:1"> <Info><Database><Host>localhost</Host><Port>0</Port><UserName>mythtv</UserName><Password>muaU8KrQ</Password><Name>mythconverg</Name><Type>QMYSQL3</Type></Database><WOL><Enabled>0</Enabled><Reconnect>0</Reconnect><Retry>5</Retry><Command>echo 'WOLsqlServerCommand not set'</Command></WOL></Info> </u:GetConnectionInfoResponse> </s:Body> </s:Envelope> 2007-11-30 14:18:34.218 UPnPconnect() - Got database hostname: localhost 2007-11-30 14:18:34.226 New DB connection, total: 1 2007-11-30 14:18:34.230 Connected to database 'mythconverg' at host: localhost 2007-11-30 14:18:34.230 Closing DB connection named 'DBManager0' 2007-11-30 14:18:34.230 Clearing Settings Cache. 2007-11-30 14:18:34.230 Deleting UPnP client... 2007-11-30 14:18:34.230 UPnp - Destructor 2007-11-30 14:18:34.231 UPnp::CleanUp() - disabling SSDP notifications Segmentation fault (core dumped)
Attachments (3)
Change History (16)
comment:1 by , 18 years ago
| Milestone: | unknown → 0.21 |
|---|---|
| Owner: | changed from to |
| Priority: | minor → critical |
| Version: | unknown → head |
comment:2 by , 18 years ago
I haven't been able to reproduce here, but this patch may help to narrow it down?
Index: upnptasknotify.cpp
===================================================================
--- upnptasknotify.cpp (revision 15013)
+++ upnptasknotify.cpp (working copy)
@@ -136,10 +136,18 @@
// ----------------------------------------------------------------------
UPnpDevice &device = UPnp::g_UPnpDeviceDesc.m_rootDevice;
+ QString sUDN = QDeepCopy<QString>(device.GetUDN());
- SendNotifyMsg( pMulticast, "upnp:rootdevice", device.GetUDN() );
-// SendNotifyMsg( pBroadcast, "upnp:rootdevice", device.GetUDN() );
+ if (sUDN == "uuid:")
+ {
+ VERBOSE(VB_IMPORTANT, "UPnpNotifyTask::Execute() - No root device?");
+ return;
+ }
+
+ SendNotifyMsg( pMulticast, "upnp:rootdevice", sUDN );
+// SendNotifyMsg( pBroadcast, "upnp:rootdevice", sUDN );
+
// ----------------------------------------------------------------------
// Process rest of notifications
// ----------------------------------------------------------------------
Index: ssdp.cpp
===================================================================
--- ssdp.cpp (revision 15013)
+++ ssdp.cpp (working copy)
@@ -374,7 +374,7 @@
QString sMX = GetHeaderValue( sHeaders, "MX" , "" );
int nMX = 0;
- //cout << "*** SSDP ProcessSearchrequest : [" << sST << "] MX = " << nMX << endl;
+ cout << "*** SSDP ProcessSearchrequest : [" << sST << "] MX = " << nMX << endl;
// ----------------------------------------------------------------------
// Validate Header Values...
comment:3 by , 18 years ago
comment:5 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Cool. There is probably one more bug in UPnpNotifyTask::SendNotifyMsg(), but for now I will close this
comment:6 by , 18 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
Think it might be biting me. Mythfilldatabase seems to work about 50% of the time. The rest it still segfaults.. Want a fresh backtrace?
D.
comment:7 by , 18 years ago
Try this patch first:
Index: upnptasknotify.cpp
===================================================================
--- upnptasknotify.cpp (revision 15014)
+++ upnptasknotify.cpp (working copy)
@@ -77,10 +77,10 @@
.arg( sUSN )
.arg( m_nMaxAge );
-// VERBOSE(VB_UPNP, QString("UPnpNotifyTask::SendNotifyMsg : %1 : %2 : %3")
-// .arg( pSocket->address().toString() )
-// .arg( sNT )
-// .arg( sUSN ));
+ VERBOSE(VB_UPNP, QString("UPnpNotifyTask::SendNotifyMsg : %1 : %2 : %3")
+ .arg( pSocket->address().toString() )
+ .arg( sNT )
+ .arg( sUSN ));
for ( QStringList::Iterator it = m_addressList.begin();
it != m_addressList.end();
@@ -92,6 +92,8 @@
"UPnpNotifyTask::SendNotifyMsg - NULL in m_addressList");
continue;
}
+ else
+ VERBOSE("UPnpNotifyTask::SendNotifyMsg() - address: " + *it);
QString sHeader = QString( "NOTIFY * HTTP/1.1\r\n"
"HOST: %1:%2\r\n"
@@ -136,10 +138,18 @@
// ----------------------------------------------------------------------
UPnpDevice &device = UPnp::g_UPnpDeviceDesc.m_rootDevice;
+ QString sUDN = QDeepCopy<QString>(device.GetUDN());
- SendNotifyMsg( pMulticast, "upnp:rootdevice", device.GetUDN() );
-// SendNotifyMsg( pBroadcast, "upnp:rootdevice", device.GetUDN() );
+ if (sUDN == "uuid:")
+ {
+ VERBOSE(VB_IMPORTANT, "UPnpNotifyTask::Execute() - No root device?");
+ //return;
+ }
+
+ SendNotifyMsg( pMulticast, "upnp:rootdevice", sUDN );
+// SendNotifyMsg( pBroadcast, "upnp:rootdevice", sUDN );
+
// ----------------------------------------------------------------------
// Process rest of notifications
// ----------------------------------------------------------------------
and please provide the -v all output.
comment:8 by , 18 years ago
Hope this helps..
damian@mythtv-box:~/SVN/trunk/mythtv$ mythfilldatabase -v all 2007-12-02 12:13:34.020 Using runtime prefix = /usr/local 2007-12-02 12:13:34.020 Using localhost value of mythtv-box 2007-12-02 12:13:34.021 MCP::DefaultUPnP() - config.xml has default PIN '2925' and host USN: uuid:785fe75f-4cd9-470e-a19e-223f7feddbc5::urn:schemas-mythtv-org:device:MasterMediaServer:1 2007-12-02 12:13:34.021 Setting UPnP client for backend autodiscovery... 2007-12-02 12:13:34.021 UPnp - Constructor 2007-12-02 12:13:34.022 ThreadPool:AddWorkerThread - HTTP_WorkerThread 2007-12-02 12:13:34.022 UPnp::Initialize - Begin 2007-12-02 12:13:34.022 UPnp::Initialize - Starting TaskQueue 2007-12-02 12:13:34.022 UPnp::Initialize - Creating SSDP Thread at port 6549 2007-12-02 12:13:34.023 UPnp::Initialize - End 2007-12-02 12:13:34.023 UPnp::Start - Starting SSDP Thread (Multicast) 2007-12-02 12:13:34.023 UPnp::Start - Enabling Notifications 2007-12-02 12:13:34.023 SSDP::EnableNotifications() - creating new task 2007-12-02 12:13:34.023 SSDP::EnableNotifications() - sending NTS_byebye 2007-12-02 12:13:34.023 LookupUDN(urn:schemas-upnp-org:device:MythContextClient:1) sName=UPnP/UDN/MythContextClient, sUDN= 2007-12-02 12:13:34.023 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : upnp:rootdevice : uuid:3a46b26f-37f1-4e62-9075-2990647e4dcf::upnp:rootdevice 2007-12-02 12:13:34.023 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 2007-12-02 12:13:34.263 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : uuid:3a46b26f-37f1-4e62-9075-2990647e4dcf : uuid:3a46b26f-37f1-4e62-9075-2990647e4dcf 2007-12-02 12:13:34.263 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 2007-12-02 12:13:34.382 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : urn:schemas-upnp-org:device:MythContextClient:1 : uuid:3a46b26f-37f1-4e62-9075-2990647e4dcf::urn:schemas-upnp-org:device:MythContextClient:1 2007-12-02 12:13:34.382 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 2007-12-02 12:13:34.615 SSDP::EnableNotifications() - sending NTS_alive 2007-12-02 12:13:34.615 SSDP::EnableNotifications() - Task added to UPnP queue 2007-12-02 12:13:34.615 UPnp::Start - Returning 2007-12-02 12:13:34.624 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : upnp:rootdevice : uuid:3a46b26f-37f1-4e62-9075-2990647e4dcf::upnp:rootdevice 2007-12-02 12:13:34.624 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 2007-12-02 12:13:34.786 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : uuid:3a46b26f-37f1-4e62-9075-2990647e4dcf : uuid:3a46b26f-37f1-4e62-9075-2990647e4dcf 2007-12-02 12:13:34.787 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 2007-12-02 12:13:34.856 Cannot find default UPnP backend 2007-12-02 12:13:34.864 New DB connection, total: 1 2007-12-02 12:13:34.868 Connected to database 'mythconverg' at host: localhost 2007-12-02 12:13:34.869 Closing DB connection named 'DBManager0' 2007-12-02 12:13:34.869 Clearing Settings Cache. 2007-12-02 12:13:34.869 Deleting UPnP client... 2007-12-02 12:13:34.869 UPnp - Destructor 2007-12-02 12:13:34.869 UPnp::CleanUp() - disabling SSDP notifications 2007-12-02 12:13:34.869 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : upnp:rootdevice : uuid:3a46b26f-37f1-4e62-9075-2990647e4dcf::upnp:rootdevice 2007-12-02 12:13:34.869 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 2007-12-02 12:13:34.930 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : uuid:3a46b26f-37f1-4e62-9075-2990647e4dcf : uuid:3a46b26f-37f1-4e62-9075-2990647e4dcf 2007-12-02 12:13:34.930 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 Segmentation fault (core dumped)
comment:9 by , 18 years ago
Last output was when backend was not running (Should still not segfault though..). I have included output with backend started..
damian@mythtv-box:~/SVN/trunk/mythtv$ mythfilldatabase -v all 2007-12-02 12:16:59.260 Using runtime prefix = /usr/local 2007-12-02 12:16:59.261 Using localhost value of mythtv-box 2007-12-02 12:16:59.262 MCP::DefaultUPnP() - config.xml has default PIN '2925' and host USN: uuid:785fe75f-4cd9-470e-a19e-223f7feddbc5::urn:schemas-mythtv-org:device:MasterMediaServer:1 2007-12-02 12:16:59.262 Setting UPnP client for backend autodiscovery... 2007-12-02 12:16:59.262 UPnp - Constructor 2007-12-02 12:16:59.262 ThreadPool:AddWorkerThread - HTTP_WorkerThread 2007-12-02 12:16:59.262 UPnp::Initialize - Begin 2007-12-02 12:16:59.262 UPnp::Initialize - Starting TaskQueue 2007-12-02 12:16:59.263 UPnp::Initialize - Creating SSDP Thread at port 6549 2007-12-02 12:16:59.263 UPnp::Initialize - End 2007-12-02 12:16:59.263 UPnp::Start - Starting SSDP Thread (Multicast) 2007-12-02 12:16:59.263 UPnp::Start - Enabling Notifications 2007-12-02 12:16:59.263 SSDP::EnableNotifications() - creating new task 2007-12-02 12:16:59.263 SSDP::EnableNotifications() - sending NTS_byebye 2007-12-02 12:16:59.263 LookupUDN(urn:schemas-upnp-org:device:MythContextClient:1) sName=UPnP/UDN/MythContextClient, sUDN= 2007-12-02 12:16:59.264 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : upnp:rootdevice : uuid:782bb106-72bb-412f-aff7-f09f1892c1a6::upnp:rootdevice 2007-12-02 12:16:59.264 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 2007-12-02 12:16:59.447 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : uuid:782bb106-72bb-412f-aff7-f09f1892c1a6 : uuid:782bb106-72bb-412f-aff7-f09f1892c1a6 2007-12-02 12:16:59.447 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 2007-12-02 12:16:59.586 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : urn:schemas-upnp-org:device:MythContextClient:1 : uuid:782bb106-72bb-412f-aff7-f09f1892c1a6::urn:schemas-upnp-org:device:MythContextClient:1 2007-12-02 12:16:59.586 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 2007-12-02 12:16:59.729 SSDP::EnableNotifications() - sending NTS_alive 2007-12-02 12:16:59.730 SSDP::EnableNotifications() - Task added to UPnP queue 2007-12-02 12:16:59.730 UPnp::Start - Returning 2007-12-02 12:16:59.765 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : upnp:rootdevice : uuid:782bb106-72bb-412f-aff7-f09f1892c1a6::upnp:rootdevice 2007-12-02 12:16:59.765 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 2007-12-02 12:16:59.882 Cannot find default UPnP backend 2007-12-02 12:16:59.890 New DB connection, total: 1 2007-12-02 12:16:59.892 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : uuid:782bb106-72bb-412f-aff7-f09f1892c1a6 : uuid:782bb106-72bb-412f-aff7-f09f1892c1a6 2007-12-02 12:16:59.892 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 2007-12-02 12:16:59.894 Connected to database 'mythconverg' at host: localhost 2007-12-02 12:16:59.895 Closing DB connection named 'DBManager0' 2007-12-02 12:16:59.895 Clearing Settings Cache. 2007-12-02 12:16:59.895 Deleting UPnP client... 2007-12-02 12:16:59.895 UPnp - Destructor 2007-12-02 12:16:59.895 UPnp::CleanUp() - disabling SSDP notifications 2007-12-02 12:16:59.895 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : upnp:rootdevice : uuid:782bb106-72bb-412f-aff7-f09f1892c1a6::upnp:rootdevice 2007-12-02 12:16:59.895 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 2007-12-02 12:17:00.003 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : uuid:782bb106-72bb-412f-aff7-f09f1892c1a6 : uuid:782bb106-72bb-412f-aff7-f09f1892c1a6 2007-12-02 12:17:00.003 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 2007-12-02 12:17:00.072 UPnpNotifyTask::SendNotifyMsg() - address: ?????? 2007-12-02 12:17:00.077 UPnpNotifyTask::SendNotifyMsg : 239.255.255.250 : urn:schemas-upnp-org:device:MythContextClient:1 : uuid:782bb106-72bb-412f-aff7-f09f1892c1a6::urn:schemas-upnp-org:device:MythContextClient:1 2007-12-02 12:17:00.077 UPnpNotifyTask::SendNotifyMsg() - address: 192.168.1.100 Segmentation fault (core dumped)
comment:10 by , 18 years ago
I just uploaded the backend log file. Mythbackend crashes about 20-30% of the time. Random segfaults occur on many if not all functions, including mythmusic, mythbrowser. In the log file, there are 3-4 successful startups, and the last one is in crashed state.
comment:11 by , 18 years ago
Thanks for all the logs - that is enough to keep me scratching my head for a while.
Until I can reproduce/repair, just deleteing the config.xml file should disable the UPnP stuff, and get you working reliably (assuming that mysql.txt is valid).
comment:12 by , 18 years ago
(In [15020]) Work around random segfaults in UPnpNotifyTask::Execute() when disabling SSDP notifications. See #4234. See #4249. It seems that m_addressList has some bad values (not NULL, but not valid QStr). Suspect QString thread problem, but a QDeepCopy of the string or the stringlist does nothing. Deleting the threads before the SSDP object seems safe.
comment:13 by , 18 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |

Backtrace from mythfilldatabase