Mantis - Quercus
Viewing Issue Advanced Details
4035 crash always 05-12-10 05:37 05-13-10 07:36
sblommers  
nam  
normal  
closed 4.0.7  
fixed  
none    
none 4.0.7  
0004035: java.lang.NullPointerException on drupal admin/user/permissions
When using drupal agains a version higher then 4.0.3 (works) whenever I submit the permission form from Drupal (quite a big matrix) I receive this error.

2010-05-12 14:30:15.791:WARN::/statebox/index.php
java.lang.NullPointerException
    at com.caucho.quercus.env.LongValue.toStringBuilder(LongValue.java:239)
    at com.caucho.quercus.env.Value.toStringValue(Value.java:982)
    at com.caucho.quercus.env.Value.toStringValue(Value.java:974)
    at com.caucho.quercus.lib.ArrayModule.extract(ArrayModule.java:1859)
    at com.caucho.quercus.lib.string.StringUtility.parseStr(StringUtility.java:144)
    at com.caucho.quercus.lib.string.StringUtility.parseStr(StringUtility.java:56)
    at com.caucho.quercus.env.Post.fillPost(Post.java:171)
    at com.caucho.quercus.env.Post.fillPost(Post.java:78)
    at com.caucho.quercus.env.Env.fillPost(Env.java:566)
    at com.caucho.quercus.env.Env.<init>(Env.java:451)
    at com.caucho.quercus.QuercusContext.createEnv(QuercusContext.java:2021)
    at com.caucho.quercus.servlet.QuercusServletImpl.service(QuercusServletImpl.java:160)
    at com.caucho.quercus.servlet.QuercusServlet.service(QuercusServlet.java:582)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:229)
    at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:143)
    at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:95)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
    at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:134)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
    at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:134)


When I look further into the code I see that Env.getInstance() returns null on Value.toStringValue() [line 974 in Value.java).

Hope this info helps.
 ArrayModule.java.diff [^] (607 bytes) 05-12-10 09:36

Notes
(0004570)
sblommers   
05-12-10 09:20   
I managed to work around this a little bit and now I noticed that the first value in the ArrayModule seems to cause this.

When I replace this code in ArrayModule.java:
StringValue symbolName = entryKey.toStringValue();

to
StringValue symbolName = (StringValue)ConstStringValue.create(entryKey);

then it skips the Env.getInstance().

When I now go to the permissions page and save it, everything is saved but the first value I chose.

(0004571)
sblommers   
05-12-10 09:36   
I added a diff for ArrayModule.java to fix this partially. Now the errors are gone but the first row of the array is ignored.

The diff is created for svn revision 7119

(0004573)
nam   
05-13-10 07:36   
php/081t