1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-21 07:55:24 +02:00

[358301] [DSTORE] Hang during debug source look up

This commit is contained in:
David McKnight 2011-10-19 18:32:04 +00:00
parent e8bd883e79
commit b129a7fed3
4 changed files with 70 additions and 8 deletions

View file

@ -22,6 +22,7 @@
* David McKnight (IBM) - [283613] [dstore] Create a Constants File for all System Properties we support * David McKnight (IBM) - [283613] [dstore] Create a Constants File for all System Properties we support
* David McKnight (IBM) - [153635] [dstore-linux] dangling symbolic links are not classified properly * David McKnight (IBM) - [153635] [dstore-linux] dangling symbolic links are not classified properly
* David McKnight (IBM) - [350581] [dstore] FileClassifier should default to English * David McKnight (IBM) - [350581] [dstore] FileClassifier should default to English
* David McKnight (IBM) - [358301] [DSTORE] Hang during debug source look up
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.universal.miners.filesystem; package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
@ -272,7 +273,10 @@ public class FileClassifier extends SecuredThread
super.run(); super.run();
if (!_systemSupportsClassify) if (!_systemSupportsClassify)
return; return;
init();
try {
init();
// get full path // get full path
String filePath = null; String filePath = null;
@ -337,6 +341,10 @@ public class FileClassifier extends SecuredThread
} }
_dataStore.disconnectObject(_subject); _dataStore.disconnectObject(_subject);
_dataStore.refresh(_subject); _dataStore.refresh(_subject);
}
catch (OutOfMemoryError e){
System.exit(-1);
}
} }
/** /**
@ -656,6 +664,9 @@ public class FileClassifier extends SecuredThread
} }
} }
} }
catch (OutOfMemoryError e){
System.exit(-1);
}
catch (Exception e) catch (Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
@ -663,6 +674,9 @@ public class FileClassifier extends SecuredThread
available = stream.available(); available = stream.available();
} }
} }
catch (OutOfMemoryError e){
System.exit(-1);
}
catch (Exception e) catch (Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
@ -729,7 +743,13 @@ public class FileClassifier extends SecuredThread
} }
// run command with the working directory being the parent file // run command with the working directory being the parent file
Process theProcess = Runtime.getRuntime().exec(args, envVars, parentFile); Process theProcess = null;
try {
theProcess = Runtime.getRuntime().exec(args, envVars, parentFile);
}
catch (OutOfMemoryError e){
System.exit(-1);
}
BufferedReader reader = null; BufferedReader reader = null;
DataInputStream stream = null; DataInputStream stream = null;
@ -755,6 +775,9 @@ public class FileClassifier extends SecuredThread
else else
line = readLine(stream, _specialEncoding);//reader.readLine(); line = readLine(stream, _specialEncoding);//reader.readLine();
} }
catch (OutOfMemoryError e){
System.exit(-1);
}
catch (Exception e) catch (Exception e)
{ {
} }
@ -911,6 +934,9 @@ public class FileClassifier extends SecuredThread
else else
line = readLine(stream, _specialEncoding); line = readLine(stream, _specialEncoding);
} }
catch (OutOfMemoryError e){
System.exit(-1);
}
catch (Exception e) catch (Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
@ -954,6 +980,9 @@ public class FileClassifier extends SecuredThread
} }
} }
} }
catch (OutOfMemoryError e){
System.exit(-1);
}
catch (Exception e) catch (Exception e)
{ {
e.printStackTrace(); e.printStackTrace();
@ -1069,4 +1098,13 @@ public class FileClassifier extends SecuredThread
// TODO: log error // TODO: log error
} }
} }
public void start(){
try {
super.start();
}
catch (OutOfMemoryError e){
System.exit(-1);
}
}
} }

View file

@ -15,6 +15,7 @@
* Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients * Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients
* David McKnight (IBM) - [251650] [dstore] Multiple copies of symbolic link file show in Table view * David McKnight (IBM) - [251650] [dstore] Multiple copies of symbolic link file show in Table view
* David McKnight (IBM) - [251729][dstore] problems querying symbolic link folder * David McKnight (IBM) - [251729][dstore] problems querying symbolic link folder
* David McKnight (IBM) - [358301] [DSTORE] Hang during debug source look up
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.universal.miners.filesystem; package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
@ -369,7 +370,11 @@ public class FileQueryThread extends QueryThread
} }
} }
} catch (Exception e) { }
catch (OutOfMemoryError e){
System.exit(-1);
}
catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
UniversalServerUtilities.logError(UniversalFileSystemMiner.CLASSNAME, UniversalServerUtilities.logError(UniversalFileSystemMiner.CLASSNAME,
"createDataElement failed with exception - isFile ", e, _dataStore); //$NON-NLS-1$ "createDataElement failed with exception - isFile ", e, _dataStore); //$NON-NLS-1$

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2007, 2008 IBM Corporation and others. * Copyright (c) 2007, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -12,6 +12,7 @@
* Contributors: * Contributors:
* Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients * Noriaki Takatsu (IBM) - [220126] [dstore][api][breaking] Single process server for multiple clients
* Martin Oberhuber (Wind River) - [199854][api] Improve error reporting for archive handlers * Martin Oberhuber (Wind River) - [199854][api] Improve error reporting for archive handlers
* David McKnight (IBM) - [358301] [DSTORE] Hang during debug source look up
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.dstore.universal.miners.filesystem; package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
@ -113,6 +114,7 @@ public class QueryThread extends SecuredThread implements ICancellableHandler {
else else
expandedSize = size; expandedSize = size;
try {
buffer.append(version).append(IServiceConstants.TOKEN_SEPARATOR).append(date).append( buffer.append(version).append(IServiceConstants.TOKEN_SEPARATOR).append(date).append(
IServiceConstants.TOKEN_SEPARATOR).append(size).append(IServiceConstants.TOKEN_SEPARATOR); IServiceConstants.TOKEN_SEPARATOR).append(size).append(IServiceConstants.TOKEN_SEPARATOR);
buffer.append(hidden).append(IServiceConstants.TOKEN_SEPARATOR).append(canWrite).append( buffer.append(hidden).append(IServiceConstants.TOKEN_SEPARATOR).append(canWrite).append(
@ -126,7 +128,10 @@ public class QueryThread extends SecuredThread implements ICancellableHandler {
IServiceConstants.TOKEN_SEPARATOR); IServiceConstants.TOKEN_SEPARATOR);
buffer.append(compressionRatio).append(IServiceConstants.TOKEN_SEPARATOR).append( buffer.append(compressionRatio).append(IServiceConstants.TOKEN_SEPARATOR).append(
expandedSize); expandedSize);
}
catch (OutOfMemoryError e){
System.exit(-1);
}
String buf = buffer.toString(); String buf = buffer.toString();
return buf; return buf;

View file

@ -26,6 +26,7 @@
* David McKnight (IBM) - [299568] Remote search only shows result in the symbolic linked file * David McKnight (IBM) - [299568] Remote search only shows result in the symbolic linked file
* David McKnight (IBM] - [330989] [dstore] OutOfMemoryError occurs when searching for a text in a large remote file * David McKnight (IBM] - [330989] [dstore] OutOfMemoryError occurs when searching for a text in a large remote file
* David McKnight (IBM) - [283613] [dstore] Create a Constants File for all System Properties we support * David McKnight (IBM) - [283613] [dstore] Create a Constants File for all System Properties we support
* David McKnight (IBM) - [358301] [DSTORE] Hang during debug source look up
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.dstore.universal.miners.filesystem; package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
@ -35,6 +36,7 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator;
import org.eclipse.dstore.core.model.DE; import org.eclipse.dstore.core.model.DE;
import org.eclipse.dstore.core.model.DataElement; import org.eclipse.dstore.core.model.DataElement;
@ -56,6 +58,7 @@ import org.eclipse.rse.services.clientserver.archiveutils.VirtualChild;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.services.clientserver.search.SystemSearchFileNameMatcher; import org.eclipse.rse.services.clientserver.search.SystemSearchFileNameMatcher;
import org.eclipse.rse.services.clientserver.search.SystemSearchLineMatch; import org.eclipse.rse.services.clientserver.search.SystemSearchLineMatch;
import org.eclipse.rse.services.clientserver.search.SystemSearchMatch;
import org.eclipse.rse.services.clientserver.search.SystemSearchStringMatchLocator; import org.eclipse.rse.services.clientserver.search.SystemSearchStringMatchLocator;
import org.eclipse.rse.services.clientserver.search.SystemSearchStringMatcher; import org.eclipse.rse.services.clientserver.search.SystemSearchStringMatcher;
@ -504,11 +507,22 @@ public class UniversalSearchHandler extends SecuredThread implements ICancellabl
for (int i = 0; i < lineMatches.length; i++) { for (int i = 0; i < lineMatches.length; i++) {
match = lineMatches[i]; match = lineMatches[i];
DataElement obj = _dataStore.createObject(deObj, _deGrep, match.getLine(), absPath);
obj.setAttribute(DE.A_SOURCE, obj.getSource() + ':'+ match.getLineNumber());
DataElement obj = _dataStore.createObject(deObj, _deGrep, match.getLine(), absPath);
String sourceString = obj.getSource() + ':'+ match.getLineNumber();
Iterator iter = match.getMatches();
StringBuffer offsets = new StringBuffer();
while (iter.hasNext()){
SystemSearchMatch m = (SystemSearchMatch)iter.next();
int start = m.getStartOffset();
int end = m.getEndOffset();
offsets.append("(" + start + "," + end + ")");
}
obj.setAttribute(DE.A_SOURCE, sourceString + offsets.toString());
} }
_dataStore.disconnectObjects(deObj); _dataStore.disconnectObjects(deObj);
_dataStore.refresh(deObj);
} }
public void checkAndClearupMemory() public void checkAndClearupMemory()