Bugzilla – Bug 1752
XML request crashes SlimServer
Last modified: 2008-08-18 10:54:16 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
is there anything in the event viewer log giving more detail on the nature of the crash?
Yes, the event log contains the following: Can't call method "id" on an undefined value at /PerlApp/Slim/Web/Pages.pm line 2048.
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+)
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.
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();
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.
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?
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.
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.
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.
Ok - curious to know what crash you are getting now. I'd like to get it fixed. Thanks.
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.
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!