Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Enable npm to build mapbox-gl-native package from source #2352

Merged
merged 2 commits into from
Nov 4, 2015

Conversation

lucaswoj
Copy link
Contributor

We need to get this working for Android builds on OS X before merging this into master. #2344 should help us test our changes.

cc @mikemorris

ref #2348 #2237 #2288 #2349

Fixes #2226

@lucaswoj lucaswoj added ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold Node.js node-mapbox-gl-native labels Sep 17, 2015
@jfirebaugh
Copy link
Contributor

The previously encountered issues with this change were:

@mikemorris
Copy link
Contributor

Rendering errors and crashing in boost::geometry on zoom in osxapp (not ticketed)

Is this worth digging into before bumping to geojsonvt@2.1.0?

@jfirebaugh
Copy link
Contributor

Yeah, definitely. That depends on having geojsonvt as a mason dependency anyway right?

@mikemorris
Copy link
Contributor

That depends on having geojsonvt as a mason dependency anyway right?

Yea, only reason I pinned at 1.1.0 was to minimize changes between the older version mbgl had been using.

@mikemorris
Copy link
Contributor

Fixed Android builds, but the Linux gcc build is now blocked on mapbox/mason#111

@lucaswoj lucaswoj force-pushed the npm-build branch 2 times, most recently from 58a646b to 22d9e43 Compare September 18, 2015 00:23
@lucaswoj
Copy link
Contributor Author

@mikemorris Uh oh! Did I push -f over some of your commits @mikemorris? Sorry! Bad etiquette on my part. I can try to forensics them back if you don't have a reference handy.

@lucaswoj
Copy link
Contributor Author

@mikemorris This branch should good now. Let me know if you see anything that's not ship-shape!

@jfirebaugh
Copy link
Contributor

@mikemorris What's the status of #2346 (comment)?

@mikemorris
Copy link
Contributor

@mikemorris What's the status of #2346 (comment)?

@jfirebaugh It only happened when falling back to a geojsonvt build, so for now we're just dodging it by installing binaries...

@jfirebaugh
Copy link
Contributor

It only happened when falling back to a geojsonvt build, so for now we're just dodging it by installing binaries...

I thought we were purposefully forcing a source build for geojsonvt to avoid mapbox/mason#111?

Rendering errors and crashing in boost::geometry on zoom in osxapp

I still see this in this branch.

@mikemorris
Copy link
Contributor

* Downloading binary package linux-x86_64/geojsonvt/1.1.0-gcc-4.9.2.tar.gz...

This is working now, would appreciate a review of mapbox/mason#115. Once the mason core pull request is merged, I'll merge mapbox/mason#116, then move this back to mason master branch

@mikemorris
Copy link
Contributor

Rendering errors and crashing in boost::geometry on zoom in osxapp

Building on Linux with g++-4.9 locally, I'm hitting the follow compilation error. Possible this could be related @jfirebaugh?

  CXX(target) Release/obj.target/geojsonvt/src/geojsonvt_convert.o
../src/geojsonvt_convert.cpp: In static member function ‘static void mapbox::util::geojsonvt::Convert::convertFeature(std::vector<mapbox::util::geojsonvt::ProjectedFeature>&, const JSValue&, double)’:
../src/geojsonvt_convert.cpp:126:75: error: call of overloaded ‘ProjectedGeometryContainer(<brace-enclosed initializer list>)’ is ambiguous
         ProjectedGeometryContainer geometry({ project(points, tolerance) });
                                                                           ^
../src/geojsonvt_convert.cpp:126:75: note: candidates are:
In file included from ../include/mapbox/geojsonvt/geojsonvt_convert.hpp:4:0,
                 from ../src/geojsonvt_convert.cpp:1:
