cowboyd/therubyracer — Issue #131: Strange transient error `ExecJS::ProgramError V8::JSError`
Author: vjpr
Created: 2011-12-17 22:18:40+00:00
State: open

When using with the Rails 3.1 asset pipeline I receive this unhelpful message:

ExecJS::ProgramError

line #18 raised:

V8::JSError
(in /.../app/assets/javascripts/models/space.coffee)

17: = stylesheet_link_tag 'application'
18: = javascript_include_tag 'application'

My `application.js` looks like this:

//= require hamlcoffee
//= require_tree ../templates
//= require jquery
//= require jquery_ujs
//= require jquery.tmpl
//= require underscore
//= require backbone
//= require helpers
//= require log4javascript
//= require backbone.modelbinding
//= require app

Adding `//= require models/space` does not resolve the problem.

When I add another require statement required in `app.coffee` such as `//= require view` it fixes the problem. The problem remains fixed until I `rm -rf tmp` and restart `rails server`.

When I deploy to Ubuntu 10.04 LTS and try to run `rails server` in development mode - the error re-emerges. I have been able to fix it by adding a different combination of require statements.

The problem does not emerge if I used `passenger start`.

I am thinking it could be a memory leak issue with V8. How can I get more detailed debug information?

I wonder if there is anyway to choose which Javascript runtime to use with ExecJS?

Full stack trace:

execjs (1.2.12) lib/execjs/ruby_racer_runtime.rb:47:in `call'
execjs (1.2.12) lib/execjs/ruby_racer_runtime.rb:78:in `lock'
therubyracer (0.9.9) lib/v8/c/locker.rb:13:in `Locker'
execjs (1.2.12) lib/execjs/ruby_racer_runtime.rb:76:in `lock'
execjs (1.2.12) lib/execjs/ruby_racer_runtime.rb:40:in `call'
coffee-script (2.2.0) lib/coffee_script.rb:57:in `compile'
tilt (1.3.3) lib/tilt/coffee.rb:46:in `evaluate'
tilt (1.3.3) lib/tilt/template.rb:76:in `render'
sprockets (2.0.3) lib/sprockets/context.rb:175:in `evaluate'
sprockets (2.0.3) lib/sprockets/context.rb:172:in `each'
sprockets (2.0.3) lib/sprockets/context.rb:172:in `evaluate'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:171:in `build_dependency_context_and_body'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:135:in `dependency_context'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:194:in `build_dependencies_paths_and_assets'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:141:in `dependency_paths'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:61:in `mtime'
sprockets (2.0.3) lib/sprockets/asset.rb:58:in `send'
sprockets (2.0.3) lib/sprockets/asset.rb:58:in `encode_with'
sprockets (2.0.3) lib/sprockets/asset.rb:57:in `each'
sprockets (2.0.3) lib/sprockets/asset.rb:57:in `encode_with'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:43:in `encode_with'
sprockets (2.0.3) lib/sprockets/caching.rb:52:in `cache_asset'
sprockets (2.0.3) lib/sprockets/environment.rb:82:in `build_asset'
sprockets (2.0.3) lib/sprockets/base.rb:99:in `find_asset'
sprockets (2.0.3) lib/sprockets/environment.rb:72:in `find_asset'
sprockets (2.0.3) lib/sprockets/base.rb:110:in `[]'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:200:in `build_dependencies_paths_and_assets'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:194:in `each'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:194:in `build_dependencies_paths_and_assets'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:141:in `dependency_paths'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:61:in `mtime'
sprockets (2.0.3) lib/sprockets/asset.rb:58:in `send'
sprockets (2.0.3) lib/sprockets/asset.rb:58:in `encode_with'
sprockets (2.0.3) lib/sprockets/asset.rb:57:in `each'
sprockets (2.0.3) lib/sprockets/asset.rb:57:in `encode_with'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:43:in `encode_with'
sprockets (2.0.3) lib/sprockets/caching.rb:52:in `cache_asset'
sprockets (2.0.3) lib/sprockets/environment.rb:82:in `build_asset'
sprockets (2.0.3) lib/sprockets/base.rb:99:in `find_asset'
sprockets (2.0.3) lib/sprockets/environment.rb:72:in `find_asset'
sprockets (2.0.3) lib/sprockets/base.rb:110:in `[]'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:200:in `build_dependencies_paths_and_assets'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:194:in `each'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:194:in `build_dependencies_paths_and_assets'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:141:in `dependency_paths'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:61:in `mtime'
sprockets (2.0.3) lib/sprockets/asset.rb:58:in `send'
sprockets (2.0.3) lib/sprockets/asset.rb:58:in `encode_with'
sprockets (2.0.3) lib/sprockets/asset.rb:57:in `each'
sprockets (2.0.3) lib/sprockets/asset.rb:57:in `encode_with'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:43:in `encode_with'
sprockets (2.0.3) lib/sprockets/caching.rb:52:in `cache_asset'
sprockets (2.0.3) lib/sprockets/environment.rb:82:in `build_asset'
sprockets (2.0.3) lib/sprockets/base.rb:99:in `find_asset'
sprockets (2.0.3) lib/sprockets/environment.rb:72:in `find_asset'
sprockets (2.0.3) lib/sprockets/base.rb:110:in `[]'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:200:in `build_dependencies_paths_and_assets'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:194:in `each'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:194:in `build_dependencies_paths_and_assets'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:141:in `dependency_paths'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:61:in `mtime'
sprockets (2.0.3) lib/sprockets/asset.rb:58:in `send'
sprockets (2.0.3) lib/sprockets/asset.rb:58:in `encode_with'
sprockets (2.0.3) lib/sprockets/asset.rb:57:in `each'
sprockets (2.0.3) lib/sprockets/asset.rb:57:in `encode_with'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:43:in `encode_with'
sprockets (2.0.3) lib/sprockets/caching.rb:52:in `cache_asset'
sprockets (2.0.3) lib/sprockets/environment.rb:82:in `build_asset'
sprockets (2.0.3) lib/sprockets/base.rb:99:in `find_asset'
sprockets (2.0.3) lib/sprockets/environment.rb:72:in `find_asset'
sprockets (2.0.3) lib/sprockets/base.rb:110:in `[]'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:200:in `build_dependencies_paths_and_assets'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:194:in `each'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:194:in `build_dependencies_paths_and_assets'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:141:in `dependency_paths'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:61:in `mtime'
sprockets (2.0.3) lib/sprockets/asset.rb:58:in `send'
sprockets (2.0.3) lib/sprockets/asset.rb:58:in `encode_with'
sprockets (2.0.3) lib/sprockets/asset.rb:57:in `each'
sprockets (2.0.3) lib/sprockets/asset.rb:57:in `encode_with'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:43:in `encode_with'
sprockets (2.0.3) lib/sprockets/caching.rb:52:in `cache_asset'
sprockets (2.0.3) lib/sprockets/environment.rb:82:in `build_asset'
sprockets (2.0.3) lib/sprockets/base.rb:99:in `find_asset'
sprockets (2.0.3) lib/sprockets/environment.rb:72:in `find_asset'
sprockets (2.0.3) lib/sprockets/base.rb:110:in `[]'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:200:in `build_dependencies_paths_and_assets'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:194:in `each'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:194:in `build_dependencies_paths_and_assets'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:141:in `dependency_paths'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:61:in `mtime'
sprockets (2.0.3) lib/sprockets/asset.rb:58:in `send'
sprockets (2.0.3) lib/sprockets/asset.rb:58:in `encode_with'
sprockets (2.0.3) lib/sprockets/asset.rb:57:in `each'
sprockets (2.0.3) lib/sprockets/asset.rb:57:in `encode_with'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:43:in `encode_with'
sprockets (2.0.3) lib/sprockets/caching.rb:52:in `cache_asset'
sprockets (2.0.3) lib/sprockets/environment.rb:82:in `build_asset'
sprockets (2.0.3) lib/sprockets/trail.rb:102:in `find_asset_in_path'
sprockets (2.0.3) lib/sprockets/base.rb:101:in `find_asset'
sprockets (2.0.3) lib/sprockets/environment.rb:72:in `find_asset'
sprockets (2.0.3) lib/sprockets/base.rb:110:in `[]'
actionpack (3.1.3) lib/sprockets/helpers/rails_helper.rb:130:in `asset_for'
actionpack (3.1.3) lib/sprockets/helpers/rails_helper.rb:27:in `javascript_include_tag'
actionpack (3.1.3) lib/sprockets/helpers/rails_helper.rb:26:in `collect'
actionpack (3.1.3) lib/sprockets/helpers/rails_helper.rb:26:in `javascript_include_tag'
app/views/app/index.haml:18:in `_app_views_app_index_haml__348973727_2585321040'
actionpack (3.1.3) lib/action_view/template.rb:171:in `send'
actionpack (3.1.3) lib/action_view/template.rb:171:in `render'
activesupport (3.1.3) lib/active_support/notifications.rb:55:in `instrument'
actionpack (3.1.3) lib/action_view/template.rb:169:in `render'
actionpack (3.1.3) lib/action_view/renderer/template_renderer.rb:40:in `render_template'
actionpack (3.1.3) lib/action_view/renderer/abstract_renderer.rb:33:in `instrument'
activesupport (3.1.3) lib/active_support/notifications.rb:53:in `instrument'
activesupport (3.1.3) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.1.3) lib/active_support/notifications.rb:53:in `instrument'
actionpack (3.1.3) lib/action_view/renderer/abstract_renderer.rb:33:in `instrument'
actionpack (3.1.3) lib/action_view/renderer/template_renderer.rb:39:in `render_template'
actionpack (3.1.3) lib/action_view/renderer/template_renderer.rb:47:in `render_with_layout'
actionpack (3.1.3) lib/action_view/renderer/template_renderer.rb:38:in `render_template'
actionpack (3.1.3) lib/action_view/renderer/template_renderer.rb:12:in `render'
actionpack (3.1.3) lib/action_view/renderer/abstract_renderer.rb:22:in `wrap_formats'
actionpack (3.1.3) lib/action_view/renderer/template_renderer.rb:9:in `render'
actionpack (3.1.3) lib/action_view/renderer/renderer.rb:36:in `render_template'
actionpack (3.1.3) lib/action_view/renderer/renderer.rb:17:in `render'
actionpack (3.1.3) lib/abstract_controller/rendering.rb:120:in `_render_template'
actionpack (3.1.3) lib/action_controller/metal/streaming.rb:250:in `_render_template'
actionpack (3.1.3) lib/abstract_controller/rendering.rb:114:in `render_to_body'
actionpack (3.1.3) lib/action_controller/metal/renderers.rb:30:in `render_to_body'
actionpack (3.1.3) lib/action_controller/metal/compatibility.rb:43:in `render_to_body'
actionpack (3.1.3) lib/abstract_controller/rendering.rb:99:in `render'
actionpack (3.1.3) lib/action_controller/metal/rendering.rb:16:in `render'
actionpack (3.1.3) lib/action_controller/metal/instrumentation.rb:40:in `render'
activesupport (3.1.3) lib/active_support/core_ext/benchmark.rb:5:in `ms'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
activesupport (3.1.3) lib/active_support/core_ext/benchmark.rb:5:in `ms'
actionpack (3.1.3) lib/action_controller/metal/instrumentation.rb:40:in `render'
actionpack (3.1.3) lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime'
activerecord (3.1.3) lib/active_record/railties/controller_runtime.rb:24:in `cleanup_view_runtime'
actionpack (3.1.3) lib/action_controller/metal/instrumentation.rb:39:in `render'
app/controllers/app_controller.rb:6:in `app'
actionpack (3.1.3) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.1.3) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
actionpack (3.1.3) lib/abstract_controller/base.rb:167:in `process_action'
actionpack (3.1.3) lib/action_controller/metal/rendering.rb:10:in `process_action'
actionpack (3.1.3) lib/abstract_controller/callbacks.rb:18:in `process_action'
activesupport (3.1.3) lib/active_support/callbacks.rb:407:in `_run__1001706688__process_action__833985472__callbacks'
activesupport (3.1.3) lib/active_support/callbacks.rb:386:in `send'
activesupport (3.1.3) lib/active_support/callbacks.rb:386:in `_run_process_action_callbacks'
activesupport (3.1.3) lib/active_support/callbacks.rb:81:in `send'
activesupport (3.1.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.3) lib/abstract_controller/callbacks.rb:17:in `process_action'
actionpack (3.1.3) lib/action_controller/metal/rescue.rb:17:in `process_action'
actionpack (3.1.3) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
activesupport (3.1.3) lib/active_support/notifications.rb:53:in `instrument'
activesupport (3.1.3) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (3.1.3) lib/active_support/notifications.rb:53:in `instrument'
actionpack (3.1.3) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
actionpack (3.1.3) lib/action_controller/metal/params_wrapper.rb:201:in `process_action'
activerecord (3.1.3) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
actionpack (3.1.3) lib/abstract_controller/base.rb:121:in `process'
actionpack (3.1.3) lib/abstract_controller/rendering.rb:45:in `process'
actionpack (3.1.3) lib/action_controller/metal.rb:193:in `dispatch'
actionpack (3.1.3) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
actionpack (3.1.3) lib/action_controller/metal.rb:236:in `action'
actionpack (3.1.3) lib/action_dispatch/routing/route_set.rb:65:in `call'
actionpack (3.1.3) lib/action_dispatch/routing/route_set.rb:65:in `dispatch'
actionpack (3.1.3) lib/action_dispatch/routing/route_set.rb:29:in `call'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:152:in `call'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:96:in `recognize'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:75:in `optimized_each'
rack-mount (0.8.3) lib/rack/mount/code_generation.rb:95:in `recognize'
rack-mount (0.8.3) lib/rack/mount/route_set.rb:141:in `call'
actionpack (3.1.3) lib/action_dispatch/routing/route_set.rb:532:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
rack (1.3.5) lib/rack/etag.rb:23:in `call'
rack (1.3.5) lib/rack/conditionalget.rb:25:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/head.rb:14:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/flash.rb:247:in `call'
rack (1.3.5) lib/rack/session/abstract/id.rb:195:in `context'
rack (1.3.5) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/cookies.rb:331:in `call'
activerecord (3.1.3) lib/active_record/query_cache.rb:64:in `call'
activerecord (3.1.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/callbacks.rb:29:in `call'
activesupport (3.1.3) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.3) lib/active_support/callbacks.rb:81:in `send'
activesupport (3.1.3) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.3) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/reloader.rb:68:in `call'
rack (1.3.5) lib/rack/sendfile.rb:101:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.3) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.5) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.5) lib/rack/runtime.rb:17:in `call'
activesupport (3.1.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.5) lib/rack/lock.rb:15:in `call'
actionpack (3.1.3) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.1.3) lib/rails/engine.rb:456:in `call'
rack (1.3.5) lib/rack/content_length.rb:14:in `call'
railties (3.1.3) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.3.5) lib/rack/handler/webrick.rb:59:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.3.5) lib/rack/handler/webrick.rb:13:in `run'
rack (1.3.5) lib/rack/server.rb:265:in `start'
railties (3.1.3) lib/rails/commands/server.rb:70:in `start'
railties (3.1.3) lib/rails/commands.rb:54
railties (3.1.3) lib/rails/commands.rb:49:in `tap'
railties (3.1.3) lib/rails/commands.rb:49
script/rails:6:in `require'
script/rails:6