{"action":"created","issue":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5950","labels_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5950/labels{/name}","comments_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5950/comments","events_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5950/events","html_url":"https://github.com/bitcoin/bitcoin/pull/5950","id":64671977,"number":5950,"title":"Fix locale fallback and guard tests against invalid locale settings","user":{"login":"dexX7","id":5836089,"avatar_url":"https://avatars.githubusercontent.com/u/5836089?v=3","gravatar_id":"","url":"https://api.github.com/users/dexX7","html_url":"https://github.com/dexX7","followers_url":"https://api.github.com/users/dexX7/followers","following_url":"https://api.github.com/users/dexX7/following{/other_user}","gists_url":"https://api.github.com/users/dexX7/gists{/gist_id}","starred_url":"https://api.github.com/users/dexX7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dexX7/subscriptions","organizations_url":"https://api.github.com/users/dexX7/orgs","repos_url":"https://api.github.com/users/dexX7/repos","events_url":"https://api.github.com/users/dexX7/events{/privacy}","received_events_url":"https://api.github.com/users/dexX7/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bitcoin/bitcoin/labels/Improvement","name":"Improvement","color":"E6F6D6"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-27T01:41:13Z","updated_at":"2015-03-29T09:05:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bitcoin/bitcoin/pulls/5950","html_url":"https://github.com/bitcoin/bitcoin/pull/5950","diff_url":"https://github.com/bitcoin/bitcoin/pull/5950.diff","patch_url":"https://github.com/bitcoin/bitcoin/pull/5950.patch"},"body":"Unfortually a fallback to \"C\" locale via `std::locale::global` does not cover all scenarios with messed up environment locale settings and on Ubuntu 14.01 (with `LANG=en_US.UTF-8, LANGUAGE=en_US, LC_* empty`) setting `LANG=invalid` triggers a crash right at the start of `bitcoind` and `bitcoin-qt`.\r\n\r\nThis also affects `test_bitcoin` and `test_bitcoin-qt`, which were not guarded at all.\r\n\r\nThe PR expands the scope of the locale fallback and prevents crashes due to invalid locale settings of `bitcoind`, `bitcoin-qt`, `test_bitcoin` and `test_bitcoin-qt`. I didn't want to create a seperate PR for the 0.10 branch, but a conflict free version is available: https://github.com/bitcoin/bitcoin/compare/0.10...dexX7:0.10-init-locale-fallback-tests-fix\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/bitcoin/bitcoin/issues/comments/87375726","html_url":"https://github.com/bitcoin/bitcoin/pull/5950#issuecomment-87375726","issue_url":"https://api.github.com/repos/bitcoin/bitcoin/issues/5950","id":87375726,"user":{"login":"dexX7","id":5836089,"avatar_url":"https://avatars.githubusercontent.com/u/5836089?v=3","gravatar_id":"","url":"https://api.github.com/users/dexX7","html_url":"https://github.com/dexX7","followers_url":"https://api.github.com/users/dexX7/followers","following_url":"https://api.github.com/users/dexX7/following{/other_user}","gists_url":"https://api.github.com/users/dexX7/gists{/gist_id}","starred_url":"https://api.github.com/users/dexX7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dexX7/subscriptions","organizations_url":"https://api.github.com/users/dexX7/orgs","repos_url":"https://api.github.com/users/dexX7/repos","events_url":"https://api.github.com/users/dexX7/events{/privacy}","received_events_url":"https://api.github.com/users/dexX7/received_events","type":"User","site_admin":false},"created_at":"2015-03-29T09:05:05Z","updated_at":"2015-03-29T09:05:05Z","body":"@laanwj: Yeah, I'm truely sorry.. :/ I focused on addressing the deinitialization issue, which caused the crashes on Windows, probably with two steps forward, where only one was appropriate, as it seems.\r\n\r\nI further moved `TestingSetup()` from `TestingSetup()` to `BasicTestingSetup()`, after running a proper test.\r\n\r\nThe RPC test is available here:\r\nhttps://gist.github.com/dexX7/ab3f7411a9040e96d55c\r\n\r\nTravis build with the test, based on unfixed master (with delayed error assertion):\r\nhttps://travis-ci.org/dexX7/bitcoin/builds/56274510\r\n\r\nTravis build with the test, based on the [0.10 branch](https://github.com/bitcoin/bitcoin/compare/0.10...dexX7:0.10-init-locale-fallback-tests-fix):\r\nhttps://travis-ci.org/dexX7/bitcoin/builds/56281571\r\n\r\nTravis build with the test, based on this pull request:\r\nhttps://travis-ci.org/dexX7/bitcoin/builds/56281441\r\n\r\nMay I add the test to `qa/rpc-tests` as part of this PR, but without adding it to `qa/pull-tester/run-rpc-tests.sh`, as it is somewhat time consuming?\r\n\r\n@Diapolo: I'd be happy to format `src/test/test_bitcoin.cpp` and update the copyright header in `src/qt/test/test_main.cpp`, if that would be considered as appropriate for the scope of this PR?"}}