../include/mapbox/geojsonvt/geojsonvt_types.hpp:65:5: note: mapbox::util::geojsonvt::ProjectedGeometryContainer::ProjectedGeometryContainer(std::vector<mapbox::util::variant<mapbox::util::geojsonvt::ProjectedPoint, mapbox::util::geojsonvt::ProjectedGeometryContainer> >)
     ProjectedGeometryContainer(std::vector<ProjectedGeometry> members_) : members(members_) {
     ^
../include/mapbox/geojsonvt/geojsonvt_types.hpp:61:7: note: mapbox::util::geojsonvt::ProjectedGeometryContainer::ProjectedGeometryContainer(const mapbox::util::geojsonvt::ProjectedGeometryContainer&)
 class ProjectedGeometryContainer {
       ^
../include/mapbox/geojsonvt/geojsonvt_types.hpp:61:7: note: mapbox::util::geojsonvt::ProjectedGeometryContainer::ProjectedGeometryContainer(mapbox::util::geojsonvt::ProjectedGeometryContainer&&)

@mikemorris
Copy link
Contributor

Compilation error above seems to have gone away since rebasing onto latest master, and I think I've tracked down Rendering errors and crashing in boost::geometry on zoom in osxapp to

tree.insert(treeBoxes.begin(), treeBoxes.end());
but I can't seem to find any connection between this crash and usage of GeoJSONVT yet.

Seeing the following boost assertion failure under BUILDTYPE=Debug make run-osx:

Assertion failed: ((detail::is_valid(m_members.translator()(value)))&&("Indexable is invalid")), function raw_insert, file /Users/mikemorris/Projects/mapbox-glnative/mason_packages/headers/boost/1.57.0/include/boost/geometry/index/rtree.hpp, line 1242.

@mikemorris
Copy link
Contributor

Tracked this down to a Box { CollisionPoint {nan, nan}, CollisionPoint {nan, nan} } being inserted into the rtree. Now need to figure out why this is happening. "Valid" boxes like Box { CollisionPoint {-inf, -inf}, CollisionPoint {inf, inf} } look suspicious too...

The invalid boxes already exist in CollisionFeature::boxes, need to figure out how they get into there...

/cc @danpat

@mikemorris
Copy link
Contributor

don't use operator bool(); it has too many pitfalls looks suspicious, but I can't find any overlap between the areas where GeoJSONVT is used (Annotation), and the code that's crashing (CollisionFeature) - any insight here @kkaefer?

@mikemorris
Copy link
Contributor

As an aside, I tried rebasing this onto @jfirebaugh's annotation refactor, and building against GeoJSONVT 2.1.0, neither of which affected this bug.

@mikemorris
Copy link
Contributor

Running against geojson-vt-cpp@2.1.2 seems to have fixed the NaN CollisionBox crashing, but not the missing labels. Tracking in mason branch geojsonvt-master and here.

/cc @kkaefer

@mikemorris
Copy link
Contributor

Running against geojson-vt-cpp@2.1.6 successfully now, which is unrelated to the NaN CollisionBox crashing (which is still happening in BUILDTYPE=Debug) and missing labels. Thanks to @mourner, tracked down duplicate variant headers and updated everything to use mason variant@1.0.

Was finally able to capture a backtrace of the crash with everything running against the new variant headers:

Assertion failed: ((detail::is_valid(m_members.translator()(value)))&&("Indexable is invalid")), function raw_insert, file /Users/mikemorris/Projects/mapbox-g
l-native/mason_packages/headers/boost/1.57.0/include/boost/geometry/index/rtree.hpp, line 1242.
Process 5305 stopped
* thread #19: tid = 0xb107af, 0x00007fff90e97286 libsystem_kernel.dylib`__pthread_kill + 10, name = 'Worker', stop reason = signal SIGABRT
    frame #0: 0x00007fff90e97286 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff90e97286 <+10>: jae    0x7fff90e97290            ; <+20>
    0x7fff90e97288 <+12>: movq   %rax, %rdi
    0x7fff90e9728b <+15>: jmp    0x7fff90e92c53            ; cerror_nocancel
    0x7fff90e97290 <+20>: retq
(lldb) bt
* thread #19: tid = 0xb107af, 0x00007fff90e97286 libsystem_kernel.dylib`__pthread_kill + 10, name = 'Worker', stop reason = signal SIGABRT
  * frame #0: 0x00007fff90e97286 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff9836b9f9 libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00007fff981059b3 libsystem_c.dylib`abort + 129
    frame #3: 0x00007fff980cda99 libsystem_c.dylib`__assert_rtn + 321
    frame #4: 0x000000010033674a Mapbox GL`boost::geometry::index::rtree<std::__1::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2ul,
boost::geometry::cs::cartesian> >, mbgl::CollisionBox>, boost::geometry::index::linear<16ul, 4ul>, boost::geometry::index::indexable<std::__1::pair<boost::geo
metry::model::box<boost::geometry::model::point<float, 2ul, boost::geometry::cs::cartesian> >, mbgl::CollisionBox> >, boost::geometry::index::equal_to<std::__
1::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2ul, boost::geometry::cs::cartesian> >, mbgl::CollisionBox> >, std::__1::allocator<st
d::__1::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2ul, boost::geometry::cs::cartesian> >, mbgl::CollisionBox> > >::raw_insert(this
=0x000000010d09de30, value=0x000000010cd641e0) + 234 at rtree.hpp:1242
    frame #5: 0x0000000100332293 Mapbox GL`void boost::geometry::index::rtree<std::__1::pair<boost::geometry::model::box<boost::geometry::model::point<float,
2ul, boost::geometry::cs::cartesian> >, mbgl::CollisionBox>, boost::geometry::index::linear<16ul, 4ul>, boost::geometry::index::indexable<std::__1::pair<boost
::geometry::model::box<boost::geometry::model::point<float, 2ul, boost::geometry::cs::cartesian> >, mbgl::CollisionBox> >, boost::geometry::index::equal_to<st
d::__1::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2ul, boost::geometry::cs::cartesian> >, mbgl::CollisionBox> >, std::__1::allocat
or<std::__1::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2ul, boost::geometry::cs::cartesian> >, mbgl::CollisionBox> > >::insert<std
::__1::__wrap_iter<std::__1::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2ul, boost::geometry::cs::cartesian> >, mbgl::CollisionBox>
*> >(this=0x000000010d09de30, first=__wrap_iter<std::__1::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2, boost::geometry::cs::cartes
ian> >, mbgl::CollisionBox> *> @ 0x000000010c6c86c0, last=__wrap_iter<std::__1::pair<boost::geometry::model::box<boost::geometry::model::point<float, 2, boost
::geometry::cs::cartesian> >, mbgl::CollisionBox> *> @ 0x000000010c6c86b8) + 179 at rtree.hpp:589
    frame #6: 0x0000000100331e7c Mapbox GL`mbgl::CollisionTile::insertFeature(this=0x000000010d09de20, feature=0x000000010cd742b0, minPlacementScale=0.5) + 22
52 at collision_tile.cpp:87
    frame #7: 0x0000000100237995 Mapbox GL`mbgl::SymbolBucket::placeFeatures(this=0x000000010cdd2bc0, collisionTile=0x000000010d09de20, swapImmediately=true)
+ 2885 at symbol_bucket.cpp:426
    frame #8: 0x0000000100235a0b Mapbox GL`mbgl::SymbolBucket::addFeatures(this=0x000000010cdd2bc0, tileUID=4513976104, spriteAtlas=0x00000001028287e0, glyphA
tlas=0x0000000102828750, glyphStore=0x0000000100e7e560, collisionTile=0x000000010d09de20) + 3595 at symbol_bucket.cpp:269
    frame #9: 0x00000001001a739b Mapbox GL`mbgl::TileWorker::createSymbolBucket(this=0x000000010d0dcf28, layer=0x000000010cd64168, bucket_desc=0x0000000102830
128) + 3515 at tile_worker.cpp:284
    frame #10: 0x00000001001a336f Mapbox GL`mbgl::TileWorker::parseLayer(this=0x000000010d0dcf28, layer=0x0000000100f3dac8, geometryTile=0x000000010c6cadd0) +
 5519 at tile_worker.cpp:153
    frame #11: 0x00000001001a1d19 Mapbox GL`mbgl::TileWorker::parse(this=0x000000010d0dcf28, geometryTile=0x000000010c6cadd0) + 745 at tile_worker.cpp:52
    frame #12: 0x00000001003af5e2 Mapbox GL`mbgl::Worker::Impl::parseVectorTile(this=0x000000010c6d3af0, worker=0x000000010d0dcf28, data="\x1a�\x87\x04\n\tlan
dcover\x12\x1a\b\x01\x12\x02\0\0\x18\x03\"\x10\t\x80B\x80@\x1a�\x01\0\0\x80\x02\x80\x02\0\x0f\x12?\b\x02\x12\x02\0\0\x18\x03\"5\t\x90#�;�\x01\x80\x02_0\x0fP0@
? \x0f0�\x01\x10\x15@\x8e\x05\0\x17_///\0\0@\x1f\x0f0_\0__\x1f\0o�\x01_\x0f?\x0f\x12�\x13\b\x03\x12\x02\0\0\x18\x03\"�\x13\t�\x13\x8f\x01PO�o\x90\x01\00?\x10
P\x1f@O \0@ \00P �\x01P0O\x80\x01\x10P/\x10/\x9f\x01/\x0f\x0f//\0 0\x1f\x10/\0\x1f/`\x8f\x010\x0fP ?O\x10/\x1f\x1f_\0\x0fp?\x10\x10P\x1f\x10\x1f\x1f\00�\x01p\
00P\x10\00`PP? @\x1f \x7f\0\x0f0O\x10\000\0\0 \x1f\0/\x1f\x0f?M/\0/O/\0\x9f\x01?\x0f\0O`\x1f/?\0_\x10/@\x0f\x1fo \x0f.@`_/??\x10\x100=\x0f\x1f/\x9f\x01 \x0f@@
 \x10PO\f\0\U00000081 \x10\x1f6\0�\n\x10\x1f\x10@\x1f\0\0�\x86\x0f\0\x18_?\x0f\0\x1f`\0 ?\0_\x1f\x0f\0_\x1f\x1f?\x10\x0f@?\0?O\x9f\x01\x10O�P \x10/@\0\x0f`\x0
f\x0f /\0\0O@/\x0f_@\x0f\0\x7f\x1f/\x90\x01/P\x10\0\x8f\x01O/ o\x8f\x01\x10\0//\x0f0_@@`\x0f \x80\x010\0\0?0\x10\x10PO\x0f\0@ P@\0\0?`\x1fpo\x1f? ?\x1f\x0f\0O
\x7f\x1f/`\x1f\0\x0f�\x01/\0\x0f /\x0fPoP\0\0o_\x0foO\0O\x1f\x1f?\x10\x1fP/\x1fo0_?\x1f0O\0\x10\x7f/\0 O\x1f/P\0 O\x0f\x1f\x7f O\x1fO \x10@O\x0f\x80\x01o\0?O\
x0f\x0f/P0`\0\0 @ �\x0f\0@@ �\x01\x1f\x10`0\0 0 \x0f0@@\x0f @\x0f`p \x100 \0\0�\x01@\x10\x10@`\x0f\x10@/\0\x0f@@\x10\00@P0\0\x10o \0\x10`P\x1f\0_O\x0f\x1f/@\x
0f\0?\x80\x01O\x10?Oo?\x10Oo?\x0f \x7f_ \x10�/\x10\0 o\x1f\0\x1f\x1f\x10\x1f/O\x10\x0f?/\0\0o\x1f/0\x0f\0`@\0 0\x10/@\x0f\x0f\x7f\x9f\x01\0\x1f/?\x0f\x1f@00\x
9f\x01@0??\x7f�\x01\0\0 @\x10\0@o?\x9f\x01\x10`OP\x0f\0\x1f\x7f\0\x0f\x1f0\0@o@\0\x10/0@\x80\x01 \x1fP \x10P\x1f\0\x1f@\x10\x10\x1f`\0@O \0\00`\x1f\0Oo/Oo?\0\
x9f\x01\x8f\x01\x10??/\x0fO\x8f\x01\x0f??\0\0?//P\x1f\x10/@0 \0\0\x1f\x1f\x1f\0O\x7fO?\x8f\x01\x80\x01 \x10P\x90\x01\x0f \x1f\0@P0\x10p00\0�\x01@\0P`\x0fP0 \0
0@\0\00p@\x100�\x01P0\x80\x01@\x10\0@ \0\x10@p\x1f PP\x0f\x10\x80\x010\x0f\0/ \x0f\0\x9f\x01/?\0 \x1f\x0fO` \x10`/ \0P@\0\x10o`\x1f\0OPO\x0fo`\x10?0p\x1f\0?\x
1f\x0f\x10_/_/\x0f\0/\x9f\x01\x8f\x01\x7f//\0\0 o\0\0@\x1f\x10\x7f\x8f\x010\x1f\0O\x1f\x1f\x9f\x02?\0\x1f?\0\x1f@/\0\x10/\x1f\x1f_\x10\x100@\0\0po \0�\x01?//\
x10?O/ `\x9f\x01\x8f\x01O\x10\x1f 0\x90\x01\0\x1000\0\x10PP/@ P\x1f ?@PP\0P\x8f\x01`\x0f\x0fO\x80\x01\0P0_P\x10�\x80\x01�\x010\x10`\x8f\x01\x10\x7f/?_\x100oO\
0\0\x1f`", callback=function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char> >)> @ 0x000000010c6caf90)>) + 706 at worker.cpp:3
5
    frame #13: 0x00000001003bf30b Mapbox GL`_ZZN4mbgl4util6ThreadINS_6Worker4ImplEE4bindIMS3_FvPNS_10TileWorkerENSt3__112basic_stringIcNS8_11char_traitsIcEENS
8_9allocatorIcEEEENS8_8functionIFvN6mapbox4util7variantIJNS_8TileData5StateESE_EEEEEEEEEDaT_ENKUlDpOT_E_clIJS7_SE_ZNS0_7RunLoop4bindIZNSX_18invokeWithCallback
ISV_RSN_JS7_RSE_EEENS8_10unique_ptrINS_11WorkRequestENS8_14default_deleteIS13_EEEEOSR_OT0_DpOT1_EUlSU_E_EEDaS17_EUlSU_E_EEES1E_SU_(this=0x000000010d0dfa88, ar
gs=0x000000010d0dfaa0, args="", args=0x000000010d0dfac0) + 555 at thread.hpp:72
    frame #14: 0x00000001003bf0bc Mapbox GL`void mbgl::util::RunLoop::Invoker<auto mbgl::util::Thread<mbgl::Worker::Impl>::bind<void (mbgl::Worker::I[55/1630]
bgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void (mapbox::util::variant<mbgl::
TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>)>(void (mbgl::Worker::Impl::*)(mbgl::TileWorker*, s
td::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, st
d::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>))::'lambda'(void (mbgl::Worker::Impl::*&&)(mbgl::TileWorker*, std::__1
::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1:
:basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>)), std::__1::tuple<mbgl::TileWorker*, std::__1::basic_string<char, std::__1::
char_traits<char>, std::__1::allocator<char> >, auto mbgl::util::RunLoop::bind<std::__1::unique_ptr<mbgl::WorkRequest, std::__1::default_delete<std::__1::defa
ult_delete> > mbgl::util::RunLoop::invokeWithCallback<std::__1::tuple, std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_s
tring<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>&, mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::_
_1::allocator<char> >&>(void (mbgl::Worker::Impl::*&&)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>
>, std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >
 >)>), std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<cha
r> > >)>&&&, mbgl::TileWorker*&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&&)::'lambda'(auto mbgl::util::Thread<
mbgl::Worker::Impl>::bind<void (mbgl::Worker::Impl::*)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>
>, std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >
 >)>)>(void (mbgl::Worker::Impl::*)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::functi
on<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>))::'lambda'(vo
id (mbgl::Worker::Impl::*&&)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void
 (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>)))>(std::__1::functio
n<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>&)::'lambda'(aut
o mbgl::util::Thread<mbgl::Worker::Impl>::bind<void (mbgl::Worker::Impl::*)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::
__1::allocator<char> >, std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::_
_1::allocator<char> > >)>)>(void (mbgl::Worker::Impl::*)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char
> >, std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>
 > >)>))::'lambda'(void (mbgl::Worker::Impl::*&&)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, st
d::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>)
))> >::invoke<0ul, 1ul, 2ul>(this=0x000000010d0dfa30, (null)=std::__1::index_sequence<0UL, 1UL, 2UL> @ 0x000000010c6cafe8) + 156 at run_loop.hpp:133
    frame #15: 0x00000001003bebda Mapbox GL`mbgl::util::RunLoop::Invoker<auto mbgl::util::Thread<mbgl::Worker::Impl>::bind<void (mbgl::Worker::Impl::*)(mbgl::
TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void (mapbox::util::variant<mbgl::TileD
ata::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>)>(void (mbgl::Worker::Impl::*)(mbgl::TileWorker*, std::_
_1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__
1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>))::'lambda'(void (mbgl::Worker::Impl::*&&)(mbgl::TileWorker*, std::__1::bas
ic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basi
c_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>)), std::__1::tuple<mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_
traits<char>, std::__1::allocator<char> >, auto mbgl::util::RunLoop::bind<std::__1::unique_ptr<mbgl::WorkRequest, std::__1::default_delete<std::__1::default_d
elete> > mbgl::util::RunLoop::invokeWithCallback<std::__1::tuple, std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string
<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>&, mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::a
llocator<char> >&>(void (mbgl::Worker::Impl::*&&)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, st
d::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>)
, std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >
>)>&&&, mbgl::TileWorker*&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&&&)::'lambda'(auto mbgl::util::Thread<mbgl:
:Worker::Impl>::bind<void (mbgl::Worker::Impl::*)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, st
d::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>)
>(void (mbgl::Worker::Impl::*)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<vo
id (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>))::'lambda'(void (m
bgl::Worker::Impl::*&&)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::function<void (map
box::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>)))>(std::__1::function<voi
d (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>&)::'lambda'(auto mbg
l::util::Thread<mbgl::Worker::Impl>::bind<void (mbgl::Worker::Impl::*)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::
allocator<char> >, std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::a
llocator<char> > >)>)>(void (mbgl::Worker::Impl::*)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >,
std::__1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)
>))::'lambda'(void (mbgl::Worker::Impl::*&&)(mbgl::TileWorker*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__
1::function<void (mapbox::util::variant<mbgl::TileData::State, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >)>)))> >
::operator(this=0x000000010d0dfa30)() + 186 at run_loop.hpp:113
    frame #16: 0x00000001003908cb Mapbox GL`mbgl::util::RunLoop::process(this=0x000000010c6d3b00) + 683 at run_loop.cpp:27
    frame #17: 0x0000000100396eb6 Mapbox GL`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::
util::RunLoop*>&>(std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>&&&) [inlined] decltype(__f=0x000000010c6d3b88, __a0=0x000000010c6d3b
98)).*fp(std::__1::forward<>(fp1))) std::__1::__invoke<void (mbgl::util::RunLoop::*&)(), mbgl::util::RunLoop*&, void>(void (mbgl::util::RunLoop::*&&&)(), mbgl
::util::RunLoop*&&&) + 134 at __functional_base:382
    frame #18: 0x0000000100396e30 Mapbox GL`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::
util::RunLoop*>&>(std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>&&&) [inlined] std::__1::__bind_return<void (mbgl::util::RunLoop::*)(
), std::__1::tuple<mbgl::util::RunLoop*>, std::__1::tuple<>, _is_valid_bind_return<void (mbgl::util::RunLoop::*)(), std::__1::tuple<mbgl::util::RunLoop*>, std
::__1::tuple<> >::value>::type std::__1::__apply_functor<void (__f=0x000000010c6d3b88, __bound_args=0x000000010c6d3b98, (null)=__tuple_indices<0> @ 0x00000001
0c6cb350, __args=0x000000010c6cb390)(), std::__1::tuple<mbgl::util::RunLoop*>, 0ul, std::__1::tuple<> >(void (mbgl::util::RunLoop::*&)(), std::__1::tuple<mbgl
::util::RunLoop*>&, std::__1::__tuple_indices<0ul>, std::__1::tuple<>&&) + 40 at functional:2060
    frame #19: 0x0000000100396e08 Mapbox GL`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::
util::RunLoop*>&>(std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>&&&) [inlined] std::__1::__bind_return<void (mbgl::util::RunLoop::*)(
), std::__1::tuple<mbgl::util::RunLoop*>, std::__1::tuple<>, _is_valid_bind_return<void (mbgl::util::RunLoop::*)(), std::__1::tuple<mbgl::util::RunLoop*>, std
::__1::tuple<> >::value>::type std::__1::__bind<void (this=0x000000010c6d3b88)(), mbgl::util::RunLoop*>::operator()<>() + 31 at functional:2123
    frame #20: 0x0000000100396de9 Mapbox GL`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>&>(std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>&&&) [inlined] decltype(__f=0x000000010c6d3b88)(), mbgl::util::RunLoop*>&>(fp)(std::__1::forward<>(fp0))) std::__1::__invoke<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>&>(std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>&&&) + 11 at __functional_base:415
    frame #21: 0x0000000100396dde Mapbox GL`void std::__1::__invoke_void_return_wrapper<void>::__call<std::__1::__bind<void (__args=0x000000010c6d3b88)(), mbgl::util::RunLoop*>&>(std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>&&&) + 46 at __functional_base:440
    frame #22: 0x0000000100396c59 Mapbox GL`std::__1::__function::__func<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*>, std::__1::allocator<std::__1::__bind<void (mbgl::util::RunLoop::*)(), mbgl::util::RunLoop*> >, void ()>::operator(this=0x000000010c6d3b80)() + 57 at functional:1407
    frame #23: 0x000000010001e29f Mapbox GL`std::__1::function<void ()>::operator(this=0x000000010c6d3b80)() const + 143 at functional:1793
    frame #24: 0x0000000100161e23 Mapbox GL`uv::async::async_cb(a=0x0000000100dbcfa0, (null)=0) + 51 at uv_detail.hpp:127
    frame #25: 0x000000010043cbbf Mapbox GL`uv__async_event(loop=0x0000000100e7ff40, w=0x0000000100e800c8, nevents=1) + 175 at async.c:80
    frame #26: 0x000000010043cfba Mapbox GL`uv__async_io(loop=0x0000000100e7ff40, w=0x0000000100e800d0, events=1) + 314 at async.c:156
    frame #27: 0x0000000100458c49 Mapbox GL`uv__io_poll(loop=0x0000000100e7ff40, timeout=-1) + 3321 at kqueue.c:233
    frame #28: 0x000000010043d6c1 Mapbox GL`uv_run(loop=0x0000000100e7ff40, mode=UV_RUN_DEFAULT) + 193 at core.c:317
    frame #29: 0x00000001003fcbf8 Mapbox GL`uv::loop::run(this=0x000000010c6d3af8) + 40 at uv_detail.hpp:62
    frame #30: 0x00000001003b19e2 Mapbox GL`void mbgl::util::Thread<mbgl::Worker::Impl>::run<std::__1::tuple<> >(this=0x0000000100dbc380, context=ThreadContext @ 0x000000010c6d3ca8, params=0x000000010be779d8, (null)=std::__1::index_sequence<> @ 0x000000010c6d3ae0) + 210 at thread.hpp:125
    frame #31: 0x00000001003b18bb Mapbox GL`mbgl::util::Thread<mbgl::Worker::Impl>::Thread<>(this=0x0000000100dbcb60)::'lambda'()::operator()() const + 411 at thread.hpp:104
    frame #32: 0x00000001003b14b2 Mapbox GL`std::__1::__thread_proxy<std::__1::tuple<mbgl::util::Thread<mbgl::Worker::Impl>::Thread<>(mbgl::util::ThreadContext const&)::'lambda'()> >(void*, void*) [inlined] std::__1::__invoke<mbgl::util::Thread<mbgl::Worker::Impl>::Thread<>(mbgl::util::ThreadContext const&)::'lambda'()>(__f=0x0000000100dbcb60)::'lambda'()>(fp)(std::__1::forward<>(fp0))), mbgl::util::Thread<mbgl::Worker::Impl>::Thread<>(mbgl::util::ThreadContext const&)::'lambda'()&&) + 12 at __functional_base:415
    frame #33: 0x00000001003b14a6 Mapbox GL`std::__1::__thread_proxy<std::__1::tuple<mbgl::util::Thread<mbgl::Worker::Impl>::Thread<>(mbgl::util::ThreadContext const&)::'lambda'()> >(void*, void*) [inlined] _ZNSt3__116__thread_executeIZN4mbgl4util6ThreadINS1_6Worker4ImplEEC1IJEEERKNS2_13ThreadContextEDpOT_EUlvE_JEJEEEvRNS_5tupleIJT_DpT0_EEENS_15__tuple_indicesIJXspT1_EEEE(__t=0x0000000100dbcb60, (null)=__tuple_indices<> @ 0x000000010c6d3e98) + 16 at thread:337
    frame #34: 0x00000001003b1496 Mapbox GL`std::__1::__thread_proxy<std::__1::tuple<mbgl::util::Thread<mbgl::Worker::Impl>::Thread<>(mbgl::util::ThreadContext const&)::'lambda'()> >(__vp=0x0000000100dbcb60) + 358 at thread:347
    frame #35: 0x00007fff9836a05a libsystem_pthread.dylib`_pthread_body + 131
    frame #36: 0x00007fff98369fd7 libsystem_pthread.dylib`_pthread_start + 176
    frame #37: 0x00007fff983673ed libsystem_pthread.dylib`thread_start + 13

@mikemorris
Copy link
Contributor

Wondering if there could be something going on with the usage of variants in mbgl::Value, like if type checking or equality comparisons changed in mapbox/variant@24dcab2...v1.0 (comparing most recent variant headers to v1.0). The concepts make sense, but the template magic is a bit of a mystery to me.

@jfirebaugh
Copy link
Contributor

@mikemorris In mason-variant I pulled the changes to install variant via mason -- I'm not seeing any render errors or crashes on that branch.

@mikemorris
Copy link
Contributor

Interestingly, make run-linux with mason-installed geojsonvt@v2.1.6 does not suffer from the missing labels bug, so I'm guessing this is specific to the OS X setup.

screen shot 2015-10-01 at 10 39 56 am

@mikemorris
Copy link
Contributor

