-
Notifications
You must be signed in to change notification settings - Fork 202
Make valgrind run on travis tests of v8js in php7 (Both ZTS and NTS) #249
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
Conversation
I think both testing under NTS and testing with valgrind are a good idea. When I still had the Jenkins instance around I actually had a test based on ASAN ... ... so thank you for coming up with this and I'll happily merge this patch once two issues are resolved:
The former is generally a problem with Your SKIP-test based on stesie@hahnschaaf:~/Projekte/v8js-php7$ tr '\000' '\n' < /proc/29232/environ
LD_LIBRARY_PATH=/usr/lib/debug
PATH_TRANSLATED=/home/stesie/Projekte/v8js-php7/tests/extensions_basic.php
SCRIPT_FILENAME=/home/stesie/Projekte/v8js-php7/tests/extensions_basic.php
ZEND_DONT_UNLOAD_MODULES=1
TEST_PHP_EXECUTABLE=/usr/bin/php7.0
GLIBCPP_FORCE_NEW=1
REDIRECT_STATUS=1
REQUEST_METHOD=GET
PWD=/home/stesie/Projekte/v8js-php7
USE_ZEND_ALLOC=0
GLIBCXX_FORCE_NEW=1
VALGRIND_LAUNCHER=/usr/bin/valgrind.bin ... I think a test on |
Thanks, will address comments after work this weekend |
You included the ZTS with Valgrind part in your other pull request already, I've just noticed after merging that it reports memory leaks all over then (which it doesn't for me locally). Are you able to reproduce this? For the moment I've reverted the Valgrind-enabling part as it is included in this patch anyways. Maybe just rebase it onto current master if it'll report leaks also |
I rebased against master. I still have these problems locally. I'm running v8 5.4.0 candidate 1 on the laptop for tests (422d14350d0678317f77a58b4d418d22818a1db8), should probably use stable instead. A similar issue seems to be https://bugs.chromium.org/p/v8/issues/detail?id=4122 I can reproduce some leaks and test failures locally when using ZTS (Maybe php and v8js garbage collect in different orders in zts and nts). https://gist.github.com/TysonAndre/b50f8643fafe1000de8a2172ae52ef35
|
Edit: never mind about This seems like it's mostly working in libv8 5.7 in combination with valgrind. There are PPAs for 5.7 and newer from the same person (installing to /opt/libv8-5.7, etc), could the README (and README.linux) be updated to mention those? Also, I don't see a maximum libv8 version which phpv8 has been tested with. |
https://travis-ci.org/TysonAndre/v8js/jobs/207990386
I don't see it if I dump
However, I do see |
Valgrind checks for invalid memory accesses and memory leaks. "-m" makes php unit tests use valgrind (and malloc instead of emalloc, etc.) (Takes around 20 minutes) Also support testing v8js with NTS (The default used by Travis is ZTS) One of the builds will download and install PHP. This will be cached. - This reproduces #247 on travis - For details on travis build caching, see https://docs.travis-ci.com/user/caching/#Pull-request-builds-and-caches Skip memory and time limit tests - Those are flaky with valgrind. The tests fail but don't have memory leaks. (When #248 was tested) Use 5.7 (earliest ppa >= 5.6) for running valgrind checks. Fix ppa checks - The installation folder changed to /opt/libv8-5.7 - run tests both with and without valgrind in libv8 5.7 Otherwise, time limits and memory limits wouldn't be tested at all in 5.7 Always pass strings for splitting environment variables by spaces.
Hey @TysonAndre, thanks for continuing working on this issue :-) We can indeed switch the travis tests to V8 5.7 and 5.8 or so. Generally there shouldn't be a upper bound regarding supported versions; contrary I don't think we need to test with really old versions. After all they don't have security support anyways and hence shouldn't be used. Even so I try not to actively break with old versions, it's not a priority goal IMHO Regarding https://travis-ci.org/TysonAndre/v8js/jobs/207990386, |
This PR continues to have problems setting up exceptions for unstable tests. I don't think I'll have time to finish this; feel free to work off of this branch. |
Redid #248
Valgrind checks for invalid memory accesses and memory leaks.
"-m" makes php unit tests use valgrind (and malloc instead of emalloc, etc.)
(Takes around 20 minutes)
Also support testing v8js with NTS (The default used by Travis is ZTS)
One of the builds will download and install PHP. This will be cached.
https://docs.travis-ci.com/user/caching/#Pull-request-builds-and-caches
For some reason, the memory and time limit tests sometimes fail under valgrind, but valgrind itself doesn't detect any problems. Marking those as disabled for now.