squeel icon indicating copy to clipboard operation
squeel copied to clipboard

Bug in MRI 1.9.3-p362 with sifters

Open ronalchn opened this issue 13 years ago • 7 comments

With the following code:

class A  < ActiveRecord::Base
  scope :active, lambda { where{sift :is_active} }

  sifter :is_active do
     (started_at <= DateTime.now) & (finish_at > DateTime.now)
  end
end

A.active # following error on this line

I copied the relevant information showing that it occurs inside Squeel somewhere.

-- Control frame information -----------------------------------------------
c:0049 p:---- s:0184 b:0184 l:000183 d:000183 CFUNC  :new
c:0048 p:0025 s:0181 b:0179 l:002420 d:000178 LAMBDA /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/base_extensions.rb:13
c:0047 p:---- s:0176 b:0176 l:000175 d:000175 FINISH
c:0046 p:0042 s:0174 b:0173 l:000172 d:000172 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/predicate_visitation.rb:19
c:0045 p:0032 s:0167 b:0167 l:000166 d:000166 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:147
c:0044 p:0027 s:0160 b:0160 l:000151 d:000159 BLOCK  /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:179
c:0043 p:---- s:0157 b:0157 l:000156 d:000156 FINISH
c:0042 p:---- s:0155 b:0155 l:000154 d:000154 CFUNC  :map
c:0041 p:0012 s:0152 b:0152 l:000151 d:000151 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:179
c:0040 p:0032 s:0147 b:0147 l:000146 d:000146 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:147
c:0039 p:0030 s:0140 b:0140 l:000139 d:000139 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:27
c:0038 p:0064 s:0135 b:0135 l:000b38 d:000134 LAMBDA /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/relation_extensions.rb:22
c:0037 p:---- s:0132 b:0132 l:000131 d:000131 FINISH
c:0036 p:0081 s:0130 b:0128 l:000127 d:000127 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/3.2/relation_extensions.rb:13
c:0035 p:0031 s:0123 b:0123 l:000122 d:000122 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation/query_methods.rb:260
c:0034 p:0101 s:0120 b:0119 l:000118 d:000118 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:171
c:0033 p:0009 s:0113 b:0113 l:000102 d:000112 BLOCK  /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:160
c:0032 p:0190 s:0111 b:0111 l:000110 d:000110 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/explain.rb:40
c:0031 p:0011 s:0103 b:0103 l:000102 d:000102 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:159
c:0030 p:0011 s:0100 b:0100 l:000099 d:000099 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:498
c:0029 p:0013 s:0097 b:0097 l:001bb8 d:000096 BLOCK  /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/inspector.rb:86
c:0028 p:---- s:0094 b:0094 l:000093 d:000093 FINISH
c:0027 p:---- s:0092 b:0092 l:000091 d:000091 CFUNC  :call
c:0026 p:0015 s:0088 b:0088 l:000087 d:000087 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/inspector.rb:30
c:0025 p:0016 s:0084 b:0084 l:000083 d:000083 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/context.rb:260
c:0024 p:0023 s:0081 b:0079 l:000078 d:000078 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:311
c:0023 p:0052 s:0076 b:0076 l:001138 d:000075 BLOCK  /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:160
c:0022 p:0042 s:0068 b:0068 l:000067 d:000067 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:273
c:0021 p:0011 s:0063 b:0063 l:001138 d:000062 BLOCK  /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:156
c:0020 p:0144 s:0059 b:0059 l:000042 d:000058 BLOCK  /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:243
c:0019 p:---- s:0056 b:0056 l:000055 d:000055 FINISH
c:0018 p:---- s:0054 b:0054 l:000053 d:000053 CFUNC  :loop
c:0017 p:0009 s:0051 b:0051 l:000042 d:000050 BLOCK  /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:229
c:0016 p:---- s:0049 b:0049 l:000048 d:000048 FINISH
c:0015 p:---- s:0047 b:0047 l:000046 d:000046 CFUNC  :catch
c:0014 p:0023 s:0043 b:0043 l:000042 d:000042 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:228
c:0013 p:0046 s:0040 b:0040 l:001138 d:001138 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:155
c:0012 p:0011 s:0037 b:0037 l:002428 d:000036 BLOCK  /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:70
c:0011 p:---- s:0035 b:0035 l:000034 d:000034 FINISH
c:0010 p:---- s:0033 b:0033 l:000032 d:000032 CFUNC  :catch
c:0009 p:0183 s:0029 b:0029 l:002428 d:002428 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:69
c:0008 p:0251 s:0024 b:0024 l:002040 d:002040 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.8/lib/rails/commands/console.rb:47
c:0007 p:0019 s:0020 b:0020 l:000019 d:000019 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.8/lib/rails/commands/console.rb:8
c:0006 p:0596 s:0016 b:0016 l:000015 d:000015 TOP    /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.8/lib/rails/commands.rb:41
c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH
c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC  :require
c:0003 p:0061 s:0006 b:0006 l:0009c8 d:000c38 EVAL   script/rails:6
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:0009c8 d:0009c8 TOP   

-- Ruby level backtrace information ----------------------------------------
script/rails:6:in `
' script/rails:6:in `require' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.8/lib/rails/commands.rb:41:in `' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:69:in `start' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:69:in `catch' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:70:in `block in start' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:155:in `eval_input' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:273:in `signal_status' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:160:in `block (2 levels) in eval_input' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:311:in `output_value' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/context.rb:260:in `inspect_last_value' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/inspector.rb:30:in `inspect_value' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/inspector.rb:30:in `call' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/inspector.rb:86:in `block in ' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:498:in `inspect' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:159:in `to_a' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/explain.rb:40:in `logging_query_plan' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:160:in `block in to_a' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:171:in `exec_queries' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation/query_methods.rb:260:in `arel' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/3.2/relation_extensions.rb:13:in `build_arel' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/relation_extensions.rb:22:in `block (2 levels) in ' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:27:in `accept' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:147:in `visit' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:179:in `visit_Array' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:179:in `map' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:179:in `block in visit_Array' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:147:in `visit' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/predicate_visitation.rb:19:in `visit_Squeel_Nodes_Sifter' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/base_extensions.rb:13:in `block in sifter' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/base_extensions.rb:13:in `new'

ronalchn avatar Jan 06 '13 11:01 ronalchn

Does this happen outside of irb? Also, much like a scope, your block is only interpreting DateTime.now on initial load.

Sent from my iPhone

On Jan 6, 2013, at 6:45 AM, Ronald Chan [email protected] wrote:

With the following code:

class A scope :active, lambda { where{sift :is_active} }

sifter :is_active do (started_at <= DateTime.now) & (finish_at > DateTime.now) end end

A.active # following error on this line

I copied the relevant information showing that it occurs inside Squeel somewhere.

-- Control frame information ----------------------------------------------- c:0049 p:---- s:0184 b:0184 l:000183 d:000183 CFUNC :new c:0048 p:0025 s:0181 b:0179 l:002420 d:000178 LAMBDA /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/base_extensions.rb:13 c:0047 p:---- s:0176 b:0176 l:000175 d:000175 FINISH c:0046 p:0042 s:0174 b:0173 l:000172 d:000172 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/predicate_visitation.rb:19 c:0045 p:0032 s:0167 b:0167 l:000166 d:000166 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:147 c:0044 p:0027 s:0160 b:0160 l:000151 d:000159 BLOCK /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:179 c:0043 p:---- s:0157 b:0157 l:000156 d:000156 FINISH c:0042 p:---- s:0155 b:0155 l:000154 d:000154 CFUNC :map c:0041 p:0012 s:0152 b:0152 l:000151 d:000151 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:179 c:0040 p:0032 s:0147 b:0147 l:000146 d:000146 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:147 c:0039 p:0030 s:0140 b:0140 l:000139 d:000139 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:27 c:0038 p:0064 s:0135 b:0135 l:000b38 d:000134 LAMBDA /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/relation_extensions.rb:22 c:0037 p:---- s:0132 b:0132 l:000131 d:000131 FINISH c:0036 p:0081 s:0130 b:0128 l:000127 d:000127 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/3.2/relation_extensions.rb:13 c:0035 p:0031 s:0123 b:0123 l:000122 d:000122 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation/query_methods.rb:260 c:0034 p:0101 s:0120 b:0119 l:000118 d:000118 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:171 c:0033 p:0009 s:0113 b:0113 l:000102 d:000112 BLOCK /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:160 c:0032 p:0190 s:0111 b:0111 l:000110 d:000110 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/explain.rb:40 c:0031 p:0011 s:0103 b:0103 l:000102 d:000102 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:159 c:0030 p:0011 s:0100 b:0100 l:000099 d:000099 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:498 c:0029 p:0013 s:0097 b:0097 l:001bb8 d:000096 BLOCK /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/inspector.rb:86 c:0028 p:---- s:0094 b:0094 l:000093 d:000093 FINISH c:0027 p:---- s:0092 b:0092 l:000091 d:000091 CFUNC :call c:0026 p:0015 s:0088 b:0088 l:000087 d:000087 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/inspector.rb:30 c:0025 p:0016 s:0084 b:0084 l:000083 d:000083 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/context.rb:260 c:0024 p:0023 s:0081 b:0079 l:000078 d:000078 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:311 c:0023 p:0052 s:0076 b:0076 l:001138 d:000075 BLOCK /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:160 c:0022 p:0042 s:0068 b:0068 l:000067 d:000067 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:273 c:0021 p:0011 s:0063 b:0063 l:001138 d:000062 BLOCK /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:156 c:0020 p:0144 s:0059 b:0059 l:000042 d:000058 BLOCK /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:243 c:0019 p:---- s:0056 b:0056 l:000055 d:000055 FINISH c:0018 p:---- s:0054 b:0054 l:000053 d:000053 CFUNC :loop c:0017 p:0009 s:0051 b:0051 l:000042 d:000050 BLOCK /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:229 c:0016 p:---- s:0049 b:0049 l:000048 d:000048 FINISH c:0015 p:---- s:0047 b:0047 l:000046 d:000046 CFUNC :catch c:0014 p:0023 s:0043 b:0043 l:000042 d:000042 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:228 c:0013 p:0046 s:0040 b:0040 l:001138 d:001138 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:155 c:0012 p:0011 s:0037 b:0037 l:002428 d:000036 BLOCK /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:70 c:0011 p:---- s:0035 b:0035 l:000034 d:000034 FINISH c:0010 p:---- s:0033 b:0033 l:000032 d:000032 CFUNC :catch c:0009 p:0183 s:0029 b:0029 l:002428 d:002428 METHOD /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:69 c:0008 p:0251 s:0024 b:0024 l:002040 d:002040 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.8/lib/rails/commands/console.rb:47 c:0007 p:0019 s:0020 b:0020 l:000019 d:000019 METHOD /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.8/lib/rails/commands/console.rb:8 c:0006 p:0596 s:0016 b:0016 l:000015 d:000015 TOP /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.8/lib/rails/commands.rb:41 c:0005 p:---- s:0012 b:0012 l:000011 d:000011 FINISH c:0004 p:---- s:0010 b:0010 l:000009 d:000009 CFUNC :require c:0003 p:0061 s:0006 b:0006 l:0009c8 d:000c38 EVAL script/rails:6 c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH c:0001 p:0000 s:0002 b:0002 l:0009c8 d:0009c8 TOP

-- Ruby level backtrace information ---------------------------------------- script/rails:6:in ' script/rails:6:inrequire' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.8/lib/rails/commands.rb:41:in ' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in start' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in start' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:69:instart' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:69:in catch' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:70:in block in start' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:155:in eval_input' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in each_top_level_statement' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in catch' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in block in each_top_level_statement' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in loop' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in block (2 levels) in each_top_level_statement' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:156:in block in eval_input' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:273:in signal_status' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:160:in block (2 levels) in eval_input' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb.rb:311:in output_value' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/context.rb:260:in inspect_last_value' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/inspector.rb:30:in inspect_value' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/inspector.rb:30:in call' /home/ronald/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/1.9.1/irb/inspector.rb:86:in block in ' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:498:in inspect' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:159:in to_a' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/explain.rb:40:in logging_query_plan' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:160:in block in to_a' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation.rb:171:in exec_queries' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.8/lib/active_record/relation/query_methods.rb:260:in arel' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/3.2/relation_extensions.rb:13:in build_arel' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/relation_extensions.rb:22:in block (2 levels) in ' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:27:in accept' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:147:in visit' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:179:in visit_Array' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:179:in map' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:179:in block in visit_Array' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/visitor.rb:147:in visit' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/visitors/predicate_visitation.rb:19:in visit_Squeel_Nodes_Sifter' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/base_extensions.rb:13:in block in sifter' /home/ronald/.rvm/gems/ruby-1.9.3-p362/gems/squeel-1.0.14/lib/squeel/adapters/active_record/base_extensions.rb:13:in `new'

