kikonen/ngannotate-rails

crash and burn: ever seen anything like this?

tony-kerz opened this issue · 11 comments

hi,

trying to use gem and getting a crazy dump (see excerpt below), any guidance?

let me know if i can provide any other info like versions of things, etc...

~/g/snikt-api (tk/compress) $ rake assets:precompile

[omitted...]

rake aborted!
ExecJS::RuntimeError: Unrecognized node in FTL backend:
     395:           <!0:->  VarInjectionWatchpoint(MustGen, R:MiscFields, bc#446, exit: bc#31)

Full graph dump:

DFG for readWord1#<no-hash>:[0x105085000->0x1034fc000->0x103748f70, DFGFunctionCall, 721 (StrictMode)]:
  Fixpoint state: FixpointConverged; Form: SSA; Unification state: GloballyUnified; Ref count state: ExactRefCount

Block #0 (bc#0):  (OSR target)
  Execution count: 1.000000
  Predecessors:
  Dominated by: #0
  Dominates: #0 #1 #2 #3 #4 #5 #6 #7 #8 #9 #10 #11 #12 #13 #14 #15 #16 #17 #18 #19 #20 #21 #22 #23 #24 #25 #26 #27 #28 #29 #30 #31 #32 #33 #34 #35 #36 #37 #38 #39 #40 #41 #42 #43 #44 #45 #46 #47 #48 #49 #50 #51 #52 #53 #54 #55 #56 #57 #58 #59 #60 #61 #62 #63 #64 #65 #66 #67 #68 #69 #70
  Availability: arg0:r6:FlushedJSValue/Unavailable
  Live: 
  Values: 
   0:           <!0:->  GetArgument(JS|MustGen|PureInt, arg0(a), machine:arg0, R:Variables(6), bc#0)  predicting Otherobj
   1:           < 3:->  JSConstant(JS|UseAsOther, Other, $8 = Undefined, bc#0)
   2:  skipped  < 0:->  MovHint(@1, loc0, W:SideState, bc#0)
   3:           <!0:->  Phantom(MustGen, bc#0)
   4:  skipped  < 0:->  MovHint(@1, loc1, W:SideState, bc#0)
   5:           <!0:->  Phantom(MustGen, bc#0)
   6:  skipped  < 0:->  MovHint(@1, loc2, W:SideState, bc#0)

[omitted... (like 10 screenfuls of dumpage)]

Block #70 (<none>): 
  Execution count: 1.000000
  Predecessors: #68 #69
  Dominated by: #0 #1 #17 #22 #66 #70
  Dominates: #70
  Availability: arg0:r6:FlushedJSValue/@0 loc0:ConflictingFlush/@1232 loc1:ConflictingFlush/@1262 loc2:ConflictingFlush/@28 loc3:ConflictingFlush/@56
  Live: @1141
  Values: @1141=>(Top, TOP, TOP, TOP)
 1141:           < 1:-> Phi(JS|PureInt, W:SideState, bc#4294967295)
 1371:  skipped  < 0:-> MovHint(@1141, loc6, W:SideState, bc#4294967295)
 775:           <!0:->  Phantom(MustGen, StringOther, bc#719)
 776:           <!0:->  Return(Kill:@1141, MustGen, W:SideState, bc#719)
  Availability: arg0:r6:FlushedJSValue/@0 loc0:ConflictingFlush/@1232 loc1:ConflictingFlush/@1262 loc2:ConflictingFlush/@28 loc3:ConflictingFlush/@56 loc6:ConflictingFlush/@1141
  Live: 
  Values: 

Structures:
    %Ah:Function     = 0x101bdebf0:[Function, {name:100, length:101}, NonArray, Proto:0x1030cffd0]
    %Be:Function     = 0x101bdedf0:[Function, {}, NonArray, Proto:0x1030cffd0]
    %D9:RegExp       = 0x101bdc1f0:[RegExp, {}, NonArray, Proto:0x10312ffb0]
    %Dm:JSActivation = 0x101bdcc70:[JSActivation, {}, NonArray]
    %Du:global       = 0x101bd3570:[global, {Object:100=>0x1030cff50, Function:101=>0x1030cff30, Array:102=>0x1030cff10, RegExp:103=>0x10319fe70, EvalError:104=>0x1030cfdd0, RangeError:105=>0x1030cfdb0, ReferenceError:106=>0x1030cfd90, SyntaxError:107=>0x1030cfd70, TypeError:108=>0x1030cfd50, URIError:109=>0x1030cfd30, Promise:110=>0x1030cfd10, Set:111=>0x1030cfef0, Map:112=>0x1030cfed0, Date:113=>0x1030cfeb0, String:114=>0x1030cfe90, Boolean:115=>0x1030cfe70, Number:116=>0x1030cfe50, Error:117=>0x1030cfe30, ArrayBuffer:118=>0x1030cfe10, WeakMap:119=>0x1030cfdf0, eval:120=>0x1030fe570, JSON:121, Math:122, DataView:123=>0x1030cfbd0, Float64Array:124=>0x1030cfbf0, Float32Array:125=>0x1030cfc10, Uint32Array:126=>0x1030cfc30, Int32Array:127=>0x1030cfcb0, Uint16Array:128=>0x1030cfc50, Int16Array:129=>0x1030cfcd0, Uint8ClampedArray:130=>0x1030cfc70, Uint8Array:131=>0x1030cfc90, Int8Array:132=>0x1030cfcf0, console:133, Name:134=>0x1030cfbb0, debug:135=>0x1030fd7b0, describe:136=>0x1030fd770, describeArray:137=>0x1030fd730, print:138=>0x1030fd6f0, quit:139=>0x1030fd6b0, gc:140=>0x1030fd670, fullGC:141=>0x1030fd630, edenGC:142=>0x1030fd5f0, deleteAllCompiledCode:143=>0x1030fd5b0, version:144=>0x1030fd570, run:145=>0x1030fd530, load:146=>0x1030fd4f0, readFile:147=>0x1030fd4b0, checkSyntax:148=>0x1030fd470, jscStack:149=>0x1030fd430, readline:150=>0x1030fd3f0, preciseTime:151=>0x1030fd3b0, neverInlineFunction:152=>0x1030fd370, noInline:153=>0x1030fd330, numberOfDFGCompiles:154=>0x1030fd2f0, optimizeNextInvocation:155=>0x1030fd2b0, reoptimizationRetryCount:156=>0x1030fd270, transferArrayBuffer:157=>0x1030fd230, Root:158=>0x1030fd1f0, Element:159=>0x1030fd1b0, getElement:160=>0x1030fd170, setElementRoot:161=>0x1030fd130, DFGTrue:162=>0x1030fd0f0, OSRExit:163=>0x1030fd0b0, isFinalTier:164=>0x1030fd070, predictInt32:165=>0x1030fd030, fiatInt52:166=>0x1030fcff0, effectful42:167=>0x1030fcfb0, makeMasquerader:168=>0x1030fcf70, createProxy:169=>0x1030fcf30, createRuntimeArray:170=>0x1030fcef0, createImpureGetter:171=>0x1030fceb0, setImpureGetterDelegate:172=>0x1030fce70, arguments:173, window:174, parseFloat:175=>0x1030f0b70, parseInt:176=>0x1030f0b30}, NonArray, Proto:0x10311fff0]
    %Dx:String       = 0x101bda170:[String, {toString:100=>0x1030ff1b0, valueOf:101=>0x1030ff170, charAt:102=>0x1030ff130, charCodeAt:103=>0x1030ff0f0, concat:104=>0x1030ff0b0, indexOf:105=>0x1030ff070, lastIndexOf:106=>0x1030ff030, match:107=>0x1030feff0, replace:108=>0x1030fefb0, search:109=>0x1030fef70, slice:110=>0x1030fef30, split:111=>0x1030feef0, substr:112=>0x1030feeb0, substring:113=>0x1030fee70, toLowerCase:114=>0x1030fee30, toUpperCase:115=>0x1030fedf0, localeCompare:116=>0x1030fedb0, toLocaleLowerCase:117=>0x1030fed70, toLocaleUpperCase:118=>0x1030fed30, big:119=>0x1030fecf0, small:120=>0x1030fecb0, blink:121=>0x1030fec70, bold:122=>0x1030fec30, fixed:123=>0x1030febf0, italics:124=>0x1030febb0, strike:125=>0x1030feb70, sub:126=>0x1030feb30, sup:127=>0x1030feaf0, fontcolor:128=>0x1030feab0, fontsize:129=>0x1030fea70, anchor:130=>0x1030fea30, link:131=>0x1030fe9f0, trim:132=>0x1030fe9b0, trimLeft:133=>0x1030fe970, trimRight:134=>0x1030fe930, length:135, constructor:136=>0x1030cfe90}, NonArray, Proto:0x10311fff0]
    %EI:string       = 0x101bdfd70:[string, {}, NonArray]

1   0x7fff8e0a28c8 JSC::FTL::LowerDFGToLLVM::compileBlock(JSC::DFG::BasicBlock*)
2   0x7fff8e0a1d55 JSC::FTL::LowerDFGToLLVM::lower()
3   0x7fff8e0a0f89 JSC::FTL::lowerDFGToLLVM(JSC::FTL::State&)
4   0x7fff8e04f856 JSC::DFG::Plan::compileInThreadImpl(JSC::DFG::LongLivedState&)
5   0x7fff8e04f07d JSC::DFG::Plan::compileInThread(JSC::DFG::LongLivedState&, JSC::DFG::ThreadData*)
6   0x7fff8e088942 JSC::DFG::Worklist::runThread(JSC::DFG::ThreadData*)
7   0x7fff8dd8614f WTF::wtfThreadEntryPoint(void*)
8   0x7fff82cff268 _pthread_body
9   0x7fff82cff1e5 _pthread_body
10  0x7fff82cfd41d thread_start

  (in /Users/tony/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/jquery-rails-4.0.3/vendor/assets/javascripts/jquery.js)
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

Surely haven't seen auch.

Q1: what js runtime you are using?

Q2: What version of this gem? If not latest (1.0.0), can you try also with that?

Based into that error "Unrecognized node in FTL backend" I deduce that you might be using webkit based runtime. Anyway this sounds like but in javascript runtime, and possible fix is to try different runtime. Also version 1.0.0 of ngannotate-rails gem might reduce changes of this, since it's by default ignoring js files in "vendor" -assets paths.

hi kari,

i was using default version which was currently pre-1.0.0, but when i specified 1.0.0, it worked 👍

as an aside, i'm not sure how to determine what js-runtime is in play, do kno how to do that?

anyway, thanks for the prompt response!

best,
tony.

I believe Gemfile should indicate what js runtime is used.

Currently used runtime should be shown via:

rails console
ExecJS.runtime

cool, thx k:

irb(main):001:0> ExecJS.runtime
=> #<ExecJS::ExternalRuntime:0x007fcb9619ce68 @name="JavaScriptCore", @command="/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc", @runner_path="/Users/tony/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/execjs-2.3.0/lib/execjs/support/jsc_runner.js", @encoding=nil, @deprecated=false, @binary="/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc", @popen_options={:internal_encoding=>#<Encoding:UTF-8>}>
irb(main):002:0> 

Hi there,

I have the same issue here. I switch to 1.0.0 and it's still happening.

here is my runtime :

2.2.1 :001 > ExecJS.runtime
 => #<ExecJS::ExternalRuntime:0x007fbde447f578 @name="JavaScriptCore", @command="/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc", @runner_path="/Users/christophe/.rvm/gems/ruby-2.2.1/gems/execjs-2.5.2/lib/execjs/support/jsc_runner.js", @encoding=nil, @deprecated=false, @binary="/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc", @popen_options={:internal_encoding=>#<Encoding:UTF-8>}> 

Hope it can help ?

Try setting explicitly in Gemfile different js runtime.

gem 'therubyracer',  platforms: :ruby

Sorry for the delay, but YES, it fix it 👍

TODO:

  • need to add remark about this into README

Addressed README via #23