Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000553 [Quercus] minor always 12-23-05 01:20 01-07-06 15:56
Reporter bago View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.0.18 Product Version
  Product Build 3.0.17
Summary 0000553: java.util.FormatFlagsConversionMismatchException
Description Trying wordpress:

500 Servlet Exception

java.util.FormatFlagsConversionMismatchException: Conversion = s, Flags
= 0
    at java.util.Formatter$FormatSpecifier.failMismatch(Formatter.java:3974)
    at java.util.Formatter$FormatSpecifier.checkBadFlags(Formatter.java:2899)
    at java.util.Formatter$FormatSpecifier.checkGeneral(Formatter.java:2859)
    at java.util.Formatter$FormatSpecifier.<init>(Formatter.java:2636)
    at java.util.Formatter.parse(Formatter.java:2477)
    at java.util.Formatter.format(Formatter.java:2411)
    at java.util.Formatter.format(Formatter.java:2364)
    at java.lang.String.format(String.java:2520)
    at com.caucho.quercus.lib.QuercusStringModule.sprintf(QuercusStringModule.java:1154)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.caucho.quercus.module.StaticFunction.eval(StaticFunction.java:347)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:144)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:96)
    at com.caucho.quercus.program.ReturnStatement.execute(ReturnStatement.java:65)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.Function.evalImpl(Function.java:264)
    at com.caucho.quercus.program.Function.eval(Function.java:204)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:144)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:96)
    at com.caucho.quercus.expr.Expr.evalString(Expr.java:402)
    at com.caucho.quercus.expr.AppendExpr.evalString(AppendExpr.java:145)
    at com.caucho.quercus.expr.AppendExpr.eval(AppendExpr.java:136)
    at com.caucho.quercus.program.Function.evalImpl(Function.java:238)
    at com.caucho.quercus.program.Function.eval(Function.java:204)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:144)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:96)
    at com.caucho.quercus.program.ReturnStatement.execute(ReturnStatement.java:65)
    at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:69)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.Function.evalImpl(Function.java:264)
    at com.caucho.quercus.program.Function.eval(Function.java:204)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:144)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:96)
    at com.caucho.quercus.expr.AssignExpr.eval(AssignExpr.java:76)
    at com.caucho.quercus.expr.Expr.evalTop(Expr.java:300)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:74)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.ForeachStatement.execute(ForeachStatement.java:99)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:66)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:66)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.Function.evalImpl(Function.java:264)
    at com.caucho.quercus.program.Function.eval(Function.java:204)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:144)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:96)
    at com.caucho.quercus.expr.Expr.evalTop(Expr.java:300)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:74)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.Function.evalImpl(Function.java:264)
    at com.caucho.quercus.program.Function.eval(Function.java:204)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:144)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:96)
    at com.caucho.quercus.expr.Expr.evalTop(Expr.java:300)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:74)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.PhpProgram.execute(PhpProgram.java:259)
    at com.caucho.quercus.page.InterpretedPage.execute(InterpretedPage.java:73)
    at com.caucho.quercus.env.Env.include(Env.java:1962)
    at com.caucho.quercus.expr.IncludeOnceExpr.eval(IncludeOnceExpr.java:72)
    at com.caucho.quercus.expr.Expr.evalTop(Expr.java:300)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:74)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.Function.evalImpl(Function.java:264)
    at com.caucho.quercus.program.Function.eval(Function.java:204)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:144)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:96)
    at com.caucho.quercus.expr.Expr.evalTop(Expr.java:300)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:74)
    at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:66)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.Function.evalImpl(Function.java:264)
    at com.caucho.quercus.program.Function.eval(Function.java:204)
    at com.caucho.quercus.expr.FunctionExpr.evalImpl(FunctionExpr.java:144)
    at com.caucho.quercus.expr.FunctionExpr.eval(FunctionExpr.java:96)
    at com.caucho.quercus.expr.Expr.evalTop(Expr.java:300)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:74)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.PhpProgram.execute(PhpProgram.java:259)
    at com.caucho.quercus.page.InterpretedPage.execute(InterpretedPage.java:73)
    at com.caucho.quercus.env.Env.include(Env.java:1962)
    at com.caucho.quercus.expr.IncludeExpr.eval(IncludeExpr.java:68)
    at com.caucho.quercus.expr.Expr.evalTop(Expr.java:300)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:74)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:66)
    at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:69)
    at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:69)
    at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:69)
    at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:69)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:66)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.IfStatement.execute(IfStatement.java:66)
    at com.caucho.quercus.program.PhpProgram.execute(PhpProgram.java:259)
    at com.caucho.quercus.page.InterpretedPage.execute(InterpretedPage.java:73)
    at com.caucho.quercus.env.Env.include(Env.java:1962)
    at com.caucho.quercus.expr.IncludeExpr.eval(IncludeExpr.java:68)
    at com.caucho.quercus.expr.Expr.evalTop(Expr.java:300)
    at com.caucho.quercus.program.ExprStatement.execute(ExprStatement.java:74)
    at com.caucho.quercus.program.BlockStatement.execute(BlockStatement.java:111)
    at com.caucho.quercus.program.PhpProgram.execute(PhpProgram.java:259)
    at com.caucho.quercus.page.InterpretedPage.execute(InterpretedPage.java:73)
    at com.caucho.quercus.page.PhpPage.executeTop(PhpPage.java:116)
    at com.caucho.quercus.servlet.QuercusServlet.service(QuercusServlet.java:194)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
    at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
    at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178)
    at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
    at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:267)
    at com.caucho.server.port.TcpConnection.run(TcpConnection.java:388)
    at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490)
    at com.caucho.util.ThreadPool.run(ThreadPool.java:423)
    at java.lang.Thread.run(Thread.java:595)

Resin-3.0.17 (built Thu, 22 Dec 2005 12:11:34 PST)


I can't see references to any of my php files (or compiled java) so I don't know what this actually is.
Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0000576)
bago
12-25-05 09:42

Here is a code to reproduce the issue:

<?php
sprintf('%02s', 5);
?>

java.util.FormatFlagsConversionMismatchException: Conversion = s, Flags
= 0
    at java.util.Formatter$FormatSpecifier.failMismatch(Formatter.java:3974)
    at java.util.Formatter$FormatSpecifier.checkBadFlags(Formatter.java:2899)
    at java.util.Formatter$FormatSpecifier.checkGeneral(Formatter.java:2859)
    at java.util.Formatter$FormatSpecifier.<init>(Formatter.java:2636)
    at java.util.Formatter.parse(Formatter.java:2477)
    at java.util.Formatter.format(Formatter.java:2411)
    at java.util.Formatter.format(Formatter.java:2364)
    at java.lang.String.format(String.java:2520)
    at com.caucho.quercus.lib.QuercusStringModule.sprintf(QuercusStringModule.java:1154)
    at _quercus._test__php.execute(_test__php.java:50)
    at com.caucho.quercus.page.PhpPage.executeTop(PhpPage.java:116)
    at com.caucho.quercus.servlet.QuercusServlet.service(QuercusServlet.java:194)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
    at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
    at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178)
    at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
    at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:267)
    at com.caucho.server.port.TcpConnection.run(TcpConnection.java:388)
    at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490)
    at com.caucho.util.ThreadPool.run(ThreadPool.java:423)
    at java.lang.Thread.run(Thread.java:595)
 
(0000603)
ferg
12-30-05 13:13

The issue is a format like "%02s" to sprintf. The zero-fill flag is illegal for Java's sprintf.

A quick patch removes the '0'. The longer fix will need to parse the sprintf format and handle special cases appropriately.
 
(0000645)
ferg
01-07-06 15:56

php/115{0,1,2,3,4}
 

- Issue History
Date Modified Username Field Change
12-23-05 01:20 bago New Issue
12-25-05 09:42 bago Note Added: 0000576
12-30-05 13:13 ferg Note Added: 0000603
01-07-06 15:56 ferg Note Added: 0000645
01-07-06 15:56 ferg Assigned To  => ferg
01-07-06 15:56 ferg Status new => closed
01-07-06 15:56 ferg Resolution open => fixed
01-07-06 15:56 ferg Fixed in Version  => 3.0.18
01-07-06 15:56 ferg View Status @0@ => public


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