— Reply to this email directly or view it on GitHubhttps://github.com/ernie/squeel/issues/209.

ernie avatar Jan 06 '13 13:01 ernie

I only checked what was happening in rails console because a test was failing on Travis CI (1.9.3 there now points to 1.9.3-p362).

ronalchn avatar Jan 06 '13 19:01 ronalchn

Any chance you can replicate it in the specs?

Sent from my iPhone

On Jan 6, 2013, at 2:19 PM, Ronald Chan [email protected] wrote:

I only checked what was happening in rails console because a test was failing on Travis CI (1.9.3 there now points to 1.9.3-p362).

— Reply to this email directly or view it on GitHubhttps://github.com/ernie/squeel/issues/209#issuecomment-11932741.

ernie avatar Jan 06 '13 19:01 ernie

Probably not for a while. A bit busy at the moment. The Travis CI failure is at https://travis-ci.org/NZOI/nztrain/jobs/3981524

ronalchn avatar Jan 06 '13 19:01 ronalchn

I checked, and the block is fine. It evaluates on initial load of the scoped queries (good), which is different from initial load of the application (bad).

Travis CI has reverted back to Ruby 1.9.3p327.

References to problems in p362 in general:

  • https://github.com/travis-ci/travis-ci/issues/827
  • https://github.com/gitlabhq/gitlabhq/issues/2476

ronalchn avatar Jan 17 '13 03:01 ronalchn

This is a bug in the MRI GC. Since you're using RVM: update your rvm (rvm get head) and reinstall ruby, they installed a backport that fixes this issue. see https://github.com/wayneeseguin/rvm/commit/7675c0509859c087f2df8c594aab46fb6512fb71

the8472 avatar Jan 17 '13 10:01 the8472

Thanks for digging in, @the8472 !

ernie avatar Jan 17 '13 13:01 ernie