Open zbrox opened 8 years ago
Using po $arg1
on the exception breakpoint I get the following, clearer error:
fatal error: unexpectedly found nil while unwrapping an Optional value
4914441056
I tried with an older XCode to run the version on the master branch and there the crash doesn't occur.
So it's consistently breaking when it parses the device's service list? AbstractUPnPService.swift:340 is where <*><device><serviceList><service>
is parsed.
Can you send me a copy of the upnp description xml that was causing this to happen?
It should look something like this:
<?xml version="1.0" encoding="UTF-8"?>
<root configId="10230464" xmlns="urn:schemas-upnp-org:device-1-0" xmlns:dlna="urn:schemas-dlna-org:device-1-0">
<specVersion>
<major>1</major>
<minor>1</minor>
</specVersion>
<device>
<deviceType>urn:schemas-upnp-org:device:MediaServer:1</deviceType>
<friendlyName>Kodi (ordershop-lm)</friendlyName>
<manufacturer>XBMC Foundation</manufacturer>
<manufacturerURL>http://kodi.tv/</manufacturerURL>
<modelDescription>Kodi - Media Server</modelDescription>
<modelName>Kodi</modelName>
<modelNumber>15.2 Git:2015-10-19-02e7013</modelNumber>
<modelURL>http://kodi.tv/</modelURL>
<UDN>uuid:b77dbf33-abc8-8c30-bc51-c0723a3f724c</UDN>
<presentationURL>http://192.168.1.252:8080/</presentationURL>
<dlna:X_DLNADOC xmlns:dlna="urn:schemas-dlna-org:device-1-0">DMS-1.50</dlna:X_DLNADOC>
<iconList>
<icon>
<mimetype>image/png</mimetype>
<width>256</width>
<height>256</height>
<depth>8</depth>
<url>/icon256x256.png</url>
</icon>
<icon>
<mimetype>image/png</mimetype>
<width>120</width>
<height>120</height>
<depth>8</depth>
<url>/icon120x120.png</url>
</icon>
<icon>
<mimetype>image/png</mimetype>
<width>48</width>
<height>48</height>
<depth>8</depth>
<url>/icon48x48.png</url>
</icon>
<icon>
<mimetype>image/png</mimetype>
<width>32</width>
<height>32</height>
<depth>8</depth>
<url>/icon32x32.png</url>
</icon>
<icon>
<mimetype>image/png</mimetype>
<width>16</width>
<height>16</height>
<depth>8</depth>
<url>/icon16x16.png</url>
</icon>
</iconList>
<serviceList>
<service>
<serviceType>urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1</serviceType>
<serviceId>urn:microsoft.com:serviceId:X_MS_MediaReceiverRegistrar</serviceId>
<SCPDURL>/X_MS_MediaReceiverRegistrar/b77dbf33-abc8-8c30-bc51-c0723a3f724c/scpd.xml</SCPDURL>
<controlURL>/X_MS_MediaReceiverRegistrar/b77dbf33-abc8-8c30-bc51-c0723a3f724c/control.xml</controlURL>
<eventSubURL>/X_MS_MediaReceiverRegistrar/b77dbf33-abc8-8c30-bc51-c0723a3f724c/event.xml</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:ContentDirectory:1</serviceType>
<serviceId>urn:upnp-org:serviceId:ContentDirectory</serviceId>
<SCPDURL>/ContentDirectory/b77dbf33-abc8-8c30-bc51-c0723a3f724c/scpd.xml</SCPDURL>
<controlURL>/ContentDirectory/b77dbf33-abc8-8c30-bc51-c0723a3f724c/control.xml</controlURL>
<eventSubURL>/ContentDirectory/b77dbf33-abc8-8c30-bc51-c0723a3f724c/event.xml</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:ConnectionManager:1</serviceType>
<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
<SCPDURL>/ConnectionManager/b77dbf33-abc8-8c30-bc51-c0723a3f724c/scpd.xml</SCPDURL>
<controlURL>/ConnectionManager/b77dbf33-abc8-8c30-bc51-c0723a3f724c/control.xml</controlURL>
<eventSubURL>/ConnectionManager/b77dbf33-abc8-8c30-bc51-c0723a3f724c/event.xml</eventSubURL>
</service>
</serviceList>
</device>
</root>
Sorry for the late response. Here is the description xml.
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="urn:schemas-upnp-org:device-1-0" xmlns:dlna="urn:schemas-dlna-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:schemas-upnp-org:device:MediaServer:3</deviceType>
<manufacturer>Parrot SA</manufacturer>
<manufacturerURL>http://www.parrot.com/</manufacturerURL>
<modelNumber>2014.05.22</modelNumber>
<serialNumber>0</serialNumber>
<dlna:X_DLNADOC />
<friendlyName>Folk</friendlyName>
<modelDescription>Folk is Pulsar implementation of Filesystems On Local networKs</modelDescription>
<modelName>pulsar-test-platform</modelName>
<UDN>uuid:8c9a81b5-4989-4390-ac9b-7403a073da29</UDN>
<iconList>
<icon>
<mimetype>image/png</mimetype>
<width>120</width>
<height>120</height>
<depth>32</depth>
<url>/pulsar-test-platform-120x120x32.PNG_LRG</url>
</icon>
<icon>
<mimetype>image/jpeg</mimetype>
<width>120</width>
<height>120</height>
<depth>32</depth>
<url>/pulsar-test-platform-120x120x32.JPEG_LRG</url>
</icon>
</iconList>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:service:ContentDirectory:3</serviceType>
<serviceId>urn:upnp-org:serviceId:ContentDirectory</serviceId>
<SCPDURL>/xml/ContentDirectory-NoTrack.xml</SCPDURL>
<controlURL>/Control/pulsar-test-platform/RygelContentDirectory</controlURL>
<eventSubURL>/Event/pulsar-test-platform/RygelContentDirectory</eventSubURL>
</service>
<service>
<serviceType>urn:schemas-upnp-org:service:ConnectionManager:2</serviceType>
<serviceId>urn:upnp-org:serviceId:ConnectionManager</serviceId>
<SCPDURL>/xml/ConnectionManager.xml</SCPDURL>
<controlURL>/Control/pulsar-test-platform/RygelSourceConnectionManager</controlURL>
<eventSubURL>/Event/pulsar-test-platform/RygelSourceConnectionManager</eventSubURL>
</service>
<service>
<serviceType>urn:microsoft-com:service:X_MS_MediaReceiverRegistrar:1</serviceType>
<serviceId>urn:microsoft-com:serviceId:X_MS_MediaReceiverRegistrar</serviceId>
<SCPDURL>/xml/X_MS_MediaReceiverRegistrar1.xml</SCPDURL>
<controlURL>/Control/pulsar-test-platform/RygelMediaReceiverRegistrar</controlURL>
<eventSubURL>/Event/pulsar-test-platform/RygelMediaReceiverRegistrar</eventSubURL>
</service>
<service>
<serviceType>urn:parrot-com:service:X_PulsarService:1</serviceType>
<serviceId>urn:parrot-com:serviceId:X_PulsarService</serviceId>
<SCPDURL>/xml/PulsarService.xml</SCPDURL>
<controlURL>/Control/pulsar-test-platform/PulsarService</controlURL>
<eventSubURL>/Event/pulsar-test-platform/PulsarService</eventSubURL>
</service>
</serviceList>
</device>
</root>
I forgot to mention that I managed to work around this crash. Initially I was using all the ssdp types to discover as in the example app. When I changed those to include only the urns of the devices and services I was interested in it stopped crashing.
It still occurs but very rarely.
The example app on the swift-2.1 branch crashes on discovery of only some UPnP devices with a "attempted to retain deallocated object" error.