Project

General

Profile

Actions

Bug #1052

closed

Python 3 exit code 139 with repeated requests of EventDeclaration

Added by Daniel U. Thibault almost 8 years ago. Updated over 3 years ago.

Status:
Invalid
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
07/19/2016
Due date:
% Done:

0%

Estimated time:

Description

Using Python 3.2.3 on Ubuntu 14.04.4 through PyCharm Community Edition 2016.1.3, build #PC-145.971, JRE: 1.8.0_76-release-b32 amd64, JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

#!/usr/bin/python3
import babeltrace

def some_events(trace_collection, number):
    n_names = 0
    for event in trace_collection.events:
        n_names += 1
        print("{0:s}:".format(event.name))
        n_decl = 0
        for decl in event.handle.events:
            n_decl += 1
        print("   {0:d} declarations".format(n_decl))
        if (number is not None) and (n_names >= number):
            break

trace_path = "/home/daniel/lttng-traces/ffx-session-20160706-141412.0/kernel" 

trace_collection = babeltrace.TraceCollection()

trace_handle = trace_collection.add_trace(trace_path, 'ctf')

print("first three events:")
some_events(trace_collection, 3)
print("some_events done.")

print("All done.")

Results in:

/usr/bin/python3.2mu /home/daniel/pycharm-community-2016.1.3/helpers/pydev/pydevd.py --multiproc --qt-support --client 127.0.0.1 --port 58138 --file /home/daniel/PycharmProjects/untitled/ltrace_examples.py
pydev debugger: process 8756 is connecting

Connected to pydev debugger (build 145.971)
first three events:
syscall_exit_epoll_wait:
   12826 declarations
syscall_entry_ioctl:
   12826 declarations

Process finished with exit code 139

The exit occurs on the for event in trace_collection.events: line when the third event (which is quite valid) should be generated. Exit code 139 is SIGSEGV, "attempt to access a virtual address which is not in your address space", and is probably an out-of-memory error. Maybe a major memory leak? I tried importing gc and calling gc.collect() right after each inner loop: it collects no objects.

(The set of @EventDeclaration@s is unchanging for a given trace; but there could be cases where one wants to interrogate the @EventDeclaration@s of a collection of several traces)

Actions

Also available in: Atom PDF