Bugzilla – Bug 2269
search for non-existent string crashes SlimServer
Last modified: 2011-03-16 04:18:44 UTC
When searching for a string using basic search function from standard web interface, if the string does not exist, SlimServer will crash 100% of the time. SlimServer log message is "Modification of a read-only value attempted at /Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Web/HTTP.pm line 1198." Using Slimserver 6.2b1 nightly (2005-10-07) on Mac OSX 10.3.9. Accessing from Firefox 1.5 Beta 1 on WinXP SP2.
I'm unable to reproduce. I get "empty" from advanced search and "0 results" for all three categories in live search and manual search. This sounds just like bug 2030, which should be long fixed.
It *does* look just like 2030, marked as fixed. This is strange. I can't get SlimeServer to crash in Advanced Search, only in basic search. It seems to fail rather consitently and quickly, during the "live search" before I can even finish typing and hit the "Search Music" button. Frustratingly, I got the basic search *not* to fail (i.e. properly return an empty result set) and SlimServer *not* to crash once out of about twenty tries with a gibberish string that I knew was not in the music DB. Anyhow, definitely broken for me.
In fact, it seems SlimServer will crash during a basic search for almost any string including ones that should be found in the database.
by basic search, do you mean that you type words into the "search music" form and press return (manual), or type words and let the search operate on its own (livesearch)?
(Using Safari 1.3.1 on the server itself [OSX 10.3.9] now) SlimServer does not give me the opportunity to get to the "Search Music" button. In other words, SlimServer crashes and writes the log entry "Modification of a read-only value attempted at /Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Web/HTTP.pm line 1198." as soon as I enter a single character in the search form on the Search Music page. Can livesearch be disabled?
Can you open a Terminal window, and run: vi ~/Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Web/HTTP.pm +1198 and paste the line that's there? Thanks.
vi /Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Web/HTTP.pm +1198 Scalar::Util::weaken($body);
Does it have this wrapped around it that weaken() ? # Take the refcnt down, so we don't leak. if ($Class::DBI::Weaken_Is_Available && !Scalar::Util::readonly($body)) { Scalar::Util::weaken($body); } If it doesn't, you have an old version of SlimServer installed.
Yep. That's what it looks like: # Take the refcnt down, so we don't leak. if ($Class::DBI::Weaken_Is_Available && !Scalar::Util::readonly($body)) { Scalar::Util::weaken($body); }
And if you run this from the Terminal window - what does it output? perl -MScalar::Util -e 'print "$Scalar::Util::VERSION\n"' Can you comment out that weaken() line with a # symbol in front of it? Then restart SlimServer
Dan, $ perl -MScalar::Util -e 'print "$Scalar::Util::VERSION\n"' 1.11 Commenting out the weaken() keeps SlimServer from crashing when I do a search, thanks. Why do you suppose this is happening and what is the result of failing to make $body a weak reference?
Failing to make it a weak reference might cause memory leaks. I believe the issue is an old version of Scalar::Utils How comfortable are you with upgrading that perl module?
Comfortable enough, I guess. Upgraded Scalar::Util using CPAN. $ perl -MScalar::Util -e 'print "$Scalar::Util::VERSION\n"' now reports, 1.17 Uncommented the weaken() line and... Nope. Still broken.
I've removed the weaken() - we don't really need it. Subversion change 4598