Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack level too deep (SystemStackError) after upgrading from 4.6.1 to 4.6.2 #1520

Closed
knapo opened this issue Jul 29, 2021 · 4 comments · Fixed by #1517
Closed

stack level too deep (SystemStackError) after upgrading from 4.6.1 to 4.6.2 #1520

knapo opened this issue Jul 29, 2021 · 4 comments · Fixed by #1517
Assignees
Projects
Milestone

Comments

@knapo
Copy link
Contributor

knapo commented Jul 29, 2021

Describe the bug
Per 4dc603b#commitcomment-54080150

4.6.2 extends Rake::Task with aliasing execute method. Unfortunately this causes stack level too deep (SystemStackError), when Rake::Task#execute is overridden using #prepend

To Reproduce

Create a Rakefile:

require 'bundler/inline'
require 'rake'

module MyGem
  module Task
    def execute(...)
      # do something
      super(...)
    end
  end
end

Rake::Task.prepend(MyGem::Task)

require 'sentry-ruby'

task(:test) { }

Run rake test

Expected behavior

rake test should not cause SystemStackError

Actual behavior

rake test ends with SystemStackError

Environment

  • Ruby Version: 3.0.2
@xiazek
Copy link

xiazek commented Jul 29, 2021

👍 Similar problem on my project.

@st0012
Copy link
Collaborator

st0012 commented Jul 29, 2021

Thanks for raising the issue to also let other users add reaction to it 👍

I just checked a few similar gems that have rake integration. These are prepend-only ones:

newrelic-ruby-agent supports both method aliasing and prepend, but since 7.0 the default would be prepend.

And scout_apm, which uses method aliasing for patching classes (see #1427 for more detail), doesn't have rake integration.

So I think it's relatively safe to move from method aliasing to prepend 🙂

@st0012 st0012 added this to the 4.7.0 milestone Jul 29, 2021
@st0012 st0012 added this to To do in 4.x via automation Jul 29, 2021
4.x automation moved this from To do to Done Jul 29, 2021
@st0012 st0012 modified the milestones: 4.7.0, 4.6.4 Jul 29, 2021
@st0012
Copy link
Collaborator

st0012 commented Jul 29, 2021

@knapo thanks again for the reporting and PR. I've released 4.6.4, which contains the fix 🙂

@knapo
Copy link
Contributor Author

knapo commented Jul 29, 2021

Great, thx a lot too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
4.x
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants