[Openchat-devel] Stress testing for openchat
Status: Beta
Brought to you by:
diego_de_lima
|
From: Jing Xu <rob...@gm...> - 2013-08-24 00:52:14
|
Hi,
My name is Jing Xu. I am a student from University of Texas at Arlington,
United States.
I am developing a software testing tool to detect thread stress
vulnerability of server application. And our tool detects the vulnerability
on your openchat in following main function:
public static void main(String a[]) throws Exception {
loadProps();
printProps();
int port=Integer.parseInt(getProperty("CHAT_SERVER_PORT"));
if (a.length > 0) port=Integer.parseInt(a[0]);
for (int i=0; i < Integer.parseInt(getProperty("CHAT_SERVER_WORKERS"));
i++) {
Worker w=new Worker();
(new Thread(w,"worker #" + i)).start();
threads.addElement(w);
}
try {
ServerSocket ss=new ServerSocket(port);
do {
java.net.Socket s=ss.accept();
Worker w=null;
synchronized (threads) {
if (threads.isEmpty()) {
Worker ws=new Worker();
ws.setSocket(s);
(new Thread(ws,"additional worker")).start();
}
else {
w=(Worker)threads.elementAt(0);
threads.removeElementAt(0);
w.setSocket(s);
}
}
}
while (true);
}
catch ( BindException e) {
p("Could not open the ServerSocket. Propably the address (port:" + port
+ ") is already in use.");
}
System.exit(1);
}
Is it possible that worker will be created with unbounded times? Thanks
advanced for your help.
Best,
Jing
|