{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/4423","repository_url":"https://api.github.com/repos/kripken/emscripten","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/4423/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/4423/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/4423/events","html_url":"https://github.com/kripken/emscripten/issues/4423","id":163466480,"number":4423,"title":"_uselocale() overwrites data over a variable allocated near 0","user":{"login":"shooshx","id":1285088,"avatar_url":"https://avatars.githubusercontent.com/u/1285088?v=3","gravatar_id":"","url":"https://api.github.com/users/shooshx","html_url":"https://github.com/shooshx","followers_url":"https://api.github.com/users/shooshx/followers","following_url":"https://api.github.com/users/shooshx/following{/other_user}","gists_url":"https://api.github.com/users/shooshx/gists{/gist_id}","starred_url":"https://api.github.com/users/shooshx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shooshx/subscriptions","organizations_url":"https://api.github.com/users/shooshx/orgs","repos_url":"https://api.github.com/users/shooshx/repos","events_url":"https://api.github.com/users/shooshx/events{/privacy}","received_events_url":"https://api.github.com/users/shooshx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-01T20:12:21Z","updated_at":"2016-07-06T17:41:26Z","closed_at":null,"body":"In my main cpp file I have a global variable `g_ctrl` which for some reason is allocated near the very beginning of the memory array. printing its address using \r\n\r\n     printf(\"GCTRL  %p\\n\", &g_ctrl)\r\n\r\nshows\r\n\r\n    GCTRL 0x40\r\n\r\nOther global variables are not allocated such low addresses, only this one, I'm not sure why.\r\nAt some point pretty early in the program `_uselocale()` from some `operator<<` This function does `_pthread_self()` which returns 0 always, adds 176 to it and stores some value there. 0+176 just happens to fall on the capacity member of some std::vector in g_ctrl and from there it just goes downhill.\r\n\r\nThis is probably not relevant but I started noticing this only after compiling with -D_LIBCPP_DEBUG=0 which probably changed the layout of my objects abit and caused this to start happening. g_ctrl is allocated a low address even without _LIBCPP_DEBUG=0\r\n\r\nI'm using 1.35.0"},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/230848747","html_url":"https://github.com/kripken/emscripten/issues/4423#issuecomment-230848747","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/4423","id":230848747,"user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"created_at":"2016-07-06T17:41:26Z","updated_at":"2016-07-06T17:41:26Z","body":"Strange, on `1.36.5` the testcase builds with warnings\r\n\r\n````\r\nwarning: unresolved symbol: _ZNSt3__213basic_ostreamIcNS_11char_traitsIcEEElsEPKv\r\nwarning: unresolved symbol: _ZNSt3__24coutE\r\n````\r\n\r\nThose are almost the symbols we expect, except for the 2: `std::__2::basic_ostream<char, std::__2::char_traits<char> >::operator<<(void const*)`. Not sure what's going on here, the testcase looks pretty simple."}}
{"actor":{"display_login":"kripken"}}