Skip to content

Commit a30405b

Browse files
authored
Revert "Avoid partial munmap memory leak" (#1195)
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.
1 parent a678c93 commit a30405b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+27
-379
lines changed

packages/php-wasm/compile/php-wasm-memory-storage/.gitignore

Lines changed: 0 additions & 41 deletions
This file was deleted.

packages/php-wasm/compile/php-wasm-memory-storage/config.m4

Lines changed: 0 additions & 94 deletions
This file was deleted.

packages/php-wasm/compile/php-wasm-memory-storage/config.w32

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/php-wasm/compile/php-wasm-memory-storage/php_wasm_memory_storage.h

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/php-wasm/compile/php-wasm-memory-storage/wasm_memory_storage.c

Lines changed: 0 additions & 135 deletions
This file was deleted.

packages/php-wasm/compile/php/Dockerfile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ RUN git clone https://github.com/php/php-src.git php-src \
1414
--single-branch \
1515
--depth 1;
1616

17-
# Work around memory leak due to PHP using Emscripten's incomplete mmap/munmap support
18-
COPY ./php-wasm-memory-storage /root/php-src/ext/wasm_memory_storage
19-
2017
RUN cd php-src && ./buildconf --force
2118

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

226219
# Add VRZNO if needed
@@ -277,7 +270,6 @@ RUN source /root/emsdk/emsdk_env.sh && \
277270
--enable-bcmath \
278271
--enable-ctype \
279272
--enable-tokenizer \
280-
--enable-wasm_memory_storage \
281273
$(cat /root/.php-configure-flags)
282274

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

packages/php-wasm/compile/php/php-chunk-alloc-zend-assert-8.3.patch

Lines changed: 0 additions & 13 deletions
This file was deleted.

packages/php-wasm/compile/php/php-chunk-alloc-zend-assert.patch

Lines changed: 0 additions & 13 deletions
This file was deleted.
-1.02 KB
Binary file not shown.
-1.01 KB
Binary file not shown.
-637 Bytes
Binary file not shown.
-1009 Bytes
Binary file not shown.
-969 Bytes
Binary file not shown.
-663 Bytes
Binary file not shown.
-679 Bytes
Binary file not shown.
-700 Bytes
Binary file not shown.
-713 Bytes
Binary file not shown.

packages/php-wasm/node/public/php_7_0.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const dependencyFilename = __dirname + '/7_0_33/php_7_0.wasm';
22
export { dependencyFilename };
3-
export const dependenciesTotalSize = 12779191;
3+
export const dependenciesTotalSize = 12778149;
44
export function init(RuntimeName, PHPLoader) {
55
/**
66
* Overrides Emscripten's default ExitStatus object which gets

packages/php-wasm/node/public/php_7_1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const dependencyFilename = __dirname + '/7_1_30/php_7_1.wasm';
22
export { dependencyFilename };
3-
export const dependenciesTotalSize = 13301166;
3+
export const dependenciesTotalSize = 13300133;
44
export function init(RuntimeName, PHPLoader) {
55
/**
66
* Overrides Emscripten's default ExitStatus object which gets

packages/php-wasm/node/public/php_7_2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const dependencyFilename = __dirname + '/7_2_34/php_7_2.wasm';
22
export { dependencyFilename };
3-
export const dependenciesTotalSize = 13991791;
3+
export const dependenciesTotalSize = 13991154;
44
export function init(RuntimeName, PHPLoader) {
55
/**
66
* Overrides Emscripten's default ExitStatus object which gets

packages/php-wasm/node/public/php_7_3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const dependencyFilename = __dirname + '/7_3_33/php_7_3.wasm';
22
export { dependencyFilename };
3-
export const dependenciesTotalSize = 14098602;
3+
export const dependenciesTotalSize = 14097593;
44
export function init(RuntimeName, PHPLoader) {
55
/**
66
* Overrides Emscripten's default ExitStatus object which gets

packages/php-wasm/node/public/php_7_4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const dependencyFilename = __dirname + '/7_4_33/php_7_4.wasm';
22
export { dependencyFilename };
3-
export const dependenciesTotalSize = 14331003;
3+
export const dependenciesTotalSize = 14330034;
44
export function init(RuntimeName, PHPLoader) {
55
/**
66
* Overrides Emscripten's default ExitStatus object which gets

packages/php-wasm/node/public/php_8_0.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const dependencyFilename = __dirname + '/8_0_30/php_8_0.wasm';
22
export { dependencyFilename };
3-
export const dependenciesTotalSize = 13597807;
3+
export const dependenciesTotalSize = 13597144;
44
export function init(RuntimeName, PHPLoader) {
55
/**
66
* Overrides Emscripten's default ExitStatus object which gets

0 commit comments

Comments
 (0)