Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340700

Summary: [LTTng] File descriptors exhausted because traces are never closed
Product: z_Archived Reporter: Alexandre Montplaisir <alexmonthy>
Component: LinuxToolsAssignee: Francois Chouinard <fchouinard>
Status: CLOSED FIXED QA Contact: Francois Chouinard <fchouinard>
Severity: minor    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Proposed fix fchouinard: iplog+

Description Alexandre Montplaisir CLA 2011-03-22 15:28:06 EDT
Build Identifier: M20110210-1200

After running for a while and opening many experiments and traces, the trace reading library crashes with the following error:

ERROR:tracefile.c:1429:map_block: assertion failed: (block_num < tf->num_blocks)



Reproducible: Always

Steps to Reproduce:
1. I used the following code to load a trace:
testSomething() {
    ITmfTrace[] traces = new ITmfTrace[1];
    traces[0] = new LTTngTrace(traceFile.getPath());
    fExperiment = new TmfExperiment<LttngEvent>(LttngEvent.class, "Headless", traces);

    /* do stuff */

    fExperiment.dispose();
}

2. Call testSomething() many times.

3. Eclipse crashes after hitting the file descriptor limit (1024 by default), as the descriptor are never released.
Comment 1 Alexandre Montplaisir CLA 2011-03-22 15:39:15 EDT
Created attachment 191708 [details]
Proposed fix

Here is a small change that fixes the above problem.
Comment 2 Francois Chouinard CLA 2011-03-29 18:39:38 EDT
Patch committed. Thanks Alexandre.
Comment 3 Francois Chouinard CLA 2011-07-22 15:04:42 EDT
Delivered with 0.8