-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed PHP SEGV when constructing messages from a destructor.
This also fixes the keep_descriptor_pool_after_request option, which was not working properly.
- Loading branch information
Showing
8 changed files
with
162 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
cd $(dirname $0) | ||
|
||
set -ex | ||
|
||
PORT=12345 | ||
TIMEOUT=10 | ||
|
||
./compile_extension.sh | ||
|
||
run_test() { | ||
echo | ||
echo "Running memory leak test, args: $@" | ||
|
||
EXTRA_ARGS="" | ||
ARGS="-d xdebug.profiler_enable=0 -d display_errors=on -dextension=../ext/google/protobuf/modules/protobuf.so" | ||
|
||
for i in "$@"; do | ||
case $i in | ||
--keep_descriptors) | ||
EXTRA_ARGS=-dprotobuf.keep_descriptor_pool_after_request=1 | ||
shift | ||
;; | ||
esac | ||
done | ||
|
||
export ZEND_DONT_UNLOAD_MODULES=1 | ||
export USE_ZEND_ALLOC=0 | ||
|
||
if valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all --suppressions=valgrind.supp --num-callers=100 php $ARGS $EXTRA_ARGS memory_leak_test.php; then | ||
echo "Memory leak test SUCCEEDED" | ||
else | ||
echo "Memory leak test FAILED" | ||
exit 1 | ||
fi | ||
} | ||
|
||
run_test | ||
run_test --keep_descriptors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters