Mantis - Quercus
Viewing Issue Advanced Details
5511 major always 08-28-13 13:22 08-28-13 13:22
jpalmisa  
 
normal  
new 4.0.36  
open  
none    
none  
0005511: unserialize() fails with IOException when unserializing PHP class the implements Serializabe
When I attempt to unserialize objects that implement the PHP Serializable interface Quercus throws:

java.io.IOException: option not recognized 'C'
                          at com.caucho.quercus.lib.UnserializeReader.unserialize(UnserializeReader.java:334)
                           at com.caucho.quercus.lib.VariableModule.unserialize(VariableModule.java:697)
                           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:597)
                           at com.caucho.quercus.module.StaticFunction.invoke(StaticFunction.java:113)
                           at com.caucho.quercus.env.JavaInvoker.callJavaMethod(JavaInvoker.java:814)
                           at com.caucho.quercus.env.JavaInvoker.callMethod(JavaInvoker.java:690)
                           at com.caucho.quercus.env.JavaInvoker.call(JavaInvoker.java:671)
                           at com.caucho.quercus.expr.CallExpr.evalImpl(CallExpr.java:226)
                           at com.caucho.quercus.expr.CallExpr.evalCopy(CallExpr.java:154)
                           at com.caucho.quercus.expr.Expr.evalAssignValue(Expr.java:585)
                           at com.caucho.quercus.expr.BinaryAssignExpr.eval(BinaryAssignExpr.java:88)
                           at com.caucho.quercus.expr.Expr.evalTop(Expr.java:540)
                           at com.caucho.quercus.statement.ExprStatement.execute(ExprStatement.java:67)
                           at com.caucho.quercus.statement.BlockStatement.execute(BlockStatement.java:105)
                           at com.caucho.quercus.statement.TryStatement.execute(TryStatement.java:72)......

I looked at the UnserializeReader.unserialize(...) method and the case statement does not account for 'C' as the leading character of the serialized string. The PHP doc on the Serializable interface (http://php.net/manual/en/class.serializable.php) [^] shows that this is a valid leading character.

The serialized objects were written to disk using PHP 5.3.

There are no notes attached to this issue.