Segmentation fault in read Lttng events with Python

不打扰是莪最后的温柔 提交于 2019-12-25 07:59:00

问题


I used Ubunto 16.04, Lttng 2.8.1 and python3.5.2. I also installed python3-babeltrace package. The first step was I recorded some logs exactly based on Lttng documents with lttng create, evenet-enable, start, stop, destroy. In the second step I write a very simple python program to read lttng events, some thing like this:

from collections import Counter
import babeltrace
import sys

print("Start")

trace_path = sys.argv[1]

print("1-Get Path")

col = babeltrace.TraceCollection()

print("2-TraceCollection")

# (LTTng traces always have the 'ctf' format)
if col.add_trace(trace_path, 'ctf') is None:
    raise RuntimeError('Cannot add trace')

print("3-Add trace by ctf")

for event in col.events:
    print(event.name)

print("4-Get all events") 

then I debug the program with gdb and after this outputs:

Start
1-Get Path
2-TraceCollection
3-Add trace by ctf

I got the error:

Program received signal SIGSEGV, Segmentation fault. 0x00007ffff565d97f in bt_iter_add_trace () from /usr/lib/x86_64-linux-gnu/libbabeltrace.so.1

Does any one have any idea about this?

I uninstall all of the packages, also uninstall ubuntu and then installed again but each time I got the same error. I also try to install Ubuntu 16.10 but with that one I got another error in lttng-module package installation.

Update:

I found that none of babeltrace command and lttng view not worked, and caused the segmentation fault error.

来源:https://stackoverflow.com/questions/40698938/segmentation-fault-in-read-lttng-events-with-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!