Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337696 - [traceview] possibility of endless loop during view of a physical trace
Summary: [traceview] possibility of endless loop during view of a physical trace
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Geclipse (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Harald Kornmayer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-21 04:36 EST by Ansgar Radermacher CLA
Modified: 2014-01-09 16:01 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ansgar Radermacher CLA 2011-02-21 04:36:11 EST
Function getEventsByPhysicalClock of class Process.java (geclipse.eventgraph.tracereader.otf) can enter an endless loop, thus blocking the UI thread and requiring a restart of Eclipse

It is reproducible with a simple trace (with just 20 events), if I scroll to the end of the trace. The trace file is available on request. The code below shows the endless while loop and a workaround I installed on my PC.

public Event[] getEventsByPhysicalClock (final int timeStart, final int timeStop )
  {
    ArrayList<Event> events = new ArrayList<Event>();
    if (timeStart < 0) {
	return events.toArray( new Event[ 0 ] );
    }
    try {
      Event event = (Event) getPhysicalEvent( timeStart );
      if( event != null ) {
        if( event.getPhysicalStartClock() <= timeStop )
          events.add( event );
        event = event.getNextEvent();
        int n = 0;  // [ansgar] workaround for infinite loops
        while( event != null && event.getPhysicalStartClock() < timeStop ) {
          events.add( event );
          event = event.getNextEvent();
          if (n++ > 10000) {
            // TODO [ansgar] workaround for infinite loops
            break;
          }
        }
      }
    } catch( IndexOutOfBoundsException e ) {