mold: Assertion fails when compiling Rust
I am using mold to compile a Rust app. I’m using the latest unstable version of mold from the debian repository, which is: 2.34.1. This is the error I am seeing:
mold: ./src/../lib/common.h:637: std::pair<T*, bool> mold::ConcurrentMap<T>::insert(std::string_view, mold::u32, const T&) [with T = mold::SectionFragment<mold::X86_64>; std::string_view = std::basic_string_view<char>; mold::u32 = unsigned int]: Assertion `false && "ConcurrentMap is full"' failed.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (8 by maintainers)
Commits related to this issue
- Increase the maximum retry count for our concurrent hashmap Fixes https://github.com/rui314/mold/issues/1365 — committed to SARDONYX-forks/mold by rui314 2 years ago
Ahh, that’s nice, but I cannot explain why that could fix the issue. If you have time, can you rebuild mold without that commit (i.e. build at 85be067813952409878ddd7d507855c2a017841d) to see if the problem occurs right before the last commit? I want to make sure that the problem was really fixed.
Thank you for testing with the patch. The error is mysterious – the concurrent hashmap that is reported as full is only 60% full. The error is raised if 128 consecutive hash table slots are occupied, but with 60% usage, it is extremely unlikely to occur. There are a few possible explanations:
I don’t know which is the case.
I made a small change to the concurrent hashmap. Can you test again with the git head?
Does this occur without multi-threading? Please try again with
--no-threadslinker option.I really want to fix this issue.
Can you build mold with the following patch and share the new error message?