The futex facility returned an unexpected error code

在 linux 程序执行中若遇到该错误,考虑下是否是如下变量使用了强制内存对齐导致。

比如:在将如上变量包含到结构体中,强制1字节或2字节内存对齐。

如:信号量相关 struct semaphore,线程相关的 pthread_mutex_t,以及 pthread_cond_t 等等。

解决办法:

1、取消强制内存对齐;

2、不要包含在结构体中或类中;

发布了131 篇原创文章 · 获赞 464 · 访问量 62万+

猜你喜欢

转载自blog.csdn.net/JAZZSOLDIER/article/details/104258903