Mason compilation has -std=c++11, submodule does not

Thinking this isn't the problem since the Linux build works fine?

  • Submodule compilation has -frtti, mason does not
  • Submodule compilation has -fexceptions, mason does not

Added these to the mason build, no effect.

Mason compilation has -fvisibility-inlines-hidden, submodule does not

Dropped this from the mason build (was OS X only), FIXED IT OMFG YES.

@mikemorris
Copy link
Contributor

Actually fixing the hidden inline constructor instead of dropping -fvisibility-inlines-hidden from mason -> mapbox/geojson-vt-cpp#12

@jfirebaugh
Copy link
Contributor

Wow. It's pretty disturbing that a hidden symbol could cause crashes at runtime rather than a link error. @springmeyer Do you have any theories about how that could happen, or ideas for how to avoid it?

@springmeyer
Copy link
Contributor

Wow. It's pretty disturbing that a hidden symbol could cause crashes at runtime rather than a link error.
@springmeyer Do you have any theories about how that could happen, or ideas for how to avoid it?

Yeah that is surprising. I've never encountered that before. Perhaps what is happening is the missing symbol leads to some bogus fallback to another symbol. But really I have no idea.

I will mention that I've found the -Wl,-bind_at_load flag helpful for OS X. Somewhere along the line - either in the compiler or some node.js flag - missing symbols only started producing an "undefined symbol error" at runtime rather than startup. This makes sure that missing symbols throw at startup. https://github.com/mapnik/node-mapnik/blob/master/binding.gyp#L205-L207. This has not prevented crashes for me in the past but has caught lurking problems with visibility.

@mikemorris
Copy link
Contributor

I think it may be because the hidden symbol is only used inside a (optional?) variant?

@springmeyer
Copy link
Contributor

not sure @mikemorris - but I'll add that this is not actually a segfault style crash. Its the process being stopped on an assertion because assert is being called.

@mikemorris
Copy link
Contributor

Well yea, but there's silenty missing labels everywhere for some reason too.

Tried adding '-Wl,-bind_at_load' to gyp/platform-osx.gypi and got the following error:

libtool: unknown option character `W' in: -Wl,-bind_at_load

It doesn't seem to do anything when I stick it in OTHER_LDFLAGS in link_settings.

@lucaswoj
Copy link
Contributor Author

lucaswoj commented Oct 1, 2015

Glad to hear you got this working @mikemorris! What's the big picture now? Are we almost ready to 🚢 this branch?

@mikemorris
Copy link
Contributor

@lucaswoj Need to get mapbox/mason#115 merged, rerun the latest Travis build on geojsonvt-2.1.6.1 to make mason binaries, then merge #2489, then rebase your changes around building without a mason submodule and finally merge this.

@mikemorris
Copy link
Contributor

FINALLY UNBLOCKED with #2584 merge!

  • Needs to be rebased onto master.

@mikemorris mikemorris self-assigned this Nov 3, 2015
@mikemorris mikemorris force-pushed the npm-build branch 3 times, most recently from 7552ef3 to bd519c3 Compare November 3, 2015 17:16
@mikemorris
Copy link
Contributor

@lucaswoj When building from source with npm install, I get through the configure step, then hit an error:

* Recreating project...
gyp: mbgl.gyp not found (cwd: /Users/mikemorris/gyp/api-gl/node_modules/mapbox-gl-native)
make[1]: *** [Makefile/__project__] Error 1

@mikemorris
Copy link
Contributor

Uhh... for some reason the contents of mbgl.gyp are in binding.gyp and mbgl.gyp is missing from the tarball...

@mikemorris
Copy link
Contributor

Ugh. Opened npm/npm#10243

@mikemorris mikemorris force-pushed the npm-build branch 2 times, most recently from cccedab to b64ab4b Compare November 3, 2015 21:22
Lucas Wojciechowski and others added 2 commits November 4, 2015 11:34
This reverts commit 311bf93.

more explicit require paths in tests
So npm won't clobber binding.gyp, refs
npm/npm#10243
@mikemorris mikemorris merged commit dfb36d6 into master Nov 4, 2015
@mikemorris mikemorris deleted the npm-build branch November 4, 2015 17:20
@incanus incanus added the P1 label Nov 4, 2015
@1ec5 1ec5 removed the ⚠️ DO NOT MERGE Work in progress, proof of concept, or on hold label Nov 9, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Node.js node-mapbox-gl-native
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants