NPE in a Rails application with JIT enabled
-------------------------------------------
Key: JRUBY-899
URL: http://jira.codehaus.org/browse/JRUBY-899
Project: JRuby
Issue Type: Bug
Components: Compiler
Reporter: Dudley Flanders
I'm getting a NullPointerException in my Rails app when I run it under the JIT.
Here's the top of the trace:
{noformat}
ActionView::TemplateError (java.lang.NullPointerException: null) on line #51 of
app/views/accounts/_accounts.rhtml:
48: <%- end -%>
49: <%- end -%>
50: </tbody>
51: </table>
52: </div>
/Users/dudley/Code/JRuby/jruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1023:in
`find_one11086421_1751811.__file__'
/Users/dudley/Code/JRuby/jruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:-1:in
`find_one11086421_1751811.run'
DefaultMethod.java:141:in
`org.jruby.internal.runtime.methods.DefaultMethod.internalCall'
DynamicMethod.java:79:in
`org.jruby.internal.runtime.methods.DynamicMethod.call'
DefaultMethod.java:126:in
`org.jruby.internal.runtime.methods.DefaultMethod.call'
EvaluationState.java:1018:in `org.jruby.evaluator.EvaluationState.fCallNode'
EvaluationState.java:251:in
`org.jruby.evaluator.EvaluationState.evalInternal'
EvaluationState.java:1229:in
`org.jruby.evaluator.EvaluationState.localAsgnNode'
EvaluationState.java:284:in
`org.jruby.evaluator.EvaluationState.evalInternal'
EvaluationState.java:521:in `org.jruby.evaluator.EvaluationState.blockNode'
EvaluationState.java:199:in
`org.jruby.evaluator.EvaluationState.evalInternal'
EvaluationState.java:644:in `org.jruby.evaluator.EvaluationState.caseNode'
EvaluationState.java:207:in
`org.jruby.evaluator.EvaluationState.evalInternal'
EvaluationState.java:521:in `org.jruby.evaluator.EvaluationState.blockNode'
EvaluationState.java:199:in
`org.jruby.evaluator.EvaluationState.evalInternal'
EvaluationState.java:162:in `org.jruby.evaluator.EvaluationState.eval'
DefaultMethod.java:168:in
`org.jruby.internal.runtime.methods.DefaultMethod.internalCall'
DynamicMethod.java:79:in
`org.jruby.internal.runtime.methods.DynamicMethod.call'
DefaultMethod.java:126:in
`org.jruby.internal.runtime.methods.DefaultMethod.call'
EvaluationState.java:1018:in `org.jruby.evaluator.EvaluationState.fCallNode'
EvaluationState.java:251:in
`org.jruby.evaluator.EvaluationState.evalInternal'
EvaluationState.java:605:in `org.jruby.evaluator.EvaluationState.caseNode'
EvaluationState.java:207:in
`org.jruby.evaluator.EvaluationState.evalInternal'
EvaluationState.java:521:in `org.jruby.evaluator.EvaluationState.blockNode'
EvaluationState.java:199:in
`org.jruby.evaluator.EvaluationState.evalInternal'
EvaluationState.java:162:in `org.jruby.evaluator.EvaluationState.eval'
DefaultMethod.java:168:in
`org.jruby.internal.runtime.methods.DefaultMethod.internalCall'
DynamicMethod.java:79:in
`org.jruby.internal.runtime.methods.DynamicMethod.call'
DefaultMethod.java:126:in
`org.jruby.internal.runtime.methods.DefaultMethod.call'
AliasMethod.java:70:in `org.jruby.internal.runtime.methods.AliasMethod.call'
EvaluationState.java:1018:in `org.jruby.evaluator.EvaluationState.fCallNode'
EvaluationState.java:251:in
`org.jruby.evaluator.EvaluationState.evalInternal'
EvaluationState.java:521:in `org.jruby.evaluator.EvaluationState.blockNode'
EvaluationState.java:199:in
`org.jruby.evaluator.EvaluationState.evalInternal'
EvaluationState.java:162:in `org.jruby.evaluator.EvaluationState.eval'
DefaultMethod.java:168:in
`org.jruby.internal.runtime.methods.DefaultMethod.internalCall'
DynamicMethod.java:79:in
`org.jruby.internal.runtime.methods.DynamicMethod.call'
DefaultMethod.java:126:in
`org.jruby.internal.runtime.methods.DefaultMethod.call'
AliasMethod.java:70:in `org.jruby.internal.runtime.methods.AliasMethod.call'
EvaluationState.java:563:in `org.jruby.evaluator.EvaluationState.callNode'
EvaluationState.java:205:in
`org.jruby.evaluator.EvaluationState.evalInternal'
EvaluationState.java:162:in `org.jruby.evaluator.EvaluationState.eval'
DefaultMethod.java:168:in
`org.jruby.internal.runtime.methods.DefaultMethod.internalCall'
DynamicMethod.java:79:in
`org.jruby.internal.runtime.methods.DynamicMethod.call'
DefaultMethod.java:126:in
`org.jruby.internal.runtime.methods.DefaultMethod.call'
EvaluationState.java:1765:in `org.jruby.evaluator.EvaluationState.vcallNode'
{noformat}
And the relevant method from ActiveRecord::Base (line 1023 is the
options.update line):
{noformat}
def find_one(id, options)
conditions = " AND (#{sanitize_sql(options[:conditions])})" if
options[:conditions]
options.update :conditions =>
"#{table_name}.#{connection.quote_column_name(primary_key)} =
#{quote_value(id,columns_hash[primary_key])}#{conditions}"
# Use find_every(options).first since the primary key condition
# already ensures we have a single record. Using find_initial adds
# a superfluous :limit => 1.
if result = find_every(options).first
result
else
raise RecordNotFound, "Couldn't find #{name} with
ID=#{id}#{conditions}"
end
end
{noformat}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email