{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6455","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-native","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6455/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6455/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6455/events","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/6455","id":179183711,"number":6455,"title":"[core] Fix initialization race on util::mapbox::isMapboxURL","user":{"login":"tmpsantos","id":996307,"avatar_url":"https://avatars.githubusercontent.com/u/996307?v=3","gravatar_id":"","url":"https://api.github.com/users/tmpsantos","html_url":"https://github.com/tmpsantos","followers_url":"https://api.github.com/users/tmpsantos/followers","following_url":"https://api.github.com/users/tmpsantos/following{/other_user}","gists_url":"https://api.github.com/users/tmpsantos/gists{/gist_id}","starred_url":"https://api.github.com/users/tmpsantos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmpsantos/subscriptions","organizations_url":"https://api.github.com/users/tmpsantos/orgs","repos_url":"https://api.github.com/users/tmpsantos/repos","events_url":"https://api.github.com/users/tmpsantos/events{/privacy}","received_events_url":"https://api.github.com/users/tmpsantos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-26T09:48:01Z","updated_at":"2016-09-26T09:48:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/6455","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/6455","diff_url":"https://github.com/mapbox/mapbox-gl-native/pull/6455.diff","patch_url":"https://github.com/mapbox/mapbox-gl-native/pull/6455.patch"},"body":"This function can be called from different threads and was depending on a global `std::string protocol` which can do heap allocations.\n\nThe first thread to use it would initialized it which is not exactly safe, so this patch moves it to a `char *` that is just a pointer to\nthe data segment, so no races.\n\nValgrind detected it on #6431.\n\n```\n==9874== Conditional jump or move depends on uninitialised value(s)\n==9874==    at 0x4C307C2: __memcmp_sse4_1 (in /home/travis/build/mapbox/mapbox-gl-native/mason_packages/linux-x86_64/valgrind/latest/lib/valgrind/vgpreload_memcheck-amd64-linux.so)\n==9874==    by 0x79896E: mbgl::util::mapbox::isMapboxURL(std::string const&) (in /home/travis/build/mapbox/mapbox-gl-native/build/qt-linux-x86_64/Release/mbgl-test)\n==9874==    by 0x6DC756: mbgl::style::TileSourceImpl::parseTileJSON(std::string const&, std::string const&, mbgl::SourceType, unsigned short) (in /home/travis/build/mapbox/mapbox-gl-native/build/qt-linux-x86_64/Release/mbgl-test)\n==9874==    by 0x6DDA6A: std::_Function_handler<void (mbgl::Response), mbgl::style::TileSourceImpl::loadDescription(mbgl::FileSource&)::{lambda(mbgl::Response)#1}>::_M_invoke(std::_Any_data const&, mbgl::Response&&) (in /home/travis/build/mapbox/mapbox-gl-native/build/qt-linux-x86_64/Release/mbgl-test)\n==9874==    by 0x50BE80: std::_Function_handler<void (), mbgl::StubFileSource::StubFileSource()::{lambda()#1}>::_M_invoke(std::_Any_data const&) (in /home/travis/build/mapbox/mapbox-gl-native/build/qt-linux-x86_64/Release/mbgl-test)\n==9874==    by 0x70972A5: QMetaObject::activate(QObject*, int, int, void**) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)\n==9874==    by 0x70A3621: QTimer::timerEvent(QTimerEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)\n==9874==    by 0x7098053: QObject::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)\n==9874==    by 0x60CCC8B: QApplicationPrivate::notify_helper(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1)\n==9874==    by 0x60D1E55: QApplication::notify(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.2.1)\n==9874==    by 0x706FC2C: QCoreApplication::notifyInternal(QObject*, QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)\n==9874==    by 0x70BC1AC: QTimerInfoList::activateTimers() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)\n==9874==\n```"},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments/249526372","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/6455#issuecomment-249526372","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/6455","id":249526372,"user":{"login":"mention-bot","id":15710697,"avatar_url":"https://avatars.githubusercontent.com/u/15710697?v=3","gravatar_id":"","url":"https://api.github.com/users/mention-bot","html_url":"https://github.com/mention-bot","followers_url":"https://api.github.com/users/mention-bot/followers","following_url":"https://api.github.com/users/mention-bot/following{/other_user}","gists_url":"https://api.github.com/users/mention-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/mention-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mention-bot/subscriptions","organizations_url":"https://api.github.com/users/mention-bot/orgs","repos_url":"https://api.github.com/users/mention-bot/repos","events_url":"https://api.github.com/users/mention-bot/events{/privacy}","received_events_url":"https://api.github.com/users/mention-bot/received_events","type":"User","site_admin":false},"created_at":"2016-09-26T09:48:03Z","updated_at":"2016-09-26T09:48:03Z","body":"@tmpsantos, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @tmcw and @yhahn to be potential reviewers."}}
{"actor":{"display_login":"mention-bot"}}