Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#39744 closed defect (bug) (worksforme)

wp_widgets_init crash

Reported by: eatonz's profile EatonZ Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.7.2
Component: Widgets Keywords: reporter-feedback
Focuses: Cc:

Description

Hi, my site notified me about a fatal error that completely took down the site for a few minutes until I restarted the app pool. Unfortunately I do not have any steps to reproduce this - it happened out of nowhere when I wasn't even doing anything on the site.

PHP Fatal error:  Cannot redeclare wp_widgets_init() (previously declared in C:\home\site\wwwroot\wp-includes\widgets.php:1439) in C:\home\site\wwwroot\wp-includes\widgets.php on line 1439

This is WordPress 4.7.2 running on Azure Pack (IIS 8.5).

Change History (8)

#1 @westonruter
8 years ago

@EatonZ which plugins and themes do you have active?

Without more information, this sounds like a question that is best suited for the support forums.

#2 @EatonZ
8 years ago

@westonruter Thanks for the fast response! Based on the error it seems like a bug in WP itself. It seemed appropriate to post here since it could be a bit technical for the forums.

Plugins and themes, all on the latest versions at the time of this post:

Theme: Create by ThemeTrust
Plugins:
Black Studio TinyMCE Widget
Contact Form 7
Default Admin Color Scheme
Favicon by RealFaviconGenerator
Google Captcha (reCAPTCHA) by BestWebSoft
Page Builder by SiteOrigin
Simple Page Ordering
SiteOrigin Widgets Bundle
SparkPost
Theme My Login
Wordfence Security
WP Rocket

#3 @westonruter
8 years ago

  • Keywords reporter-feedback added

@EatonZ Thanks for the theme/plugin list. In order to be able to assist, we'll have to have clear steps to reproduce. If the issue is in core, then coming up with steps to reproduce while all plugins are deactivated would be ideal. The issue may also reside in your system configuration.

#4 @EatonZ
8 years ago

@westonruter Based on the error, under what circumstances can it happen? If you could give me some hints, I could try and see about reproducing it, but since I wasn't doing anything at the time of the crash, I am not sure where to start looking.

#5 @westonruter
8 years ago

@EatonZ I don't know either. The issue should not happen because wp-includes/widgets.php is only required in core once inside of wp-settings.php: https://github.com/WordPress/wordpress-develop/blob/3e6e1a12f6cff5cf6ed9ec73975a7f86e41f5989/src/wp-settings.php#L217

There aren't any other instances of the file being required/included, per:

ack '(require|include)(_once)?\b.+?/widgets\.php' --php src/*.php src/wp-admin/ src/wp-includes/

#6 @dd32
8 years ago

Given this stopped after the app pool was restarted, this sounds like it could've been the result of a php opcode cache failure.

What version of php? Is it running an opcode cache?

#7 @EatonZ
8 years ago

@dd32

PHP 7.0.7
WinCache 2.0.0.6

Zend OPcache v7.0.6-dev is running as the default OPcache. WinCache should be working fine with it, but let me know if there is a specific setting that is known to cause issues. I am using the defaults provided by the host.

#8 @dd32
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Hi @EatonZ
Sorry for taking so long to get back to you on this.

There isn't any known issues with Opcaches, however the scenario you ran into is likely to have been caused by it.

Without any further details or reproducible case, I'm marking this as worksforme. Feel free to re-open if with extra details and steps to reproduce if you run into it again.

Note: See TracTickets for help on using tickets.