Finding out what file was called immediately before error I'm getting the following errors in dblog whenever I look at a page:

Notice: Undefined offset: 0 in _menu_check_access() (line 635 of /home/mysite/public_html/includes/menu.inc).

Notice: Undefined offset: 1 in _menu_check_access() (line 635 of /home/mysite/public_html/includes/menu.inc).

I know it's not Menu that's causing the issue, but rather, some module is passing permissions incorrectly via hook_menu.

I remember reading a long time ago that one way to find out which module is causing core to emit notices, is to drop a function right before the line in question. Alas, I cannot find that page at all.

Any thoughts?
If you are tracking down a weird error, editing core is perfectly acceptable.


Make sure everything is in your RCS.
Edit includes/menu.inc
Place a print_r(debug_backtrace()) near line 635, preferable at the top of _menu_check_access().  Alse print_r() the arguments.
Trigger the problem.
Figure out what happened.
Revert the site to the checked in RCS version.


My guess is you are getting weird path, and the argument is wonky for your access check.  In other words, you are trying to access check something that should really 404.