abseil / abseil/abseil-cpp

[Bug]: segmentation fault due to constexpr constructor of absl::flags_internal::Flag

未关闭
#1,821 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
C++
星标
18.1k
派生
3.2k
平均合并
20 小时 36 分钟
30 天内合并 PR
1

描述

### Describe the issue

When I used abseil-cpp with other libraries like [libtorch](https://download.pytorch.org/libtorch/cu126/libtorch-cxx11-abi-shared-with-deps-2.6.0%2Bcu126.zip), I got `segmentation fault` at `FlagRegistry::RegisterFlag`. I solved this issue by removing the `constexpr` keyword from the constructor of `absl::flags_internal::Flag`.

### Steps to reproduce the problem

- create a main.cpp with a blank main function.
- compile main.cpp into an executable and link libtorch and abseil-cpp to it.
- run the executable, a segmentation fault will occur.

### What version of Abseil are you using?

20240722.1

### What operating system and version are you using?

ArchLinux, kernel version: Linux 6.13.1

### What compiler and version are you using?

I tried both GCC13 and GCC14 with C++17.

### What build system are you using?

cmake 3.30

### Additional context

_No response_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。