This project is archived and is in readonly mode.
Setting the I18n.locale in ActionMailer raises SystemStackError
Reported by Jiří Zajpt | August 7th, 2010 @ 04:04 PM
When using I18n.with_locale function inside a function called from ActionMailer::Base, SystemStackError (stack level too deep) is raised. Also, simply changing locale with I18n.locale= results in the same exception. When using outside of ActionMailer, everything works as expected.
Stack trace:
SystemStackError (stack level too deep):
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_view/lookup_context.rb:174:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/rendering.rb:28:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_view/lookup_context.rb:175:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/rendering.rb:28:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_view/lookup_context.rb:175:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/rendering.rb:28:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_view/lookup_context.rb:175:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/rendering.rb:28:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_view/lookup_context.rb:175:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/rendering.rb:28:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_view/lookup_context.rb:175:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/rendering.rb:28:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_view/lookup_context.rb:175:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/rendering.rb:28:in `locale='
….
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_view/lookup_context.rb:175:in `locale='
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/rendering.rb:28:in `locale='
i18n (0.4.1) lib/i18n.rb:39:in `locale='
app/models/invoice_pdf.rb:26:in `to_pdf'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/activesupport/lib/active_support/dependencies.rb:442:in `each_with_index'
app/models/invoice_pdf.rb:20:in `each'
app/models/invoice_pdf.rb:20:in `each_with_index'
app/models/invoice_pdf.rb:20:in `to_pdf'
app/mailers/invoice_mailer.rb:6:in `email'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/base.rb:148:in `send_action'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/base.rb:148:in `process_action'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/base.rb:117:in `process'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/rendering.rb:40:in `process'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionmailer/lib/action_mailer/old_api.rb:75:in `process'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionmailer/lib/action_mailer/base.rb:446:in `process'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionmailer/lib/action_mailer/base.rb:441:in `initialize'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionmailer/lib/action_mailer/base.rb:425:in `new'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionmailer/lib/action_mailer/base.rb:425:in `method_missing'
app/controllers/invoice_emails_controller.rb:20:in `create'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/base.rb:148:in `process_action'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_controller/metal/rendering.rb:11:in `process_action'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/callbacks.rb:18:in `process_action'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/activesupport/lib/active_support/callbacks.rb:445:in `_run__1023616770__process_action__1623385099__callbacks'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/activesupport/lib/active_support/callbacks.rb:404:in `send'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/activesupport/lib/active_support/callbacks.rb:404:in `_run_process_action_callbacks'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/activesupport/lib/active_support/callbacks.rb:93:in `send'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/activesupport/lib/active_support/callbacks.rb:93:in `run_callbacks'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/callbacks.rb:17:in `process_action'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/activesupport/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/activesupport/lib/active_support/notifications.rb:52:in `instrument'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_controller/metal/instrumentation.rb:29:in `process_action'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_controller/metal/rescue.rb:17:in `process_action'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/base.rb:117:in `process'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/abstract_controller/rendering.rb:40:in `process'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_controller/metal.rb:133:in `dispatch'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_controller/metal.rb:173:in `action'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/routing/route_set.rb:62:in `dispatch'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/routing/route_set.rb:27:in `call'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:89:in `recognize'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:87:in `optimized_each'
rack-mount (0.6.9) lib/rack/mount/code_generation.rb:88:in `recognize'
rack-mount (0.6.9) lib/rack/mount/route_set.rb:139:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/routing/route_set.rb:492:in `call'
haml (3.0.15) lib/sass/plugin/rack.rb:41:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/best_standards_support.rb:8:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.1) lib/rack/methodoverride.rb:24:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/flash.rb:177:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/cookies.rb:268:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/callbacks.rb:46:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/activesupport/lib/active_support/callbacks.rb:410:in `_run_call_callbacks'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.1) lib/rack/sendfile.rb:107:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/show_exceptions.rb:48:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/railties/lib/rails/rack/logger.rb:13:in `call'
rack (1.2.1) lib/rack/runtime.rb:17:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/activesupport/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
rack (1.2.1) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.1) lib/rack/lock.rb:11:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/static.rb:30:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/railties/lib/rails/application.rb:168:in `call'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/railties/lib/rails/application.rb:77:in `send'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/railties/lib/rails/application.rb:77:in `method_missing'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/railties/lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.1) lib/rack/content_length.rb:13:in `call'
rack (1.2.1) lib/rack/handler/webrick.rb:52:in `service'
/Users/jzajpt/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/Users/jzajpt/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/Users/jzajpt/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/Users/jzajpt/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/webrick/server.rb:162:in `start'
/Users/jzajpt/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/Users/jzajpt/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/webrick/server.rb:95:in `start'
/Users/jzajpt/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/webrick/server.rb:92:in `each'
/Users/jzajpt/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/webrick/server.rb:92:in `start'
/Users/jzajpt/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/webrick/server.rb:23:in `start'
/Users/jzajpt/.rvm/rubies/ruby-1.8.7-p299/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.1) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.1) lib/rack/server.rb:213:in `start'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/railties/lib/rails/commands/server.rb:65:in `start'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/railties/lib/rails/commands.rb:30
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/railties/lib/rails/commands.rb:27:in `tap'
/Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/railties/lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
Rendered /Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.erb (89.7ms)
Rendered /Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (76.0ms)
Rendered /Users/jzajpt/.rvm/gems/ruby-1.8.7-p299@rails3/bundler/gems/rails-0953c04/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (175.8ms)
Comments and changes to this ticket
-
Maximilian Schulz December 15th, 2010 @ 12:36 AM
Ok, I should have google earlier… I have the exact same error. I moved my I18n.with_locale code out of the mail vier, as I have always got deprecation warnings for the block helper (although it does not make any sense). So my mailer looks like this:
I18n.in_locale(locale) do
mail :to => @user.to_email_recipient,:subject => I18n.t("new_message.subject", :title => @topic.subject)
end
And it seems to work for some methods in the mailer and breaks on others. And I have no clue whats happening!
-
Maximilian Schulz December 15th, 2010 @ 01:20 AM
Ok, this is actually not a problem with the I18n.with_locale feature, but has to do with exceptions raised in the associated mail view. The with_locale call just hides the real error, which is really annoying!
-
Thiago Morello December 20th, 2010 @ 03:56 PM
I've got the same problem with "with_locale" method.
When sending using rails console everything works fine, but when calling from a controller I get the same error. -
aka47 December 28th, 2010 @ 06:22 PM
- Assigned user set to José Valim
i also get this problem in rails 3.0.3 ... the locale= in abstract_controller/rendering.rb and this call action_view/lookup_context.rb and this call the first again. Endless loop.
# ree-1.8.7-2010.01@rails3/gems/actionpack-3.0.3/lib/abstract_controller/rendering.rb:28:in `locale=' # ree-1.8.7-2010.01@rails3/gems/actionpack-3.0.3/lib/action_view/lookup_context.rb:175:in `locale='
José added a TODO to deprecate I18n.locale from controllers, but it does not say how the new api should is. I hope this will fix it.
I could fix it by removing the I18nProxy
# ree-1.8.7-2010.01@rails3/gems/actionpack-3.0.3/lib/abstract_controller/rendering.rb:39 + old_config, I18n.config = I18n.config, I18n.config - old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
or better patch it via config/initializer/rails3_abstract_controller_rendering_fix.rb
module AbstractController::Rendering def process(*) super end end
-
José Valim December 28th, 2010 @ 09:46 PM
- State changed from new to needs-more-info
- Importance changed from to Low
I cannot reproduce. Could someone provide a test case to Action Mailer test suite?
-
Frank Fischer January 14th, 2011 @ 08:39 AM
I have the same problem using an I18n.locale call within the actionmailer method. The error triggers if the actionmailer-method is called from from inside a controller. Find a diff containing the testcase added.
Thank you Jose for pointing me in the right direction how to trigger the error in the testcase! -
f.svehla January 16th, 2011 @ 08:56 AM
- Tag changed from actionmailer, locale to actionmailer, i18n, infinity, locale
Simply calling I18n.locale= in an ActionMailer method is sufficient to trigger this bug.
-
f.svehla January 16th, 2011 @ 08:57 AM
- Title changed from Using I18n.with_locale in ActionMailer raises SystemStackError to Setting the I18n.locale in ActionMailer raises SystemStackError
-
Frank Fischer January 18th, 2011 @ 12:02 AM
@f.svhela: Can you provide a test case to prove your point? It's because I have one proving you are wrong ;). Btw. - This was the reason why Jose couldn't reproduce the error in first place.
-
eddyk January 19th, 2011 @ 10:04 PM
I can confirm seeing the stack problem when the mailer is created in a controller. In my unit tests, generating the email worked fine.
The monkey patch from aka47 appears to work.
{mkd-extraction-08d005cc18c52729bf1100e0f5943312}
module AbstractController::Rendering
def process(*)end end
-
Repository January 19th, 2011 @ 10:43 PM
- State changed from needs-more-info to resolved
(from [262b2ea8cda20999ddf8c4bf13b7a70453e996d2]) Solve SystemStackError when changing locale inside ActionMailer [#5329 state:resolved] https://github.com/rails/rails/commit/262b2ea8cda20999ddf8c4bf13b7a...
-
Repository January 19th, 2011 @ 10:43 PM
(from [b247f3944282fb22c68fd4f9248a16fcda63b186]) Added a testcase for bug [#5329]
Signed-off-by: José Valim jose.valim@gmail.com
https://github.com/rails/rails/commit/b247f3944282fb22c68fd4f9248a1... -
Repository January 19th, 2011 @ 10:44 PM
(from [b4bc49c67388330a85a58cc790bbdb7edfa3ee80]) Added a testcase for bug [#5329]
Signed-off-by: José Valim jose.valim@gmail.com
https://github.com/rails/rails/commit/b4bc49c67388330a85a58cc790bbd... -
Repository January 19th, 2011 @ 10:44 PM
(from [46b23f8a7a6aec5066f740de16e6419828db8be4]) Solve SystemStackError when changing locale inside ActionMailer [#5329 state:resolved] https://github.com/rails/rails/commit/46b23f8a7a6aec5066f740de16e64...
-
eddyk January 20th, 2011 @ 12:42 AM
module AbstractController class I18nProxy def initialize(i18n_config, lookup_context) @i18n_config, @lookup_context = i18n_config, lookup_context @i18n_config = @i18n_config.i18n_config if @i18n_config.respond_to?(:i18n_config) end end end
Here's a bit a code my coworker came up with to prevent the infinite recursion that occurs when setting the I18n config in an actionmailer context, which is called from an actioncontroller.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 5329 Setting the I18n.locale in ActionMailer raises SystemStackError (from [262b2ea8cda20999ddf8c4bf13b7a70453e996d2]) Solve S...
- 5329 Setting the I18n.locale in ActionMailer raises SystemStackError (from [b247f3944282fb22c68fd4f9248a16fcda63b186]) Added a...
- 5329 Setting the I18n.locale in ActionMailer raises SystemStackError (from [b4bc49c67388330a85a58cc790bbdb7edfa3ee80]) Added a...
- 5329 Setting the I18n.locale in ActionMailer raises SystemStackError (from [46b23f8a7a6aec5066f740de16e6419828db8be4]) Solve S...