Bug 1752 - XML request crashes SlimServer
: XML request crashes SlimServer
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: XML
: 6.0.2
: PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-04 03:08 UTC by Malcolm Green
Modified: 2008-08-18 10:54 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Malcolm Green 2005-07-04 03:08:30 UTC
When there is an accented character in an artist name then when browseid3.xml is
used to get a list of albums by the artist, SlimServer crashes.  As an example,
I have the artist "B�la Fleck" in my music collection, and I'm using the
following URL to get a list of albums:
 
/xmlTelCanto/browseid3.xml?nopagebar=1&artist=B%E9la%20Fleck&genre=*

This crashes both 6.0.2 and 6.1b1
Comment 1 KDF 2005-07-04 12:45:10 UTC
is there anything in the event viewer log giving more detail on the nature of
the crash?  
Comment 2 Malcolm Green 2005-07-04 13:06:40 UTC
Yes, the event log contains the following:

Can't call method "id" on an undefined value at /PerlApp/Slim/Web/Pages.pm line
2048.
Comment 3 KDF 2005-07-04 13:12:02 UTC
is this with 6.0.2 or 6.1b1?  I'm not seeing any call for an id at that line
with 6.1b1, though there is one at 2060.  This also seems to be a lack of a
client object.  you url seems to be missing any referenece to
player="<macaddress>".  Browseid3 is also deprecated, in favour of browsedb (now
the preferred method for 6.0+)
Comment 4 Malcolm Green 2005-07-05 00:45:13 UTC
The error at line 2048 is with 6.1b1 (V2005-07-03). On 6.0.2 the same error
occurs but at line 2182.

The full URL does include player="<macaddress>" - I just included the core part
of the URL in the report.

I'm aware that browseid3 has been superseded by browsedb.  Originally we
attempted to use browsedb but at the time it was unable to  provide the
functionality we needed. Specifically, it would have taken 30-40 calls to
provide the same set of information that a single call to browseid3 provided and
the performance would have been unacceptable.  I worked closely with Dan on this
and it was he who provided the browseid3 support.
Comment 5 KDF 2005-07-05 01:02:21 UTC
thanks for the info.  It looks like yet another unicode issue, so I'll have to
leave this one to Dan.  However, any non-existent artist in this case would
crash the server. This example probably comes up as non-existent due to a
charset mismatch.  

changing the section at 2046-2051 to the following can at least prevent the
crash (though returns no info):
			# Search for each real name - normalize the query,
			# then turn it into the ID suitable for browsedb()
			my $cat = (@{$ds->find(
				$category,
				{ $queryMap{$category} => $params->{$category} }
			)})[0];
			
			return  browsedb($client, $params) unless $cat;
			
			$params->{$category} = $cat->id();
Comment 6 KDF 2005-07-05 21:01:52 UTC
dan's recent unicode fix may have helped with this example case.  Jly 6 nightly
is worth a test. If its good, then the supplied patch above will take care of
any case where an invalid song shows up for some other reason.
Comment 7 Dan Sully 2005-07-07 12:25:47 UTC
Malcolm - that character appears to be an encoded ISO-8859-1 string - is it possible for you to convert 
those to UTF-8 before encoding?
Comment 8 Malcolm Green 2005-07-08 00:13:31 UTC
My apologies - the URL is actually
browseid3.xml?nopagebar=1&artist=B%25C3%25A9la%20Fleck&genre=*

This results from converting the string to UTF-8 (giving C3A9 as the e acute
character) then URL-escaping the resulting string.
Comment 9 Dan Sully 2005-07-15 11:15:02 UTC
Malcolm - I've applied KDF's fix to the trunk.

I've also tested with: Namco(遠山 明孝) - Kanji which turns into:

Namco(%E9%81%A0%E5%B1%B1%20%E6%98%8E%E5%AD%9D)

From Devel::Peek, thats:

SV = PV(0x1801660) at 0x180ed24
  REFCNT = 1
  FLAGS = (PADBUSY,PADMY,POK,pPOK,UTF8)
  PV = 0x301ee0 "Namco(\351\201\240\345\261\261 \346\230\216\345\255\235)"\0 [UTF8 
"Namco(\x{9060}\x{5c71} \x{660e}\x{5b5d})"]
  CUR = 20
  LEN = 80

Which works just fine for me - and shows the items associated with that artist.

Could you please sync to the latest subversion and give it a try?

Thanks.
Comment 10 Malcolm Green 2005-07-18 01:32:01 UTC
Unfortunately this didn't help, Dan.  I've come to the conclusion that my best
bet will be to modify my code to use browsedb instead of browseid3.  Thanks
anyway for attempting to resolve the problem.
Comment 11 Dan Sully 2005-07-18 07:11:26 UTC
Ok - curious to know what crash you are getting now. I'd like to get it fixed.

Thanks.
Comment 12 Dan Sully 2005-07-19 14:00:54 UTC
Malcolm - I'm going to close this one. If you have time to provide more data on that crash, great. If not, 
don't worry about it.

Thanks.
Comment 13 Chris Owens 2008-03-11 11:28:26 UTC
This bug was marked resolved in Slimserver 6.1, which is several versions ago.  If you're still seeing this bug, please re-open it.  Thanks!