- docs at https://code.google.com/p/address-sanitizer/w/list
- to be able to get asan working from node, both node.js and mapnik must be build with
-fsanitize=address
inCXXFLAGS
andLDFLAGS
. If this is not done you'll hit symbol errors on linux and on mac the program just quits silently - to be able to get symbols with clang-3.5 + asan you need to use
./proj 2> log && asan_symbolize-3.5 / < log | c++filt
- asan seems to work on OS X (with source built clang++) but detects more problems (particularly leaks) on linux (with clang=3.5 from llvm apt packages).
- turn on everything except leaks
export ASAN_OPTIONS=check_initialization_order=1:detect_leaks=0:strict_init_order=1:detect_stack_use_after_return=1:detect_odr_violation=0
- suppress node.js leaks with
echo 'leak:node::Buffer' > supp.txt && export LSAN_OPTIONS=suppressions=supp.txt
This file contains hidden or 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
#!/usr/bin/env bash | |
set -eu | |
set -o pipefail | |
: ' | |
Normally postgres is installed globally and you can only run one postgres server. This shows otherwise. | |
This script demonstrates how to: |
This file contains hidden or 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
#!/usr/bin/env bash | |
set -e -u | |
PYCAIRO_VERSION="py2cairo-1.10.0" | |
if [[ ! -f ${PYCAIRO_VERSION}.tar.bz2 ]]; then | |
wget https://mapnik.s3.amazonaws.com/deps/${PYCAIRO_VERSION}.tar.bz2 | |
fi | |
if [[ ! -d ${PYCAIRO_VERSION} ]]; then |
This file contains hidden or 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
git clone --depth 1 https://github.com/mapbox/mason.git | |
export MASON_DIR=$(pwd)/mason | |
./mason/mason install gdal 1.11.1 | |
./mason/mason link gdal 1.11.1 | |
# test gdalinfo works | |
./mason_packages/.link/bin/gdalinfo --version |
This file contains hidden or 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
#include <termios.h> | |
#include <boost/geometry.hpp> | |
#include <boost/geometry/geometries/point.hpp> | |
#include <boost/geometry/geometries/box.hpp> | |
#include <boost/geometry/index/rtree.hpp> | |
/* | |
clang++ -o t t.cpp -I/usr/local/include/ |
This file contains hidden or 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
#include <mapnik/image_data.hpp> | |
#include <mapnik/image_data_any.hpp> | |
#include <mapnik/util/variant.hpp> | |
#include <iostream> | |
/* | |
source localize.sh | |
clang++ -o visitor-test visitor-test.cpp -Wpadded \ | |
-isystem /Users/dane/projects/mapnik-packaging/osx/out/build-cpp11-libcpp-x86_64-macosx/include \ |
This file contains hidden or 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
# http://clang-developers.42468.n3.nabble.com/How-to-determine-clang-s-system-include-dirs-to-set-in-ASTVisitor-td4029080.html | |
: ' | |
https://gist.github.com/springmeyer/4480481 | |
https://gist.github.com/springmeyer/4279264 | |
' | |
git clone http://llvm.org/git/llvm.git | |
cd llvm/tools | |
git clone http://llvm.org/git/clang.git |
This file contains hidden or 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
diff --git a/bindings/python/mapnik_generator_grammars.cpp b/bindings/python/mapnik_generator_grammars.cpp | |
index e621628..f6fa4d1 100644 | |
--- a/bindings/python/mapnik_generator_grammars.cpp | |
+++ b/bindings/python/mapnik_generator_grammars.cpp | |
@@ -29,8 +29,8 @@ | |
using sink_type = std::back_insert_iterator<std::string>; | |
template struct mapnik::json::feature_generator_grammar<sink_type>; | |
-template struct mapnik::json::geometry_generator_grammar<sink_type>; | |
-template struct mapnik::json::multi_geometry_generator_grammar<sink_type>; |
This file contains hidden or 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
ubuntu@ip-10-39-6-15:~/node-mapnik$ asan_symbolize-3.5 / < log | c++filt | |
==25020==WARNING: Can't read from symbolizer at fd 10 | |
==25020==WARNING: Can't read from symbolizer at fd 10 | |
==25020==WARNING: Can't read from symbolizer at fd 10 | |
==25020==WARNING: Can't read from symbolizer at fd 10 | |
==25020==WARNING: Failed to use and restart external symbolizer! | |
================================================================= | |
==25020==ERROR: LeakSanitizer: detected memory leaks |
This file contains hidden or 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
$ npm test | |
================================================================= | |
==21035==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x614000009640 | |
#0 0x5b1f0b in operator delete(void*) (/usr/local/bin/node+0x5b1f0b) | |
#1 0x1039e8b in node::After(uv_fs_s*) (/usr/local/bin/node+0x1039e8b) | |
#2 0x10be1ec in uv__work_done /home/ubuntu/node/out/../deps/uv/src/unix/threadpool.c:220:5 | |
#3 0x10b40c3 in uv__async_event /home/ubuntu/node/out/../deps/uv/src/unix/async.c:80:5 | |
#4 0x10b42cb in uv__async_io /home/ubuntu/node/out/../deps/uv/src/unix/async.c:156:3 | |
#5 0x10c0b03 in uv__io_poll /home/ubuntu/node/out/../deps/uv/src/unix/linux-core.c:271:9 | |
#6 0x10b4767 in uv_run /home/ubuntu/node/out/../deps/uv/src/unix/core.c:317:5 |