Bug 2269 - search for non-existent string crashes SlimServer
: search for non-existent string crashes SlimServer
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Web Interface
: 6.2.0
: Macintosh MacOS X 10
: P2 normal (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-07 09:51 UTC by Kelsey Kennedy
Modified: 2011-03-16 04:18 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kelsey Kennedy 2005-10-07 09:51:12 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.
Comment 1 KDF 2005-10-07 12:43:26 UTC
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.
Comment 2 Kelsey Kennedy 2005-10-07 14:41:41 UTC
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.
Comment 3 Kelsey Kennedy 2005-10-07 15:09:32 UTC
In fact, it seems SlimServer will crash during a basic search for almost any
string including ones that should be found in the database.
Comment 4 KDF 2005-10-07 15:18:32 UTC
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)?
Comment 5 Kelsey Kennedy 2005-10-07 15:30:46 UTC
(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?
Comment 6 Dan Sully 2005-10-07 15:37:18 UTC
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.
Comment 7 Kelsey Kennedy 2005-10-07 15:41:24 UTC
vi /Library/PreferencePanes/SlimServer.prefPane/Contents/server/Slim/Web/HTTP.pm
+1198

Scalar::Util::weaken($body);
Comment 8 Dan Sully 2005-10-07 15:48:25 UTC
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.
Comment 9 Kelsey Kennedy 2005-10-07 16:38:02 UTC
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);
        }
Comment 10 Dan Sully 2005-10-07 17:06:57 UTC
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
Comment 11 Kelsey Kennedy 2005-10-07 21:22:42 UTC
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?
Comment 12 Dan Sully 2005-10-11 22:51:19 UTC
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?
Comment 13 Kelsey Kennedy 2005-10-12 01:51:48 UTC
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.
Comment 14 Dan Sully 2005-10-12 16:31:34 UTC
I've removed the weaken() - we don't really need it.

Subversion change 4598