gdb attach task时,如果创建过多线程,gdb会挂死,此时升级gdb版本或设置为non-stop模式可解决此问题。

I fought with similar gdb issues for a while. My case was having lots of threads spawned that executed few functions and then exited.
It appears if a thread exits too fast and there's lots of these happening sometimes gdb cannot keep up and when it fails, it fails with style as in crashes :) I think it tries to attach to a thread that is already done as per the error message.
I see this as an issue in gdb 6.5 to 7.6 and still happening. Did not try with older versions.
My advice is look for this use case or similar. Once I changed my design to have a thread serving a queue of requests gdb works flawlessly.
Design wise is healthier to have already created threads that digest actions than always spawning new threads.
Still same code debugs without a problem on Visual Studio so I do have to say that is a small disappointment to me with regards to gdb.

I use Eclipse and looking at the GDB traces (usually enabled by default) will give you a better hint of where GDB fails. One of the buttons on the console shows you the GDB trace.

https://stackoverflow.com/questions/16814706/how-does-gdb-attach-to-multi-threaded-process

转载于:https://www.cnblogs.com/redstar9451/p/8126016.html

Why gdb crash if create too many threads ?相关推荐

  1. 使用gdb调试多进程和多线程

    GDB调试多进程 1. 默认设置下,在调试多进程程序时GDB只会调试主进程.但是GDB(>V7.0)支持多进程的分别以及同时调试,换句话说,GDB可以同时调试多个程序.只需要设置follow-f ...

  2. GDB调试--以汇编语言为例

    #rpm -qa |grep  gdb 下载: 安装 #tar -zxvf #./configure #make 使用GDB 以汇编语言调试为例 汇编语言实现CPUID指令 CPUID cpuid是I ...

  3. gdb 跟踪调试命令整理

    内容源自于陈浩CSDN博客的用GDB调试程序一系列文章 用GDB调试程序(一) 用GDB调试程序(二) 用GDB调试程序(三) 用GDB调试程序(四) 用GDB调试程序(五) 用GDB调试程序(六) ...

  4. 批量裁剪GIS数据(包含GDB,MDB,Shp)

    # -*- coding: utf-8 -*- # made by 汪林_质检处 import os.path import arcpy import sys from arcpy import en ...

  5. C语言gdb调试之精髓 | gdb调试多线程

    C语言gdb调试之精髓(常用命令.多进程.多线程.程序日志) 起语: 版权声明: C语言技术网原创文章,转载请说明文章的来源.作者和原文的链接. 来源:C语言技术网(www.freecplus.net ...

  6. 操作系统——Threads 线程

    目录​​​​​​​ 1. Overview 2. Multicore Programming 多核编程 2.1 Concurrency vs. Parallelism 并发vs.并行 2.2 Prog ...

  7. FD.io VPP配置文件详解

    目录 VPP Configuration File - 'startup.conf' Introduction Command-line Arguments Configuration File Co ...

  8. mysql源码分析——InnoDB引擎启动分析

    一.InnoDB启动 在MySql中,InnoDB的启动流程其实是很重要的.一些更细节的问题,就藏在了这其中.在前面分析过整个数据库启动的流程,本篇就具体分析一下InnoDB引擎启动所做的各种动作.在 ...

  9. CPT104-Operating Systems Concepts

    文章目录 1. Process Management 1.1 Process Concept 1.1.1 Process State 1.1.2 Process Control Block (PCB) ...

最新文章

  1. JVM中的栈和局部变量
  2. java手动输入函数_Java程序如何添加一个函数,如果玩家输入错误,它将返回代码。...
  3. 安装Xen Server创建虚拟机
  4. Shell入门(四)之数组
  5. 西瓜书《机器学习》线性模型 对数几率(逻辑)回归公式推导
  6. leetcode:N-Queens 问题
  7. linux系统一键安装php运行环境apache,mysql等
  8. Java-第N篇推荐的一些学习书籍
  9. 计算机网络(第五版)读书笔记
  10. 笔记本电脑无线网络连接不上怎么办
  11. php中开通短信验证码,php利用云片网实现短信验证码功能的示例代码
  12. 个人见解:什么是WBS?
  13. Notepad++安装HexEditor插件
  14. android蓝牙门禁,1号社区APP互联门禁产品新开门方式说明
  15. C++:亲戚(relation)
  16. 集体户口和个人户口的区别,看完你就明白了
  17. 2022年全球市场铋基高温超导体总体规模、主要生产商、主要地区、产品和应用细分研究报告
  18. C++之路进阶——codevs2313(星际竞速)
  19. 关于Sony Z Ultra日本运营商定制版(SOL24)破解电信那点事!
  20. 常量函数与常量对象的使用

热门文章

  1. Python自学笔记-列表生成式(来自廖雪峰的官网Python3)
  2. 3.C#中泛型类的进一步探讨
  3. 大型互联网应用中的日志系统
  4. ros控制上网时间,网络定时通断
  5. 浅谈ASP.NET内部机制(五)
  6. jquery Selector 源码分析
  7. Verilog中memory数据类型
  8. Zynq器件XADC模块介绍
  9. 网络爬虫---json编码和解码
  10. 一名大神的github