Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflict with WordPress 6.1 (wp_rand() bug on 32-bit platforms) #974

Closed
donnchawp opened this issue Nov 2, 2022 · 23 comments
Closed

Conflict with WordPress 6.1 (wp_rand() bug on 32-bit platforms) #974

donnchawp opened this issue Nov 2, 2022 · 23 comments

Comments

@donnchawp
Copy link

donnchawp commented Nov 2, 2022

Description of Problem

I haven't had time to look into the source of your plugin but there's something in it that causes a problem when I load the front page (or archive links such as category pages) of my blogs after upgrading to WordPress 6.1. The page continues to load, and shows a blank page until it times out.

A not too useful error appears in the error log:
PHP Fatal error: Maximum execution time of 30 seconds exceeded in [path]/htdocs/wp-includes/pluggable.php on line 2662

When I deactivated Simple Lightbox the problem went away. I deactivated other plugins first but the error continued until I tried yours.

Details

  • URL of Page exhibiting problem: https://odd.blog/
  • Browser(s) exhibiting problem (Firefox, Chrome, etc.): Firefox
  • Version of SLB Installed: 2.9.2
  • Other plugins installed: Ten other active ones, but I disabled almost all of them before finding that disabling Simple Lightbox stopped the problem happening.

Screenshot 2022-11-03 at 12-12-59 Reading Settings ‹ Something Odd! — WordPress

The issue was only occurring on the homepage and archive pages. Single posts appeared fine. The plugin is now deactivated, so the URL above doesn't show the problem any more.

@benjamin-rota
Copy link

Hello
I have the same problem on 2 websites, the issue appeared after upgrading to WP 6.1.
The issue doesn't appear with WP 6.0.3, or when deactivating the plugin Simple Lightbox.

In the logs :
PHP Fatal error: Maximum execution time of 165 seconds exceeded in [path]/www/wp-content/plugins/simple-lightbox/controller.php on line 1183

On the frontend an encoding error is shown when the script fails.

@archetyped
Copy link
Owner

archetyped commented Nov 3, 2022

@donnchawp please update your original post with the requested details so that your issue can be fully evaluated.

