[Ltrace-devel] ltrace stucks with pthreads

Heiko Carstens heiko.carstens at de.ibm.com
Fri Apr 14 11:14:42 UTC 2006


  1. > What am I doing wrong? Is there a hidden secret to use ltrace with threads? Any
  2. > additional parameter to pass. Or any specific compilation switch to use?

  3. You're doing nothing wrong, but came across a limitation of ltrace.
  4.  
  5. ltrace is not able to trace threaded processes: If a process generates a thread
  6. that shares the same address space (that is calling the "clone" system call with
  7. parameters CLONE_VM, CLONE_THREAD) the traced process will die with SIGILL
  8. (s390/s390x) or SIGTRAP (i386).
  9.  
  10. The reason for this is that ltrace inserts breakpoints (illegal instructions)
  11. into the traced thread's address space. This address space is shared between all
  12. threads, but ltrace gets only notified for breakpoints of the first thread's
  13. breakpoints. If the second thread reaches such a breakpoint the kernel notices
  14. that this particular thread of the process is not traced and therefore sends it
  15. a SIGILL signal (if a signal handler is present) or terminates it because of the
  16. illegal instruction.
  17.  
  18. Fixing ltrace to be able to trace threaded processes ain't easy. Additionaly
  19. the follow-fork option of ltrace is also anything but perfect:
  20. It attaches to the child when it is already running (or worst case: the child
  21. already terminated). This could be fixed by using ptrace's PTRACE_SETOPTIONS
  22. together with PTRACE_O_TRACEFORK. The only difficult thing would be to make
  23. the changes in a way that ltrace still runs on older kernels that don't
  24. support this ptrace interface (btw.: the latest man page release finally
  25. documents all the different ptrace requests).
  26.  
  27. 升级到
  1. [root@localhost ~]# ltrace -V
  2. ltrace version 0.5.
  3. Copyright (C) 1997-2006 Juan Cespedes <cespedes@debian.org>.
  4. This is free software; see the GNU General Public Licence
  5. version 2 or later for copying conditions. There is NO warranty.

ltrace killed by SIGTRAP的更多相关文章

  1. #定位系统性能瓶颈# strace &amp; ltrace

    strace和ltrace分别相应的是系统调用和库函数调用, 系统调用实际上就是指最底层的一个调用,在linux程序设计里面就是底层调用的意思,面向的是硬件. 而库函数调用则面向的是应用开发的.相当于 ...

  2. ltrace命令详解

    原文链接:https://ipcmen.com/ltrace 用来跟踪进程调用库函数的情况 补充说明 NAME       ltrace - A library call tracer ltrace命 ...

  3. 安装lxml时gcc: internal compiler error: Killed (program cc1)的解决方法

    在安装lxml时出现如下错误 gcc: internal compiler error: Killed (program cc1) 通过查看dmesg发现下述错误信息[2517343.500178] ...

  4. NPM install - killed error solution

    在接手一个Node项目的时候,npm install.却出现了"killed"的错误.以为是Node版本的问题,熟练地切换了0.11与0.10版,同样无解. 由于新的npm版本吧, ...

  5. 线上mysql内存持续增长直至内存溢出被killed分析(已解决)

    来新公司前,领导就说了,线上生产环境Mysql库经常会发生日间内存爆掉被killed的情况,结果来到这第一天,第一件事就是要根据线上服务器配置优化配置,同时必须找出现在mysql内存持续增加爆掉的原因 ...

  6. 锁_rac环境kill锁表会话后出现killed状态(解决)

    原创作品,出自 "深蓝的blog" 博客,深蓝的blog:http://blog.csdn.net/huangyanlong/article/details/46876961 ra ...

  7. 阿里云linux服务器安装Phalcon-----"phalcon Volt directory can't be written" "gcc: internal compiler error: Killed (program cc1)"

    这里特别蛋疼的一件事是官方英文文档和中文文档命令参数略有不同 中文文档: //通用平台下安装指定的软件包: sudo yum install git gcc make pcre-devel php-d ...

  8. 使用truss、strace或ltrace诊断软件的“疑难杂症”

    简介 进程无法启动,软件运行速度突然变慢,程序的"Segment Fault"等等都是让每个Unix系统用户头痛的问题,本文通过三个实际案例演示如何使用truss.strace和l ...

  9. linux下的调试工具ltrace与strace

    ltrace能够跟踪进程的库函数调用,它会显现出哪个库函数被调用,而strace则是跟踪程序的每个系统调用. 下面是一个ltrace与strace的对比   1)系统调用的输出对比   我们用输出he ...

随机推荐

  1. 解析rss和atom文件出现乱码问题

    try { String xmlString = new String(response.data, Charset.forName("UTF-8")); XmlPullParse ...

  2. jquery data方法

    jquery.data()文档:http://api.jquery.com/jQuery.data/ html5有个data-*属性,跟这个功能一样. Note: This is a low-leve ...

  3. 【DataStructure In Python】Python模拟栈和队列

    用Python模拟栈和队列主要是利用List,当然也可以使用collection的deque.以下内容为栈: #! /usr/bin/env python # DataStructure Stack ...

  4. Form - CHECKBOX全选功能

    FORM BUILDER开发,遇到这样一个需求: 添加一个CHECKBOX完成全选功能,红框为新添加的CHECKBOX(如图示) Try to use APP_RECORD.FOR_ALL_RECOR ...

  5. 各种数据库使用JDBC连接的方式

    Java数据库连接(JDBC)由一组用 Java 编程语言编写的类和接口组成.JDBC 为工具/数据库开发人员提供了一个标准的 API,使他们能够用纯Java API 来编写数据库应用程序.然而各个开 ...

  6. Eclipse全屏及插件下载

    Eclipse全屏插件下载 解压下载的压缩包,将  plugins  文件夹中的  cn.pande.eclipsex.fullscreen_1.0.7.jar  文件拷贝到Eclipse安装目录下的 ...

  7. OpenSSL 拒绝服务漏洞

    漏洞名称: OpenSSL 拒绝服务漏洞 CNNVD编号: CNNVD-201312-058 发布时间: 2013-12-05 更新时间: 2013-12-05 危害等级:    漏洞类型:   威胁 ...

  8. Samba nsswitch/pam_winbind.c文件输入验证漏洞

    漏洞名称: Samba nsswitch/pam_winbind.c文件输入验证漏洞 CNNVD编号: CNNVD-201312-047 发布时间: 2013-12-05 更新时间: 2013-12- ...

  9. 【转】NI语法 JNI参考 JNI函数大全

    原文网址:http://blog.sina.com.cn/s/blog_5de73d0b0101chk1.html 一.对照表 Java类型    本地类型         描述boolean     ...

  10. Log4Net 配置和使用

    转:http://www.cnblogs.com/chencidi/archive/2010/01/12/1645291.html web.config配置如下: <?xml version=& ...