https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110196
--- Comment #4 from fabian_kessler at gmx dot de <fabian_kessler at gmx dot de>
---
Indeed, changing _S_init to the following did the trick:
```
static backtrace_state *_S_init() {
static backtrace_state *__state = []() {
auto getpath = []() -> std::string {
char buf[PATH_MAX + 1];
if (readlink("/proc/self/exe", buf, sizeof(buf) - 1) == -1) {
return "";
}
std::string str(buf);
return str.substr(0, str.rfind('/'));
};
auto exec_filename = getpath();
return backtrace_create_state(exec_filename.c_str(), 1, _S_err_handler,
nullptr);
}();
return __state;
}
```