All:

  • Is the issue occurring only on home/archive pages? Or is it also occurring on single posts/pages where SLB should be working?
  • Please provide a screenshot of your site's Admin→Settings→Reading options page.
  • Please provide a link to a page where the issue occurs (it's fine if SLB is deactivated).

Thank you.

@benjamin-rota
Copy link

  • The issue occurs only on single posts/pages where SLB should be working, not on the home or other pages without image galeries. It also occurs on category pages if the category contains one or more article where SLB should be working.
  • Please see screenshots joined.
    Capture
    Capture1
  • At this URL you can see the problem occuring (WP 6.1 + your plugin) : https://www.amaranthe.org/category/don-des-dragons/

@donnchawp
Copy link
Author

My original post has been updated. Thanks for the quick response.

@archetyped
Copy link
Owner

Thank you for the additional details.

SLB has been directly tested on multiple image-heavy WP 6.1 sites and I have not been able to reproduce this issue.

"Maximum execution time exceeded" errors are cumulative, so disabling plugins until the error stops may not identify the actual plugin(s) causing the issue, but may just reduce the total processing time under the configured threshold (aka "the straw that broke the camel's back").

Following these instructions on identifying plugin/theme conflicts would be recommended to confirm whether SLB alone functions properly, or whether other plugins/themes may be causing a conflict.


@donnchawp SLB does not make any direct use of the code referenced in the error message you provided. More detailed debug output with WP_DEBUG would be helpful in determining whether that error is connected to a process in SLB.

Also, as SLB appears to be working on single posts, but not on archive pages (home, category, etc.) on your site, please create a single test post with a single image link in a temporary category to see if the issue is encountered when loading the archive page for that category.

(Tip: You can change the sample post's publication date to a date in the past so that it does not show up at the top of your home page, if you're testing on the production site.)

Please let me know what you find.


@benjamin-rota please create a test post with a single image link to see if the issue is encountered there as well. When testing, temporarily activating a default theme (e.g. Twenty Twenty-One) and disabling all other plugins will help to isolate SLB from any other conflicts.

(Tip: You can change the sample post's publication date to a date in the past so that it does not show up at the top of your home page, if you're testing on the production site.)

Please let me know what you find.

Thanks.

@benjamin-rota
Copy link

Hi
I did as you requested and I think I found a new clue that may help you to reproduce the issue.

If I create a simple post with a single image it works fine. But if I insert a galery then the issue appears.

To reproduce :
Create a single post
Add media
Create a galery
Select 2 or more images
Create a new galery
Link to : media file
Insert galery

Not sure vocabulary is exactly the same as I use WP in french.

Thanks

@archetyped
Copy link
Owner

archetyped commented Nov 5, 2022

@benjamin-rota glad to hear you were able to isolate the issue further.

  • Just to confirm, this was on a site with only SLB activated (no other plugins) and a using a default WordPress theme?
  • Can you please specify which default WordPress theme you used?
  • Does the issue occur when creating a gallery with just a single image?
  • Does the issue occur when the attachment page is used as the link for the gallery items?
  • Is the gallery created with the block editor (Gutenberg), or the classic editor?

You also previously noted that the same issue is occurring on 2 websites. Are both sites hosted on the same hosting provider? Can you please provide a link to the hosting provider these sites are on?

@benjamin-rota
Copy link

  • Just to confirm, this was on a site with only SLB activated (no other plugins) and a using a default WordPress theme?

Yes.

* Can you please specify which default WordPress theme you used?

Twenty twenty two.

* Does the issue occur when creating a gallery with just a single image?

No. 2 or more images need to be in the gallery for the issue to occur.

* Does the issue occur when the attachment page is used as the link for the gallery items?

Yes, attachment page or media link.

* Is the gallery created with the block editor (Gutenberg), or the classic editor?

Classic editor.

You also previously noted that the same issue is occurring on 2 websites. Are both sites hosted on the same hosting provider? Can you please provide a link to the hosting provider these sites are on?

Yes, www.ovh.com

Hope you can reproduce the issue.

@domi-a
Copy link

domi-a commented Nov 5, 2022

same happend here. automatic update to wordpress 6.1.0 and every post with a gallery is not able to show any content.
only plugin active.
wordpress admin pages dont report any problem.
systemlog only shows the above mentioned error: PHP Fatal error...
a downgrade to 6.0.3 and the plugin works as espected.

@archetyped
Copy link
Owner

I've created a test branch to help isolate the issue. Please follow the instructions below to install the test plugin:

  1. Deactivate and delete the official SLB plugin from your site.
  2. Download the test plugin (zip file).
    GitHub Download Code annotated screenshot
  3. Install the test plugin zip file (instructions).
  4. Activate test plugin.

Once the test plugin is installed and activated, test the same page(s) on your site as before to confirm whether the issue remains or not and report your findings.

Thank you.

@archetyped
Copy link
Owner

@benjamin-rota What version of PHP is the site running on?

@archetyped
Copy link
Owner

@domi-a please provide the following details:

  • Issue also exists in post with nothing but a single gallery containing 1 image: (yes/no)
  • Editor used: (Block Editor/Classic Editor plugin)
  • Default WordPress theme used for testing: (e.g. Twenty-Twenty, etc.)
  • PHP Version:
  • Server platform/version: (e.g. Apache, Nginx, etc.)
  • Web hosting provider: (link)

@benjamin-rota
Copy link

@benjamin-rota What version of PHP is the site running on?

7.3.32
OVH doesn't allow me to update PHP further for the moment.

@benjamin-rota
Copy link

I have installed the test plugin and tested again.

Now galleries with 1 or 2 images are working, but the issue is still there with 3 or more images.

@archetyped
Copy link
Owner

archetyped commented Nov 8, 2022

I have installed the test plugin and tested again.

Now galleries with 1 or 2 images are working, but the issue is still there with 3 or more images.

@benjamin-rota what is the error message in the logs? The code referenced in your original log message is not active in the test version, so the error message should be different.

@domi-a
Copy link

domi-a commented Nov 8, 2022

@domi-a please provide the following details:

  • Issue also exists in post with nothing but a single gallery containing 1 image: (yes/no)
    when i use 1 or 2 pictures in a gallery linkt to media. SLB does not apper, but the content displays
    when i use 3 pictures content does not appear on this post.
  • Editor used: (Block Editor/Classic Editor plugin)
    i have no editor plugin
  • Default WordPress theme used for testing: (e.g. Twenty-Twenty, etc.)
    i swiched to twenty-twenty-one, problem does still appear
  • PHP Version:
  • Server platform/version: (e.g. Apache, Nginx, etc.)
  • Web hosting provider: (link)
    Server architecture | Linux 5.10.103-v7l+ armv7l
    Web server | Apache/2.4.54 (Debian)
    PHP version | 7.4.33 (Does not support 64bit values)
    it is running on my linux server in a docker container with the official docker image

@archetyped
Copy link
Owner

it is running on my linux server in a docker container with the official docker image

@domi-a please provide a link to the "official docker image" you are referring to, and I may hopefully be able to reproduce the issue.

@domi-a
Copy link

domi-a commented Nov 9, 2022

@domi-a please provide a link to the "official docker image" you are referring to, and I may hopefully be able to reproduce the issue.

https://hub.docker.com/_/wordpress
not sure if you want to go down that rabbit hole if you aren't familiar with docker.
fastest way is to use docker-compose. as you have one config and one start command.

docker style vs host installation doesn't make any difference as it is build from official wp sources - in kinds of a plugin.

@benjamin-rota
Copy link

I have installed the test plugin and tested again.
Now galleries with 1 or 2 images are working, but the issue is still there with 3 or more images.

@benjamin-rota what is the error message in the logs? The code referenced in your original log message is not active in the test version, so the error message should be different.

[09-Nov-2022 11:03:42 UTC] PHP Fatal error: Maximum execution time of 165 seconds exceeded in [path]/www/wp-includes/pluggable.php on line 2660

@benjamin-rota
Copy link

Hi

I managed at last to update PHP to 7.4 with a "stable64" execution engine, on both websites where the issue occured.
The update from PHP stable 7.3.32 to PHP stable64 7.4 resolved the issue completely, with the normal 2.9.2 version of SLB and the test version provided before.

@archetyped
Copy link
Owner

archetyped commented Nov 11, 2022

@benjamin-rota glad to hear you were able to find the solution to your issue!

I'm not sure if something changed with WP 6.1 that requires a 64-bit environment, but that could be the case.

@domi-a as the details you provided noted PHP version | 7.4.33 (Does not support 64bit values), updating to a 64-bit build would be recommended to see if that resolves your issue. Unfortunately, if this is a requirement of WordPress core, there's not much that can be done from SLB's end.

@domi-a
Copy link

domi-a commented Nov 11, 2022

@domi-a as the details you provided noted PHP version | 7.4.33 (Does not support 64bit values), updating to a 64-bit build would be recommended to see if that resolves your issue. Unfortunately, if this is a requirement of WordPress core, there's not much that can be done from SLB's end.

my hardware is armv8, but my host OS is armv7, as you can read in my reply.
and as i read it: the docker image is only availible in armv5, armv7 and armv8-64.
so afaik i can not run an 64 bit image of wordpress.

and we are talking about a plugin in one of my hosted applications - nothing to dictate my host OS.

@archetyped archetyped changed the title Conflict with WordPress 6.1 Conflict with WordPress 6.1 (32-bit platforms) Nov 16, 2022
@archetyped
Copy link
Owner

archetyped commented Nov 16, 2022

This issue has been confirmed as a bug in WordPress core, where the wp_rand() function returns incorrect values on 32-bit platforms.

A hotfix may be released for SLB to avoid this bug until WordPress is updated, but upgrading to a 64-bit platform is recommended, as wp_rand() is used throughout WordPress' code, which may cause unexpected behavior.

@archetyped archetyped changed the title Conflict with WordPress 6.1 (32-bit platforms) Conflict with WordPress 6.1 wp_rand() (32-bit platforms) Nov 18, 2022
@archetyped archetyped changed the title Conflict with WordPress 6.1 wp_rand() (32-bit platforms) Conflict with WordPress 6.1 (wp_rand() bug on 32-bit platforms) Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants