Skip to content

Instantly share code, notes, and snippets.

View springmeyer's full-sized avatar

Dane Springmeyer springmeyer

View GitHub Profile
@springmeyer
springmeyer / valgrind-out.txt
Created February 22, 2012 02:19
valgrind output from hex.js
root@storm:/usr/share/tilemill# valgrind node hex.js
==8296== Memcheck, a memory error detector
==8296== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==8296== Using Valgrind-3.6.1-Debian and LibVEX; rerun with -h for copyright info
==8296== Command: node hex.js
==8296==
==8296== Warning: set address range perms: large range [0xadb3000, 0x2adb3000) (noaccess)
==8296== Conditional jump or move depends on uninitialised value(s)
==8296== at 0x67A5510: inflateReset2 (in /lib/x86_64-linux-gnu/libz.so.1.2.3.4)
==8296== by 0x67A5605: inflateInit2_ (in /lib/x86_64-linux-gnu/libz.so.1.2.3.4)
@springmeyer
springmeyer / valgrind-out.txt
Created February 17, 2012 00:57
mem issues with freetype/postgres/mapnik hextree
root@wiretap:~/exports# valgrind node /usr/share/tilemill/index.js export --config=/etc/tilemill/tilemill.config --bbox=90,-85.0511,180,85.0511 --skipblank=1 --resume=1 --minzoom=8 --maxzoom=12 mapbox-base features-d-12.bigtiles
==29957== Memcheck, a memory error detector
==29957== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==29957== Using Valgrind-3.6.1-Debian and LibVEX; rerun with -h for copyright info
==29957== Command: node /usr/share/tilemill/index.js export --config=/etc/tilemill/tilemill.config --bbox=90,-85.0511,180,85.0511 --skipblank=1 --resume=1 --minzoom=8 --maxzoom=12 mapbox-base features-d-12.bigtiles
==29957==
==29957== Warning: set address range perms: large range [0xadb3000, 0x2adb3000) (noaccess)
==29957== Invalid read of size 8
==29957== at 0x2DF0CAE5: mapnik::freetype_engine::register_font(std::string const&) (font_engine_freetype.cpp:87)
==29957== by 0x2DF0CE53: mapnik::freetype_engine::register_fonts(std::string const&, bool) (font_engine_freetype.cpp:140)
diff --git a/plugins/input/sqlite/sqlite_datasource.cpp b/plugins/input/sqlite/sqlite_datasource.cpp
index 02e184d..216493f 100644
--- a/plugins/input/sqlite/sqlite_datasource.cpp
+++ b/plugins/input/sqlite/sqlite_datasource.cpp
@@ -598,10 +598,10 @@ featureset_ptr sqlite_datasource::features(query const& q) const
s << " OFFSET " << row_offset_;
}
-#ifdef MAPNIK_DEBUG
- std::clog << "Sqlite Plugin: table: " << table_ << "\n\n";
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map[]>
<Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over" background-color="white">
<Style name="countries" filter-mode="first">
<Rule>
<PolygonSymbolizer fill="blue" />
</Rule>
</Style>
{
"data": {
"": {
"NAME_FORMA": "",
"POP_EST": 307899.0
},
"Bolivarian Republic of Venezuela": {
"NAME_FORMA": "Bolivarian Republic of Venezuela",
"POP_EST": 26814843.0
},
@springmeyer
springmeyer / gist:1770941
Created February 8, 2012 16:44
topcube crash on ubuntu natty
(gdb) r
Starting program: /usr/share/tilemill/node_modules/topcube/build/default/topcube --url=http://localhost:20009
[Thread debugging using libthread_db enabled]
(process:11382): GLib-WARNING **: /build/buildd/glib2.0-2.28.6/./glib/goption.c:2132: ignoring no-arg, optional-arg or filename flags (600) on option of type 800
Program received signal SIGSEGV, Segmentation fault.
0x01e83706 in ?? () from /lib/i386-linux-gnu/libc.so.6
(gdb) bt
#0 0x01e83706 in ?? () from /lib/i386-linux-gnu/libc.so.6
@springmeyer
springmeyer / profile.sh
Created February 8, 2012 08:37
tilemill profiling with node-profile
~/projects/tilemill[master]$ nodeprofile index.js
Running: node --prof --log-snapshot-positions --logfile=profile-13286900848209214.log index.js
line 24563: unknown code state: 0x12df8ec68
Statistical profiling result from profile-13286900848209214.log, (1549 ticks, 750 unaccounted, 0 excluded).
[Unknown]:
ticks total nonlib name
750 48.4%
[Shared libraries]:
diff --git a/src/js_grid_utils.hpp b/src/js_grid_utils.hpp
index f531d82..d40909d 100644
--- a/src/js_grid_utils.hpp
+++ b/src/js_grid_utils.hpp
@@ -161,7 +161,7 @@ static void write_features(T const& grid_type,
}
// FIXME: segfault here because feature ctx is gone?
//std::clog << "feautre : " << *feature << "\n";
- //mapnik::feature_kv_iterator itr = feature->begin();
+ mapnik::feature_kv_iterator itr = feature->begin();
@springmeyer
springmeyer / osx-clang-warning.txt
Created January 31, 2012 18:35
local temp object warning
In file included from src/metawriter.cpp:25:
In file included from include/mapnik/metawriter_json.hpp:28:
In file included from include/mapnik/parse_path.hpp:28:
include/mapnik/attribute.hpp:42:16: warning: returning reference to local temporary object [-Wreturn-stack-address]
return f.get(name_);
^~~~~~~~~~~~
include/mapnik/parse_path.hpp:67:31: note: in instantiation of function template specialization 'mapnik::attribute::value<mapnik::value, mapnik::metawriter_property_map>' requested
here
filename_ += attr.value<mapnik::value,feature_type>(feature_).to_string();
^
(gdb) bt
#0 0x00007ffff64cbd05 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007ffff64cfab6 in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007ffff6fa06dd in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff6f9e926 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff6f9e953 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff6f9ea5e in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff6f48f92 in std::__throw_bad_alloc() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#7 0x00007fffca88006b in shape_io::read_polygon(boost::ptr_vector<mapnik::geometry<double, mapnik::vertex_vector>, boost::heap_clone_allocator, std::allocator<void*> >&) () from /usr/lib/mapnik/input/shape.input
#8 0x00007fffca87c82f in shape_index_featureset<mapnik::filter_in_box>::next() () from /usr/lib/mapnik/input/shape.input