Bitcoin: Segfault running master on NetBSD

Created on 5 Nov 2019  ·  3Comments  ·  Source: bitcoin/bitcoin

While testing 17270 I noticed that master (bdda137878904e9401a84e308ac74c93c2ef87c1) does not run on NetBSD. I assume this started after #17085 changed the fallback locale from C to C.UTF-8. There doesn't seem to be a C.UTF-8 locale on NetBSD.

src/bitcoind
terminate called after throwing an instance of 'std::runtime_error'
  what():  locale::facet::_S_create_c_locale name not valid
Abort trap (core dumped)

LC_ALL=C src/bitcoind works, LC_ALL=en_US.UTF-8 src/bitcoind does not.

locale
LANG=""
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=""
LinuUnix

Most helpful comment

I'm all for replacing those, but none of those functions crashes on having a wrong locale configured, that's very much a boost thing.

All 3 comments

This is an eternal source of problems. I wonder if we can get rid of all locale dependency at some point and just ignore the locale. Probably not as long as we use boost::filesystem … :cry:

@laanwj

Setting aside the boost::filesystem the list of places where we're using locale dependent operations is quite short:

https://github.com/bitcoin/bitcoin/blob/e204dc11b562c2cf31d320774a4dcbe49f3b6468/test/lint/lint-locale-dependence.sh#L5-L20

Perhaps a "good first issue" could be created to tackle the list above? Some of them are really low hanging fruits suitable for new contributors.

I'm all for replacing those, but none of those functions crashes on having a wrong locale configured, that's very much a boost thing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

renepickhardt picture renepickhardt  ·  3Comments

rebroad picture rebroad  ·  3Comments

Crypt-iQ picture Crypt-iQ  ·  3Comments

gituser picture gituser  ·  3Comments

nmarley picture nmarley  ·  3Comments