Usage of _GLIBCXX_ASSERTIONS makes clangd extremely unstable
Task Info (Flyspray) | |
---|---|
Opened By | Aaron Barany (akb825) |
Task ID | 78032 |
Type | Bug Report |
Project | Arch Linux |
Category | Packages: Extra |
Version | None |
OS | All |
Opened | 2023-03-29 01:22:19 UTC |
Status | Assigned |
Assignee | Evangelos Foutras (foutrelis) |
Details
Description: The default Arch compile flags enable _GLIBCXX_ASSERTIONS, which causes clangd to be extremely unstable. This in turn makes IDEs (such as Qt Creator) and plugins that rely on clangd have many essential features borderline unusable. This is very common for unmatched parentheses or brackets, which typically happens when writing code while clangd processes the files while in the middle of typing. In practice this causes dozens of crashes each day, and the application using clangd may simply give up and disable many of its features if it detects that it crashed too much.
I rebuilt clang adding the following to CXXFLAGS: "-Wp,-U_GLIBCXX_ASSERTIONS". After applying this modification the consistent crashing no longer occurs. While the ideal solution would be to fix the assertions upstream, these Arch-specific build options result the user experience is significantly inferior to the default build of clang or the builds typically found in other distributions.
To at least have the usability on Arch to be on par with other systems, I request that "-Wp,-U_GLIBCXX_ASSERTIONS" be added to the CXXFLAGS for the clang package to disable these assertions for this package.
Additional info:
- package version: 15.0.7-2
Steps to reproduce:
- Open a C or C++ file in a program that utilizes clangd, such as Qt Creator.
- Edit a function with an unterminated open parenthesis. For example, an unclosed assert(
- Notice that clangd will crash until the parentheses are closed. Many features, including code completion and semantic highlighting, will be unavailable in the meantime. If it crashes enough times in a short period the clangd features will be disabled, using a fallback that only has partial functionality.