I'm implementing hook_function_overrides, and am getting a white screen, with this error in the log:

ALERT - canary mismatch on efree() - heap overflow detected (attacker [IP] ...

If I comment out
runkit_function_rename($function_override['name'], 'drupal_override_'.$function_override['name']);
and instead simply use
runkit_function_remove($function_override['name']);
then it works.

The only pattern I can discern is that it works for functions in the same file, but throws the error for functions in other files.
Googling the error brings up some core PHP bugs that don't seem to be resolved.
Is it necessary to keep the drupal_override_ functions, or can the overridden function simply be removed (to avoid this bug)?

Thanks!

Comments

crystaldawn’s picture

Technically the function is "suppose" to be renamed so that if for some unknown reason you need to use the original function, you can call it. But if that part is causing problems, you can indeed simply remove the function. This seems to be a problem with only some php installations though. Its like a php bug or something that causes this.

If there are problems with runkit on your php install, then maybe you could try PECL APD instead as this module works with both of them. APD and runkit are competitors of each other and they both do the same thing, but when one doesnt work, it makes sense to attempt to use the other. If neither work, then your next best bet is to compile a version of PHP which is known to work with one or the other. I wish these 2 php extensions would mature as they've been around long enough, but neither one of them has much support because function overriding is seen as blackhat in many circles. But for those of us who see it as total control, they are just fine if used properly. I've successfully used the function overrides to fix many quirks within drupal on my own servers and it works great. But getting the php extensions to work to begin with so that you can use this drupal module is a complete and total nightmare if they dont work out of the box for your distro. I believe the only distro to get them both working at the same time is Gentoo which isnt exactly the best server platform available given that it takes so long as well as a lot of cpu/mem resources to install/upgrade things.

Daemon_Byte’s picture

APD died off in 2004 and runkit died off in 2006 unfortunately. I very much doubt either will mature now although it would be really nice if someone with the ability got these projects and merged them into a decent one. Thanks for the module by the way, I was in the process of writing an identical one myself but couldn't get APD to work. I found this while looking for runkit details so I can ditch mine now :) If you need any help maintaining it let me know.

MIT88’s picture

Hello

have you got to enable the module?
I do not find the right php_runkit.php I ask you please to tell me how did you happen to do so. I use xampp.

I tried to compile the folder "runkit PHP5.2 +-with-patch" with the DevC + + but I failed.

budda’s picture

Runkit is still being updated in 2012. Just not in the original code repo. It has been forked on to https://github.com/zenovich/runkit

budda’s picture

crystaldawn’s picture

Status: Active » Closed (won't fix)