ltrace killed by SIGTRAP

[Ltrace-devel] ltrace stucks with pthreads

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


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

You‘re doing nothing wrong, but came across a limitation of ltrace.

ltrace is not able to trace threaded processes: If a process generates a thread
that shares the same address space (that is calling the "clone" system call with
parameters CLONE_VM, CLONE_THREAD) the traced process will die with SIGILL
(s390/s390x) or SIGTRAP (i386).

The reason for this is that ltrace inserts breakpoints (illegal instructions)
into the traced thread‘s address space. This address space is shared between all
threads, but ltrace gets only notified for breakpoints of the first thread‘s
breakpoints. If the second thread reaches such a breakpoint the kernel notices
that this particular thread of the process is not traced and therefore sends it
a SIGILL signal (if a signal handler is present) or terminates it because of the
illegal instruction.

Fixing ltrace to be able to trace threaded processes ain‘t easy. Additionaly
the follow-fork option of ltrace is also anything but perfect:
It attaches to the child when it is already running (or worst case: the child
already terminated). This could be fixed by using ptrace‘s PTRACE_SETOPTIONS
together with PTRACE_O_TRACEFORK. The only difficult thing would be to make
the changes in a way that ltrace still runs on older kernels that don‘t
support this ptrace interface (btw.: the latest man page release finally
documents all the different ptrace requests).

升级到
[[email protected] ~]# ltrace -V
ltrace version 0.5.
Copyright (C) 1997-2006 Juan Cespedes <cespedes@debian.org>.
This is free software; see the GNU General Public Licence
version 2 or later for copying conditions.  There is NO warranty.
时间: 2024-12-15 07:10:42

ltrace killed by SIGTRAP的相关文章

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

strace和ltrace分别相应的是系统调用和库函数调用, 系统调用实际上就是指最底层的一个调用,在linux程序设计里面就是底层调用的意思,面向的是硬件. 而库函数调用则面向的是应用开发的.相当于应用程序的api.常见的lib有openssl.libxml等. 前者属于内核层.后者属于用户层,以下有其层次相应图 引用<UNIX环境高级编程>对这两个概念的差别描写叙述例如以下:      还有一个可说明系统调用和库函数之间的区别的样例是, U N I X提供决定当前时间和日期的 界面.某些操

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

strace和ltrace分别对应的是系统调用和库函数调用, 系统调用实际上就是指最底层的一个调用,在linux程序设计里面就是底层调用的意思,面向的是硬件. 而库函数调用则面向的是应用开发的,相当于应用程序的api,常见的lib有openssl.libxml等. 前者属于内核层,后者属于用户层,下面有其层次对应图 引用<UNIX环境高级编程>对这两个概念的区别描述如下:      另一个可说明系统调用和库函数之间的差别的例子是, U N I X提供决定当前时间和日期的 界面.某些操作系统提供

技巧: 使用truss、strace或ltrace诊断软件的&quot;疑难杂症&quot;

简介 进程无法启动,软件运行速度突然变慢,程序的"Segment Fault"等等都是让每个Unix系统用户头痛的问题,本文通过三个实际案例演示如何使用truss.strace和ltrace这三个常用的调试工具来快速诊断软件的"疑难杂症". truss和strace用来 跟踪一个进程的系统调用或信号产生的情况,而 ltrace用来 跟踪进程调用库函数的情况.truss是早期为System V R4开发的调试程序,包括Aix.FreeBSD在内的大部分Unix系统都自

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

原创作品,出自 "深蓝的blog" 博客,深蓝的blog:http://blog.csdn.net/huangyanlong/article/details/46876961 rac生产库杀掉锁表会话出现killed状态处理 环境: 操作系统:CentOS 6.4 64BIT 数据库:Oracle RAC 11.2.0.4 R2 64bit 在某项目中,进行大数据抽取任务时,抽取出现错误,需要对大表进行重新抽取.于是取消insert操作,然后执行truncate操作. 如下,报错了,提

spark sql运行出错(Container killed on request. Exit code is 143)

错误描述: SQL三张表做join运行出错: 用hive执行报错如下: Diagnostic Messages for this Task: Container [pid=27756,containerID=container_1460459369308_5864_01_000570] is running beyond physical memory limits. Current usage: 4.2 GB of 4 GB physical memory used; 5.0 GB of 16

Android 低内存导致monkey killed分析指南

现象描述: monkey --pkg-blacklist-file storage/sdcard0/blacklist.txt  --ignore-security-exc eptions --monitor-native-crashes -s 800 -v -v -v  --throttle 1427 180000 >sdcard /Monkey.log shes -s 800 -v -v -v  --throttle 1427 180000 >sdcard/Monkey.log      

How Scala killed the Strategy Pattern

How Scala killed the Strategy Pattern By Alvin Alexander. Last updated: Mar 23, 2014 table of contents [hide] The OOP Strategy Pattern Two immediate thoughts How Scala killed the Strategy Pattern Understanding the 'execute' method Dude, you used 'met

Oracle安装补丁时报ollect2: ld terminated with signal 9 [Killed]

1.报错信息 Make failed to invoke "/usr/bin/make -f ins_rdbms.mk ioracle ORACLE_HOME=/u01/app/oracle/product/11.2/db_1"....'collect2: ld terminated with signal 9 [Killed] make: *** [/u01/app/oracle/product/11.2/db_1/rdbms/lib/oracle] Error 1 2.原因及解决办

spark-shell启动报错:Yarn application has already ended! It might have been killed or unable to launch application master

spark-shell不支持yarn cluster,以yarn client方式启动 spark-shell --master=yarn --deploy-mode=client 启动日志,错误信息如下 其中"Neither spark.yarn.jars nor spark.yarn.archive is set, falling back to uploading libraries under SPARK_HOME",只是一个警告,官方的解释如下: 大概是说:如果 spark.