linux修改线程池,linux下线程池,出现Segmentation fault (core dumped) 问题

GDB调试段错误,可以有效快速定位到出错该行。

1、让系统在信号中断造成的错误时产生core文件修改core文件大小,需要su权限:#查看core文件设置

ulimit -a#设置core大小为无限

ulimit -c unlimited

#设置文件大小为无限

ulimit unlimited

2、编译:

******-ThinkPad-X60:~/workspace/AdvServer/src/util$ g++ -g threadpool.cpp -lpthread

3、调试:

******-ThinkPad-X60:~/workspace/AdvServer/src/util$ gdb ./a.out core

GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04

Copyright (C) 2012 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law. Type "show copying"

and "show warranty" for details.

This GDB was configured as "i686-linux-gnu".

For bug reporting instructions, please see:

...

Reading symbols from /home/liyuanchi/workspace/AdvServer/src/util/a.out...(no debugging symbols found)...done.

warning: exec file is newer than core file.

[New LWP 7095]

[New LWP 7097]

[New LWP 7094]

[New LWP 7096]

warning: Can't read pathname for load map: Input/output error.

[Thread debugging using libthread_db enabled]

Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".

Core was generated by `./a.out'.

Program terminated with signal 11, Segmentation fault.

#0 0x08048e5f in threadpool_thread(void*) ()

(gdb) backtrace

#0 0x00132416 in __kernel_vsyscall ()

#1 0x0017c1df in raise () from /lib/i386-linux-gnu/libc.so.6

#2 0x0017f825 in abort () from /lib/i386-linux-gnu/libc.so.6

#3 0x001b939a in ?? () from /lib/i386-linux-gnu/libc.so.6

#4 0x001c3ee2 in ?? () from /lib/i386-linux-gnu/libc.so.6

#5 0x08048d91 in threadpool_free (pool=0x804c008) at threadpool.cpp:194

#6 0x08048d5f in threadpool_destroy (pool=0x804c008) at threadpool.cpp:182

#7 0x08048f05 in main () at threadpool.cpp:229

(gdb)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值