社区
C语言
帖子详情
pthread_mutex_lock.c:62: __pthread_mutex_lock: Assertion `mutex->__data.__owner
笑Smile3721
2013-08-23 03:58:05
工程比较复杂,上锁的地方比较多,出现这程序运行几分钟就出现此错误。
...全文
682
3
打赏
收藏
pthread_mutex_lock.c:62: __pthread_mutex_lock: Assertion `mutex->__data.__owner
工程比较复杂,上锁的地方比较多,出现这程序运行几分钟就出现此错误。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
笑Smile3721
2013-08-27
打赏
举报
回复
是程序问题,加锁不合理造成的
qq120848369
2013-08-24
打赏
举报
回复
程序问题,找bug吧。
赵4老师
2013-08-23
打赏
举报
回复
上锁者不是锁的拥有者。 即调用pthread_mutex_lock的程序之前没有调用pthread_mutex_init或者调用pthread_mutex_init了但又调了pthread_mutex_destroy
《Linux系统编程、网络编程》第8章 C线程
课程内容: 为什么需要线程、进程的缺点、线程是否能完全替...、线程控制函数(p
thread
_create、p
thread
_join、p
thread
_detach、p
thread
_exit等)、线程资源保护(互斥锁、线程信号量、条件变量)、进程与线程的对比。
get_status_tool: p
thread
_
mutex
_
lock
.c:312: __p
thread
_
mutex
_
lock
_full:
Assertion
`(-(e)) != 3 || !rob
mutex
位于动态分配结构体中,出现上述错误,移至静态区,不再...get_status_tool: p
thread
_
mutex
_
lock
.c:312: __p
thread
_
mutex
_
lock
_full:
Assertion
`(-(e)) != 3 || !robust' failed. Aborted (core dumped) ...
./nptl/p
thread
_
mutex
_
lock
.c:81: __p
thread
_
mutex
_
lock
:
Assertion
`
mutex
->__
data
.__
owner
== 0' failed
#include<iostream> #include<p
thread
.h> #include<stdlib.h> #include<string.h> #include<...p
thread
_cond_t taxiarrive = ...
linux下错误使用p
thread
_
mutex
_
lock
导致程序奔溃问题分析
本文分析在Linux应用程序中错误使用p
thread
_
mutex
锁时会概率性触发SIG_ABRT信号而导致程序崩溃(库打印输出 :
Assertion
`
mutex
->__
data
.__
owner
== 0' failed)的原因。 首先给出出错的示例程序:
p
thread
_
mutex
_cond_
lock
_full
../nptl/p
thread
_
mutex
_
lock
.c:350: __p
thread
_
mutex
_cond_
lock
_full:
Assertion
`(-(e)) != 3 || !robust' failed. 经过观察和分析,推断是
mutex
的状态被破坏了。 排查代码,主线程退出时,
mutex
对象被...
C语言
69,382
社区成员
243,073
社区内容
发帖
与我相关
我的任务
C语言
C语言相关问题讨论
复制链接
扫一扫
分享
社区描述
C语言相关问题讨论
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章