Skip to content

common: Skip environment locale check on illumos - #36399

Closed
hebasto wants to merge 1 commit into
bitcoin:masterfrom
hebasto:261001-illumos-locale
Closed

hebasto wants to merge 1 commit into
bitcoin:masterfrom
hebasto:261001-illumos-locale

Conversation

@hebasto

@hebasto hebasto commented Oct 1, 2026

Copy link
Copy Markdown
Member

On illumos-based distributions whose GCC is built with the --enable-clocale=dragonfly option (e.g. OmniOS, OpenIndiana), the std::ctype<char>::~ctype() destructor passes an uninitialized value to freelocale().

Constructing and destroying std::locale("") in SetupEnvironment() therefore intermittently crashes, e.g. with "libc thread failure: lfree() called with a misaligned pointer".

Upstream reports:

Closes hebasto/bitcoin-core-nightly#315.

On illumos-based distributions whose GCC is built with the
`--enable-clocale=dragonfly` option (e.g. OmniOS, OpenIndiana), the
`std::ctype<char>::~ctype()` destructor passes an uninitialized value
to `freelocale()`.

Constructing and destroying `std::locale("")` in `SetupEnvironment()`
therefore intermittently crashes, e.g. with "libc thread failure:
lfree() called with a misaligned pointer".

Upstream reports:
- illumos/gcc#56 (comment)
- omniosorg/omnios-build#4253
- https://www.illumos.org/issues/18481
@DrahtBot

DrahtBot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

External sites

Reviews

See the guideline and AI policy for information on the review process.
A summary of reviews will appear here.

@maflcko

maflcko commented Oct 1, 2026

Copy link
Copy Markdown
Member

Why is all of this code needed (#4174 (comment)) in the first place? At this point it may be better to delete it (possibly move it to the GUI, if it is needed there)

@maflcko

maflcko commented Oct 1, 2026

Copy link
Copy Markdown
Member

to clarify: boost fs has long been removed (#4147 (comment))

@hebasto
hebasto marked this pull request as draft October 11, 2026 06:24
@maflcko

maflcko commented Oct 14, 2026

Copy link
Copy Markdown
Member

Let's close and move discussion to #36524 ?

@hebasto

hebasto commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

Closing in favour of #36524.

@hebasto hebasto closed this Oct 14, 2026
sedited added a commit that referenced this pull request Oct 19, 2026
43bb5e3 doc: add release note for #36524 (fanquake)
cbd2964 common: drop locale setting hack (fanquake)
1164c77 test: run GUI nodes in Dutch with -lang (stickies-v)

Pull request description:

  This was added to work around `boost::filesystem` throwing when the environments locale was invalid. Boost.Filesystem has been removed, and `std::filesystem` doesn't use the locale on POSIX (and bitcoind never calls `setlocale`).

  Qt calls `setlocale(LC_ALL, "")` on startup, and falls back to `C.UTF-8` if the locale isn't `UTF-8`.

  Alternative to #36399, which extends the hack further.

ACKs for top commit:
  maflcko:
    review ACK 43bb5e3 🚂
  stickies-v:
    ACK 43bb5e3
  sedited:
    ACK 43bb5e3

Tree-SHA512: f67d0ba67f57333906970b32f607c859c6bc9fc1462a62cf4687817acb922e72f9ac8f2cfc828fbb1d60f91d90152b28a738f37439c5c7fdd1f38e70eb2feb74
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

illumos: libc thread failure: lfree() called with a misaligned pointer

3 participants