Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001720 [Quercus] major always 04-28-07 08:56 04-28-07 19:07
Reporter salishev View Status public  
Assigned To nam
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.1.1 Product Version 3.1.1
  Product Build
Summary 0001720: Resource leak prevents stress testing
Description I've tested with latest resin-3.1.s070425

The resource leak leads to server restart due to exception and creates unbearable delay in server responce.

[19:35:07.302] java.io.FileNotFoundException: /srv/www2/webapps/ROOT/dokuwiki/VERSION (Too many open files)
[19:35:07.302] at java.io.FileInputStream.open(Native Method)
[19:35:07.302] at java.io.FileInputStream.<init>(FileInputStream.java:106)
[19:35:07.302] at com.caucho.vfs.FilePath.openReadImpl(FilePath.java:418)
[19:35:07.302] at com.caucho.vfs.Path.openRead(Path.java:977)
[19:35:07.302] at com.caucho.quercus.lib.file.FileInput.<init>(FileInput.java:65)
[19:35:07.302] at com.caucho.quercus.lib.file.FileModule.fopen(FileModule.java:1369)
[19:35:07.302] at com.caucho.quercus.lib.file.FileModule.file(FileModule.java:669)
[19:35:07.302] at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
[19:35:07.302] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[19:35:07.302] at java.lang.reflect.Method.invoke(Method.java:589)
[19:35:07.302] at com.caucho.quercus.module.StaticFunction.invoke(StaticFunction.java:105)
[19:35:07.302] at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:614)
[19:35:07.302] at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:487)
[19:35:07.302] at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:473)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:180)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:125)
[19:35:07.302] at com.caucho.quercus.env.JavaInvoker.evalArguments(JavaInvoker.java:416)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:169)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.evalCopy(FunctionExpr.java:149)
[19:35:07.302] at com.caucho.quercus.expr.AssignExpr.eval(AssignExpr.java:77)
[19:35:07.302] at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
[19:35:07.302] at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:78)
[19:35:07.302] at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:78)
[19:35:07.302] at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:75)
[19:35:07.302] at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:99)
[19:35:07.302] at com.caucho.quercus.program.Function.callImpl(Function.java:316)
[19:35:07.302] at com.caucho.quercus.program.Function.call(Function.java:264)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:180)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:125)
[19:35:07.302] at com.caucho.quercus.env.JavaInvoker.evalArguments(JavaInvoker.java:416)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:169)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:125)
[19:35:07.302] at com.caucho.quercus.expr.AppendExpr.eval(AppendExpr.java:90)
[19:35:07.302] at com.caucho.quercus.program.ReturnStatement.execute(ReturnStatement.java:68)
[19:35:07.302] at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:75)
[19:35:07.302] at com.caucho.quercus.program.Function.callImpl(Function.java:316)
[19:35:07.302] at com.caucho.quercus.program.Function.call(Function.java:264)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:180)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:125)
[19:35:07.302] at com.caucho.quercus.expr.AppendExpr.eval(AppendExpr.java:90)
[19:35:07.302] at com.caucho.quercus.expr.Expr.evalArg(Expr.java:400)
[19:35:07.302] at com.caucho.quercus.expr.ArrayFunExpr.eval(ArrayFunExpr.java:107)
[19:35:07.302] at com.caucho.quercus.expr.Expr.evalCopy(Expr.java:387)
[19:35:07.302] at com.caucho.quercus.expr.AssignExpr.eval(AssignExpr.java:77)
[19:35:07.302] at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
[19:35:07.302] at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:99)
[19:35:07.302] at com.caucho.quercus.program.Function.callImpl(Function.java:316)
[19:35:07.302] at com.caucho.quercus.program.Function.call(Function.java:264)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:180)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:125)
[19:35:07.302] at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
[19:35:07.302] at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:99)
[19:35:07.302] at com.caucho.quercus.program.QuercusProgram.execute(QuercusProgram.java:239)
[19:35:07.302] at com.caucho.quercus.page.InterpretedPage.execute(InterpretedPage.java:61)
[19:35:07.302] at com.caucho.quercus.env.Env.include(Env.java:3297)
[19:35:07.302] at com.caucho.quercus.expr.IncludeExpr.eval(IncludeExpr.java:86)
[19:35:07.302] at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
[19:35:07.302] at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:99)
[19:35:07.302] at com.caucho.quercus.program.Function.callImpl(Function.java:316)
[19:35:07.302] at com.caucho.quercus.program.Function.call(Function.java:264)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:180)
[19:35:07.302] at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:125)
[19:35:07.302] at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:64)
[19:35:07.302] at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:99)
[19:35:07.302] at com.caucho.quercus.program.QuercusProgram.execute(QuercusProgram.java:239)
[19:35:07.302] at com.caucho.quercus.page.InterpretedPage.execute(InterpretedPage.java:61)
[19:35:07.302] at com.caucho.quercus.page.QuercusPage.executeTop(QuercusPage.java:115)
[19:35:07.302] at com.caucho.quercus.servlet.ResinQuercusServlet.service(ResinQuercusServlet.java:125)
[19:35:07.302] at com.caucho.quercus.servlet.QuercusServlet.service(QuercusServlet.java:341)
[19:35:07.302] at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
[19:35:07.302] at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:103)
[19:35:07.302] at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175)
[19:35:07.302] at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:240)
[19:35:07.302] at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
[19:35:07.302] at com.caucho.server.port.TcpConnection.run(TcpConnection.java:477)
[19:35:07.302] at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:600)
[19:35:07.302] at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:522)
[19:35:07.302] at java.lang.Thread.run(Thread.java:619)
Steps To Reproduce
Additional Information Actually I've found 3 resource leaks

1. com.caucho.quercus.parser.QuercusParser.parseEval/parseEvalExpr doesn't close the input stream

2. com.caucho.quercus.lib.file.FileInput.close() doesn't call super.close()

3. com.caucho.quercus.lib.file.FileInput.<init> doesn't call env.addClose(this);
Attached Files

- Relationships

- Notes
(0001875)
nam
04-28-07 19:07

good catch

1. it is reading a string so we don't need to close it
2. fixed
3. fixed

There were also other file locking issues that may arise in rare circumstances. They have also been fixed.
 

- Issue History
Date Modified Username Field Change
04-28-07 08:56 salishev New Issue
04-28-07 18:17 nam Status new => assigned
04-28-07 18:17 nam Assigned To  => nam
04-28-07 19:07 nam Status assigned => closed
04-28-07 19:07 nam Note Added: 0001875
04-28-07 19:07 nam Resolution open => fixed
04-28-07 19:07 nam Fixed in Version  => 3.1.1


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker