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

WooCommerce crash #967

Closed
adamziel opened this issue Jan 22, 2024 · 13 comments
Closed

WooCommerce crash #967

adamziel opened this issue Jan 22, 2024 · 13 comments
Labels
[Feature] PHP.wasm [Type] Bug An existing feature does not function as intended
Milestone

Comments

@adamziel
Copy link
Collaborator

Navigating to https://playground.wordpress.net/?php=8.0&wp=6.4&storage=none&networking=yes&networking=yes&php-extension-bundle=kitchen-sink&networking=yes&plugin=pagbank-connect&plugin=woocommerce&plugin=woocommerce-extra-checkout-fields-for-brazil and poking around in the admin dashboard for a while causes the following crash:

CleanShot 2024-01-22 at 17 48 12@2x

I don't have the exact reproduction steps. I've been navigating through Woo products, orders, and the "checkout fields" plugin in wp-admin.

Potentially related:

@adamziel adamziel added [Type] Bug An existing feature does not function as intended [Feature] PHP.wasm labels Jan 22, 2024
@adamziel
Copy link
Collaborator Author

@adamziel
Copy link
Collaborator Author

I was still able to trigger the crash even with HPOS disabled.

@adamziel
Copy link
Collaborator Author

I built PHP with -g2 -O0 and couldn't reproduce the issue anymore. Weird!

@adamziel
Copy link
Collaborator Author

I managed to get some unminified error information:

CleanShot 2024-01-22 at 18 19 45@2x
CleanShot 2024-01-22 at 18 19 16@2x

@adamziel
Copy link
Collaborator Author

adamziel commented Jan 22, 2024

The woocommerce-extra-checkout-fields-for-brazil lives at https://github.com/claudiosanches/woocommerce-extra-checkout-fields-for-brazil/

@adamziel
Copy link
Collaborator Author

The crash also happens without the woocommerce-extra-checkout-fields-for-brazil plugin.

@adamziel
Copy link
Collaborator Author

adamziel commented Jan 22, 2024

I couldn't reproduce it on vanilla woocommerce, too, which makes me think it's related to the pagbank-connect plugin. Also noteworthy, post_message_to_js used by the fetch() HTTP transport showed up in a bunch of the stack traces logged around the time of the crash which makes me think the crash occurred when processing a response to some HTTP request.

@adamziel
Copy link
Collaborator Author

adamziel commented Jan 22, 2024

Here's a different stacktrace I got with vanilla WooCommerce, likely related to an out of memory error:

Uncaught RangeError: Maximum call stack size exceeded
    at runtime.asm.<computed> (wasm-error-reporting.ts:60:14)
    at invoke_viii (php_8_0.js?t=1705943705634:6822:3)
    at zend_mm_safe_error (027ecb4e:0xe637f)
    at zend_mm_alloc_pages (027ecb4e:0x1f09db)
    at zend_mm_alloc_small_slow (027ecb4e:0x409b5)
    at _emalloc (027ecb4e:0x78f7)
    at smart_str_erealloc (027ecb4e:0x87c8)
    at xbuf_format_converter (027ecb4e:0x2d31b6)
    at php_printf_to_smart_str (027ecb4e:0x515a12)
    at zend_error_va_list (027ecb4e:0x29887d)

Here's the call cycle:

CleanShot 2024-01-22 at 18 38 24@2x

@adamziel
Copy link
Collaborator Author

Ricardo said:

I see the Pagbank plugin has an issue with the CORS. Meaning that the backend calls doesn’t work when called with fetch/frontend ajax calls. Probably it is related to that matter.

@adamziel
Copy link
Collaborator Author

adamziel commented Mar 21, 2024

I managed to get some unminified error information:

CleanShot 2024-01-22 at 18 19 45@2x ![CleanShot 2024-01-22 at 18 19 16@2x]

This error was fixed by @bgrgicak in #1104. That being said, I ran into another one:

CleanShot 2024-03-22 at 00 23 47@2x

Before it was triggered, I saw the following debug output:

[21-Mar-2024 23:22:27 UTC] PHP Fatal error:  Out of memory (allocated 65011712) (tried to allocate 4194304 bytes) in /wordpress/wp-content/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-webhook-deliveries-v2-controller.php on line 143
[21-Mar-2024 23:22:28 UTC] PHP Fatal error:  Out of memory (allocated 62914560) (tried to allocate 4194304 bytes) in /wordpress/wp-content/plugins/woocommerce/includes/rest-api/Controllers/Version2/class-wc-rest-webhook-deliveries-v2-controller.php on line 143
[21-Mar-2024 23:22:28 UTC] PHP Fatal error:  Out of memory (allocated 58720256) (tried to allocate 2097152 bytes) in /wordpress/wp-content/plugins/woocommerce/includes/wc-deprecated-functions.php on line 373
[21-Mar-2024 23:22:28 UTC] PHP Fatal error:  Out of memory (allocated 41943040) (tried to allocate 2097152 bytes) in /wordpress/wp-content/plugins/woocommerce/includes/wc-deprecated-functions.php on line 373
[21-Mar-2024 23:22:28 UTC] PHP Fatal error:  Out of memory (allocated 33554432) (tried to allocate 2097152 bytes) in /wordpress/wp-content/plugins/woocommerce/includes/wc-deprecated-functions.php on line 373
[21-Mar-2024 23:22:28 UTC] PHP Fatal error:  Out of memory (allocated 29360128) (tried to allocate 2097152 bytes) in /wordpress/wp-content/plugins/woocommerce/includes/wc-deprecated-functions.php on line 373
[21-Mar-2024 23:22:29 UTC] PHP Fatal error:  Out of memory (allocated 27262976) (tried to allocate 2097152 bytes) in /wordpress/wp-content/plugins/woocommerce/includes/wc-deprecated-functions.php on line 373

Perhaps auto-rotating the PHP instance on an Out of memory error would help here.

@bgrgicak
Copy link
Collaborator

@adamziel do you have any instructions on how to recreate this?

@adamziel
Copy link
Collaborator Author

@bgrgicak nothing more than what I described in other comments – install those plugins, browse for a prolonged period of time, hope the crash happens.

@adamziel
Copy link
Collaborator Author

This is likely a duplicate of #1332, except #1332 has a clear reproduction. I'll close this one.

@adamziel adamziel closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] PHP.wasm [Type] Bug An existing feature does not function as intended
Projects
Archived in project
Development

No branches or pull requests

2 participants