Make WordPress Core

Opened 20 years ago

Closed 20 years ago

Last modified 9 years ago

#2733 closed defect (bug) (fixed)

Value in class-snoopy.php is set too high and can sometimes cause problems

Reported by: jeremyvisser's profile JeremyVisser Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.0.3
Component: Administration Keywords: snoopy, fread, wp-slimstat, dashboard
Focuses: Cc:

Description

Please read footnote at the bottom.

I use WordPress 2.0.2 which contains a copy of Snoopy
1.2.3.

I recently ran into a problem where the Dashboard
would simply terminate with no feedback whatsoever
during a call to fread() in the _httprequest() function in wp-includes/class-snoopy.php while my wp-slimstat plugin was activated.

After many hours of debugging, I found that changing the default value of $maxlength from 500000 to 8192 fixed the problem.

At first, I thought this was due to the WP-SlimStat plugin being activated, but later I concluded it was just because of the extra memory used by he plugin that was tipping the memory limit over.

I think that the default value should be permanently
changed to 8192, because according to the PHP
documentation on fread()
(http://www.php.net/manual/en/function.fread.php) the
reading of file will stop at 8192 bytes anyway, so
having the value of $maxlength any higher would be
pointless, and in my case, cause problems.

Regards, Jeremy.

This is a modified copy of the bug report I filed at http://sf.net/projects/snoopy/. The folks at Snoopy seem to be pretty idle, because I haven't had any feedback on my bug report, but I really would like this fixed as it does appear to cause problems with certain configurations in WordPress. I would like to see this fixed in the Snoopy included with WP, as it won't really harm anything to change the value from 500000 to 8192.

Attachments (1)

class-snoopy.php.diff (710 bytes) - added by JeremyVisser 20 years ago.
A patch for class-snoopy.php to make the requested changes

Download all attachments as: .zip

Change History (9)

#1 @JeremyVisser
20 years ago

  • Version changed from 1.2 to 2.0.2

I changed the version to say 2.0.2, which I am using. I'm new to Trac, so I didn't realise that the 1.2 meant WP 1.2!

@JeremyVisser
20 years ago

A patch for class-snoopy.php to make the requested changes

#2 @JeremyVisser
20 years ago

  • Cc jeremy.visser@… added
  • Milestone changed from 2.0.3 to 2.0.4
  • Version changed from 2.0.2 to 2.0.3

Note: in php.ini, setting the memory limit to 16M also fixes the problem. This makes this fix more like a workaround. It should still be fixed.

#4 @ryan
20 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4030]) Snoopy fread fixes. Props JeremyVisser. fixes #2733

#5 @ryan
20 years ago

(In [4031]) Snoopy fread fixes. Props JeremyVisser. fixes #2733

#6 @JeremyVisser
20 years ago

Thankyou very much!

#7 @(none)
19 years ago

  • Milestone 2.0.4 deleted

Milestone 2.0.4 deleted

This ticket was mentioned in Slack in #core-editor by jorbin. View the logs.


9 years ago

Note: See TracTickets for help on using tickets.