Bug in class-snoopy.php causes Dashboard script to unexpectedly halt

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug in class-snoopy.php causes Dashboard script to unexpectedly halt

Jeremy Visser
I'm not sure exactly which is the right list to post in, so I thought I'd
post in both WP-Hackers and WP-Testers.

About a week ago, I was having some
trouble<http://narnia.bounceme.net/jeremy/2006/04/21/bad-snoopy/>with
my Dashboard only displaying half a page which I though was due to
having WP-SlimStat installed, as the problem only occurred when the plugin
was activated, but later found out it was probably because the extra memory
WP-SlimStat used helped push it past the tipping point.

I eventually discovered that this was actually due to a strangely set value
in class-snoopy.php. The $maxlength value, which was used in the
_httprequest() function, was set to 500000 bytes. Snoopy was passing this
value to fread() which only accepts up to 8192 bytes, which means that
having $maxlength set to 500000 bytes is completely pointless. Although in
most cases, fread will work fine, in my case it was causing problems with
the script suddenly terminating without a trace. Changing $maxlength to 8192
fixed the problem.

I also noticed that the Test
Track<http://www.tamba2.org.uk/wordpress/TestTrack/>was also
experiencing the same symptoms when I was logged on to it the other
day. This means that I am probably not alone in this strange behaviour.

I have filed a bug
report<http://sourceforge.net/tracker/index.php?func=detail&aid=1474137&group_id=2091&atid=102091>on
snoopy.sf.net <http://sourceforge.net/projects/snoopy/> , but I doubt that
it will be fixed. I would like to see the next release of WordPress have
$maxlength set to 8192 out of the box, as I think this will fix some
problems with the class.

--
Jeremy Visser
Email: [hidden email]
Website: http://jeremy.serveblog.net/

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Bug in class-snoopy.php causes Dashboard script to unexpectedly halt

Peter Westwood
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeremy Visser wrote:
> I eventually discovered that this was actually due to a strangely set value
> in class-snoopy.php. The $maxlength value, which was used in the
> _httprequest() function, was set to 500000 bytes. Snoopy was passing this
> value to fread() which only accepts up to 8192 bytes, which means that
> having $maxlength set to 500000 bytes is completely pointless. Although in
> most cases, fread will work fine, in my case it was causing problems with
> the script suddenly terminating without a trace. Changing $maxlength to 8192
> fixed the problem.
>

Looking at the php docs for fread [1] are you sure that the limit of
8192 applies in this situation.  Reading through that page I think it
only applies to streams opened on local files not remote files over
ftp/http/whatever.

> I also noticed that the Test
> Track<http://www.tamba2.org.uk/wordpress/TestTrack/>was also
> experiencing the same symptoms when I was logged on to it the other
> day. This means that I am probably not alone in this strange behaviour.
>
> I have filed a bug
> report<http://sourceforge.net/tracker/index.php?func=detail&aid=1474137&group_id=2091&atid=102091>on
> snoopy.sf.net <http://sourceforge.net/projects/snoopy/> , but I doubt that
> it will be fixed. I would like to see the next release of WordPress have
> $maxlength set to 8192 out of the box, as I think this will fix some
> problems with the class.
>

Raise a ticket on trac[2] if you want something fixed in WordPress

[1] http://www.php.net/manual/en/function.fread.php
[2] http://trac.wordpress.org

westi
- --
Peter Westwood
http://blog.ftwr.co.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEUc3YVPRdzag0AcURAulkAKCxvBpDanZjIbSCaTAvVwnPsl5DaACeOxd8
T9jSs50QNDM2TTmElFnH3Qs=
=so2t
-----END PGP SIGNATURE-----

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Bug in class-snoopy.php causes Dashboard script to unexpectedly halt

Jeremy Visser
Cool, thanks for the tips.

On 4/28/06, Peter Westwood <[hidden email]> wrote:

>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jeremy Visser wrote:
> > I eventually discovered that this was actually due to a strangely set
> value
> > in class-snoopy.php. The $maxlength value, which was used in the
> > _httprequest() function, was set to 500000 bytes. Snoopy was passing
> this
> > value to fread() which only accepts up to 8192 bytes, which means that
> > having $maxlength set to 500000 bytes is completely pointless. Although
> in
> > most cases, fread will work fine, in my case it was causing problems
> with
> > the script suddenly terminating without a trace. Changing $maxlength to
> 8192
> > fixed the problem.
> >
>
> Looking at the php docs for fread [1] are you sure that the limit of
> 8192 applies in this situation.  Reading through that page I think it
> only applies to streams opened on local files not remote files over
> ftp/http/whatever.
>
> > I also noticed that the Test
> > Track<http://www.tamba2.org.uk/wordpress/TestTrack/>was also
> > experiencing the same symptoms when I was logged on to it the other
> > day. This means that I am probably not alone in this strange behaviour.
> >
> > I have filed a bug
> > report<
> http://sourceforge.net/tracker/index.php?func=detail&aid=1474137&group_id=2091&atid=102091
> >on
> > snoopy.sf.net <http://sourceforge.net/projects/snoopy/> , but I doubt
> that
> > it will be fixed. I would like to see the next release of WordPress have
> > $maxlength set to 8192 out of the box, as I think this will fix some
> > problems with the class.
> >
>
> Raise a ticket on trac[2] if you want something fixed in WordPress
>
> [1] http://www.php.net/manual/en/function.fread.php
> [2] http://trac.wordpress.org
>
> westi
> - --
> Peter Westwood
> http://blog.ftwr.co.uk
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFEUc3YVPRdzag0AcURAulkAKCxvBpDanZjIbSCaTAvVwnPsl5DaACeOxd8
> T9jSs50QNDM2TTmElFnH3Qs=
> =so2t
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> wp-hackers mailing list
> [hidden email]
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


--
Jeremy Visser
Email: [hidden email]
Website: http://jeremy.serveblog.net/

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers
Reply | Threaded
Open this post in threaded view
|

Re: Bug in class-snoopy.php causes Dashboard script to unexpectedly halt

Jeremy Visser
In reply to this post by Jeremy Visser
Not sure if anyone minds me digging up an old thread, but I finally got
around to filing a ticket in Trac. I have attached a patch in the ticket.
http://trac.wordpress.org/ticket/2733

--
Jeremy Visser
Email: [hidden email]
Website: http://jeremy.serveblog.net/

_______________________________________________
wp-hackers mailing list
[hidden email]
http://lists.automattic.com/mailman/listinfo/wp-hackers