Tracking down pesky PHP 5.3 errors We have a site that is throwing errors when uploading files to a simple "Page" node. I've done a lot of work trying to track down the actual source of the error, and I posted a half dozen messages to various likely threads at drupal.org.

The errors we get on file attach/upload:


  warning: Parameter 2 to wysiwyg_form_alter() expected to be a
  reference, value given  in /var/www/drupal/includes/common.inc on line
  2892.
  
  warning: Parameter 2 to simple_access_form_alter() expected to be a
  reference, value given in /var/www/drupal/includes/common.inc on line
  2892.


I understand about passing by reference versus value. I understand about fixing the problem in the offending module by using the two calls to drupal_alter(), as described on
http://drupal.org/node/930992#comment-4066840, but so far I have not been able to find what module is making the call incorrectly. 

I tried installing and enabling the same set of modules on a test site but cannot reproduce these errors. 

It's hard to post a bug report when you don't know the offending module. 

See also http://drupal.org/node/1200970#comment-5463436.
Assuming you do not have a debugger going (getting XDebug to run for your local development environment is probably the single most useful thing you can do the entire year), you could use debug_backtrace() at the place of the error (i.e. in the two form alter functions) to find out what is calling them. If you shoot its output into watchdog(), hopefully you can cross reference the time of the error with a particular invocation of these functions. Do be aware that these are form alter hooks, which get called for each and every form Drupal is building (and you might be surprised there can actually be several forms on a single page; just think of search and login forms). I.e. not every call will be the offending one.