Skip to content

Commit

Permalink
Revert "Avoid partial munmap memory leak" (#1195)
Browse files Browse the repository at this point in the history
Reverts #1189

Unfortunately, the current implementation triggers "memory access out of
bounds" errors in places they weren't happening before. See
#1194 for more
context.
  • Loading branch information
adamziel authored Apr 4, 2024
1 parent a678c93 commit a30405b
Show file tree
Hide file tree
Showing 63 changed files with 27 additions and 379 deletions.
41 changes: 0 additions & 41 deletions packages/php-wasm/compile/php-wasm-memory-storage/.gitignore

This file was deleted.

94 changes: 0 additions & 94 deletions packages/php-wasm/compile/php-wasm-memory-storage/config.m4

This file was deleted.

7 changes: 0 additions & 7 deletions packages/php-wasm/compile/php-wasm-memory-storage/config.w32

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions packages/php-wasm/compile/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ RUN git clone https://github.com/php/php-src.git php-src \
--single-branch \
--depth 1;

# Work around memory leak due to PHP using Emscripten's incomplete mmap/munmap support
COPY ./php-wasm-memory-storage /root/php-src/ext/wasm_memory_storage

RUN cd php-src && ./buildconf --force

# Bring in the libraries
Expand Down Expand Up @@ -217,10 +214,6 @@ RUN if [ "$WITH_MBREGEX" = "yes" ] && [ "${PHP_VERSION:0:3}" != "7.0" ]; \
COPY ./php/php*.patch /root/
RUN cd /root && \
git apply --no-index /root/php${PHP_VERSION:0:3}*.patch -v && \
( [[ "${PHP_VERSION:0:3}" == '8.3' ]] && \
git apply --no-index /root/php-chunk-alloc-zend-assert-8.3.patch -v || \
git apply --no-index /root/php-chunk-alloc-zend-assert.patch -v \
) && \
touch php-src/patched

# Add VRZNO if needed
Expand Down Expand Up @@ -277,7 +270,6 @@ RUN source /root/emsdk/emsdk_env.sh && \
--enable-bcmath \
--enable-ctype \
--enable-tokenizer \
--enable-wasm_memory_storage \
$(cat /root/.php-configure-flags)

# Silence the errors "munmap() failed: [28] Invalid argument"
Expand Down

This file was deleted.

13 changes: 0 additions & 13 deletions packages/php-wasm/compile/php/php-chunk-alloc-zend-assert.patch

This file was deleted.

Binary file modified packages/php-wasm/node/public/7_0_33/php_7_0.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/public/7_1_30/php_7_1.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/public/7_2_34/php_7_2.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/public/7_3_33/php_7_3.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/public/7_4_33/php_7_4.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/public/8_0_30/php_8_0.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/public/8_1_23/php_8_1.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/public/8_2_10/php_8_2.wasm
Binary file not shown.
Binary file modified packages/php-wasm/node/public/8_3_0/php_8_3.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_0.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const dependencyFilename = __dirname + '/7_0_33/php_7_0.wasm';
export { dependencyFilename };
export const dependenciesTotalSize = 12779191;
export const dependenciesTotalSize = 12778149;
export function init(RuntimeName, PHPLoader) {
/**
* Overrides Emscripten's default ExitStatus object which gets
Expand Down
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_1.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const dependencyFilename = __dirname + '/7_1_30/php_7_1.wasm';
export { dependencyFilename };
export const dependenciesTotalSize = 13301166;
export const dependenciesTotalSize = 13300133;
export function init(RuntimeName, PHPLoader) {
/**
* Overrides Emscripten's default ExitStatus object which gets
Expand Down
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_2.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const dependencyFilename = __dirname + '/7_2_34/php_7_2.wasm';
export { dependencyFilename };
export const dependenciesTotalSize = 13991791;
export const dependenciesTotalSize = 13991154;
export function init(RuntimeName, PHPLoader) {
/**
* Overrides Emscripten's default ExitStatus object which gets
Expand Down
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_3.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const dependencyFilename = __dirname + '/7_3_33/php_7_3.wasm';
export { dependencyFilename };
export const dependenciesTotalSize = 14098602;
export const dependenciesTotalSize = 14097593;
export function init(RuntimeName, PHPLoader) {
/**
* Overrides Emscripten's default ExitStatus object which gets
Expand Down
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_7_4.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const dependencyFilename = __dirname + '/7_4_33/php_7_4.wasm';
export { dependencyFilename };
export const dependenciesTotalSize = 14331003;
export const dependenciesTotalSize = 14330034;
export function init(RuntimeName, PHPLoader) {
/**
* Overrides Emscripten's default ExitStatus object which gets
Expand Down
2 changes: 1 addition & 1 deletion packages/php-wasm/node/public/php_8_0.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const dependencyFilename = __dirname + '/8_0_30/php_8_0.wasm';
export { dependencyFilename };
export const dependenciesTotalSize = 13597807;
export const dependenciesTotalSize = 13597144;
export function init(RuntimeName, PHPLoader) {
/**
* Overrides Emscripten's default ExitStatus object which gets
Expand Down
Loading

0 comments on commit a30405b

Please sign in to comment.